Hi all, I’ve been trying to share a generated kube...
# kubernetes
Hi all, I’ve been trying to share a generated kubeconfig practically copied from https://github.com/pulumi/examples/blob/master/gcp-ts-gke/cluster.ts between stacks. Following the https://www.pulumi.com/docs/intro/concepts/organizing-stacks-projects/#inter-stack-dependencies guide gets me the right kubeconfig variable in another stack. Only when I try to connect to the same cluster from the other stack I get the following error:
error: configured Kubernetes cluster is unreachable: unable to load schema information from the API server: Get https://<DIFFERENT_IP_THAN_CLUSTER>/openapi/v2?timeout=32s: dial tcp <DIFFERENT_IP_THAN_CLUSTER>:443: i/o timeout
. It seems like I’m missing a step, did anyone encounter this before?
Make sure that all of your k8s resources are setting the
opt to that exported value. If this opt is not set, it will default to using the ambient kubeconfig settings, so it may be pointing to a locally configured cluster by mistake.
Ah yes thats it! For one of the resources I forgot to set the provider. This saved me a ton of googling, thank you!
👍 1
Some users also like to set an invalid
as part of the stack config to prevent this mistake.
pulumi config set kubernetes:config:kubeconfig "dummy"
This will cause those resources to fail with an error
Oh that’s great, thanks 🙂