https://pulumi.com logo
Title
p

purple-coat-77714

01/28/2020, 5:11 PM
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?
g

gorgeous-egg-16927

01/28/2020, 5:19 PM
Make sure that all of your k8s resources are setting the
provider
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.
p

purple-coat-77714

01/28/2020, 5:22 PM
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
g

gorgeous-egg-16927

01/28/2020, 5:23 PM
Some users also like to set an invalid
kubeconfig
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
p

purple-coat-77714

01/28/2020, 5:31 PM
Oh that’s great, thanks 🙂