Hello here, I have a strange situation where a res...
# kubernetes
b
Hello here, I have a strange situation where a resource in my production cluster has been deleted, but the Pulumi stack is not in sync. During the GitHub actions, I made a refresh before the up, but nothing worked. The refresh hasn’t fixed the stack state, so the refresh finished well, but the up ended up with an error saying that:
Copy code
kubernetes:apps/v1:Deployment app1_appDeployment updating (0s) [diff: ~spec]
   ~  kubernetes:apps/v1:Deployment app1_appDeployment updating (0s) [diff: ~spec]; error: update of resource apps/app1-deployment failed because the Kubernetes API server reported that it failed to fully initialize or become live: deployments.apps "app1-deployment" not found
   ~  kubernetes:apps/v1:Deployment app1_appDeployment **updating failed** [diff: ~spec]; error: update of resource apps/app1-deployment failed because the Kubernetes API server reported that it failed to fully initialize or become live: deployments.apps "app1-deployment" not found
  @ updating.....
      pulumi:pulumi:Stack apps-pl-app1-production running error: update failed
      pulumi:pulumi:Stack apps-pl-app1-production **failed** 1 error
I cannot delete the stack because the other resources are there and I can’t lose the production, but the stack cannot recreate app1 deployment. I tried editing the stack file manually, but since there are resources depending on such missing app1_appDeployemnt I don’t know what solution I can use. Any idea 🙏?
v
Was the resource deleted manually? I’d have thought a refresh would’ve fixed it. I’ve seen similar errors with my stacks where the pod still exists in k8s in the deleting state for a long time so pulumi thinks it’s already there, but never seen the problem you’ve got
b
The pod was deleted when K8s was trying to recreate, unfortunately the pod was then deleted but the pulumi state file was not updated properly so now, I have the production pod deleted, all the other production resources live, but I can’t restore the deleted pod using a refresh nor a up and I don’t know how to solve the issue unfortunately
v
You could try temporarily removing the dependsOn dependencies in tbe code, running a pulumi up, deleting the resource from state then adding the dependsOn back and running pulumi up again?
b
I’ll try for sure! Thanks a lot for the suggestion. I’ll let you know how it will go
Hey @victorious-church-57397 your suggestion worked like a charm. Thanks a lot for your suggestion!