I’ve deleted the EKS cluster that a bunch of my re...
# kubernetes
I’ve deleted the EKS cluster that a bunch of my resources were deployed onto and created a new one (this is all with Pulumi in a different project/stack). In the stack that was in charge of those resources, I am trying to do a
pulumi up
, and it created resources on my new cluster just fine, but is failing to delete the old resources since that EKS cluster no longer exists. 1. Is this expected? 2. How should I get out of this situation? The old resources can’t really exist by definition anymore since the EKS cluster is gone.
pulumi refresh
errors out in the same way.
if all the resources only existed on the k8s cluster you could just do a
pulumi stack rm
and start fresh
There’s some stuff on S3 and RDS - I don’t have a problem nuking those, but probably would prefer to not orphan them (and would prefer to avoid doing it manually).
ah. in that case i'd run
Copy code
pulumi state delete
for every k8s resource
is there a way to find every resource that’s “pending deletion”
i don't know... might have to parse the state file for that. but
pulumi stack --show-urns
will give you all the URNs in your stack so you can just grep/filter for kubernetes resources
Copy code
$ pulumi state delete "urn:pulumi:tenant-itay8::okera-trial-tenants::kubernetes:apps/v1:Deployment::presto_coordinatorDeployment"
 warning: This command will edit your stack's state directly. Confirm? Yes
 Multiple resources with the given URN exist, please select the one to edit:  [Use arrows to move, enter to select, type to filter]
> "itay8/presto-coordinator"
  "itay8/presto-coordinator" (Pending Deletion)
Good to know multiple things with an URN can exist 🙂
it's expected behaviour yes, don't delete the cluster before you delete the resources, because otherwise the API to call no longer exists 😄
Good to know 🙂 What’s the best way to get out of it? Just delete the URNs one by one and select the “pending deletion” ones?
yeah basically that's your best option. You might find it easier to do
pulumi stack export > stack.json
update the json to remove the resources
pulumi stack import --file stack.json
In the stack.json, am I just looking for ones in which
"delete": true
is set?
since I seem to have two copies of each resource
OK that seemed to work