https://pulumi.com logo
#kubernetes
Title
# kubernetes
m

mammoth-caravan-43791

07/20/2023, 1:36 PM
Hi, can anyone suggest a way to get over the errors:
Copy code
warning: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: ...
error: Preview failed: failed to read resource state due to unreachable cluster. If the cluster has been deleted, you can edit the pulumi state to remove this resource or retry with the PULUMI_K8S_DELETE_UNREACHABLE environment variable set to true.
I'm getting this with
pulumi up
,
pulumi refresh
and
pulumi destroy
- probably something got misconfigured in my setup.
s

salmon-account-74572

07/20/2023, 2:46 PM
You can set the environment variable
PULUMI_K8S_DELETE_UNREACHABLE
to true and re-run your commands, but be aware that will remove resources from your Pulumi state. The only other fix is to correct whatever problem is preventing Pulumi from being able to contact the specified Kubernetes cluster. Maybe you’re using the default Kubernetes provider and your local Kubeconfig isn’t correct?
m

mammoth-caravan-43791

07/21/2023, 2:45 AM
@salmon-account-74572 Thank you, I've cleaned up some resources and edited the state to cleanup others.
s

salmon-account-74572

07/21/2023, 3:18 PM
Glad you were able to make progress! All good now?
m

mammoth-caravan-43791

07/21/2023, 5:48 PM
Somehow, my Pulumi state appears to be corrupted. I've terminated the EKS cluster, and having a lot of dangling resources in Pulumi that won't get auto-removed with
PULUMI_K8S_DELETE_UNREACHABLE=true pulumi destroy
though I can see the messages
error: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: ...
and
If the cluster has been deleted, you can edit the pulumi state to remove this resource
s

salmon-account-74572

07/21/2023, 5:49 PM
Try running
PULUMI_K8S_DELETE_UNREACHABLE=true pulumi refresh
to see if that cleans up the dangling Kubernetes resources.
m

mammoth-caravan-43791

07/21/2023, 5:56 PM
Refresh (with the said ^ command) is failing with
error: Preview failed: failed to read resource state due to unreachable cluster. If the cluster has been deleted, you can edit the pulumi state to remove this resource
due to unreachable cluster. And there are too many resources to delete manually.
s

salmon-account-74572

07/21/2023, 7:08 PM
Would you mind filing an issue on https://github.com/pulumi/pulumi-kubernetes? That environment variable (which also corresponds to the
deleteUnreachable
provider configuration option) should help with this issue. If it isn’t, then there may be more going on here.
m

mammoth-caravan-43791

07/24/2023, 1:37 PM
Filed this issue: https://github.com/pulumi/pulumi-kubernetes/issues/2517 @salmon-account-74572
17 Views