Hi, can anyone suggest a way to get over the error...
# kubernetes
m
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
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
@salmon-account-74572 Thank you, I've cleaned up some resources and edited the state to cleanup others.
s
Glad you were able to make progress! All good now?
m
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
Try running
PULUMI_K8S_DELETE_UNREACHABLE=true pulumi refresh
to see if that cleans up the dangling Kubernetes resources.
m
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
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
Filed this issue: https://github.com/pulumi/pulumi-kubernetes/issues/2517 @salmon-account-74572
174 Views