Hi, i have a strange issue that pulumi tries to co...
# kubernetes
f
Hi, i have a strange issue that pulumi tries to comunicate with a deleted cluster. I have created a EKS cluster, added some stuff and deleted it afterwards with
pulumi down
. Now i've added a Helm chart using
kubernetes.helm.v4.Chart()
and now
pulumi up
fails because it can not reach the controlplane API url from the previous cluster (which is deleted of course). I've added the cluster as a dependency to the chart, but that didn't helped. Where does pulumi gets the old API url from? The stack is empty and i even tried to delete and re-create the stack, but that does not help. I can see that the API url is still in the
history
and
backups
directories within my local state directory when i
grep
for it. But i assume that should not have any impact?
The error message that i get is:
Copy code
error: kubernetes:helm.sh/v4:Chart resource 'external-secrets' has a problem: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: Get "<https://XXX.xxx.eu-central-1.eks.amazonaws.com/openapi/v2?timeout=32s>": dial tcp: lookup XXX.xxx.eu-central-1.eks.amazonaws.com on 10.255.255.254:53: no such host
Some (very) simplified code of my setup
Ha, explicitly creating and referencing a provider helped:
Copy code
const k8sProvider = new kubernetes.Provider("k8s-provider", {
  kubeconfig: cluster.kubeconfig,
});
q
The reason behind this is that the k8s resources use the default provider if you do not specify one. That default provider just looks at your kubeconfig (i.e.
~/.kube/config
). I'd recommend always defining explicit providers for your k8s resources and if possible even disabling default providers for that: https://www.pulumi.com/docs/iac/concepts/resources/providers/#disabling-default-providers
👍 1