i'm trying to generate a kubeconfig to instantiate...
# google-cloud
d
i'm trying to generate a kubeconfig to instantiate a kubernetes provider from a pulumi-managed GKE cluster. i've read https://github.com/pulumi/pulumi-gcp/issues/1064 and converted the snippet here (linked in that issue) to python, and it produces a valid kubeconfig. but when i try to use the provider i've created, it simply ignores the kubeconfig i've passed in; if there's a
~/.kube/config
present on the machine, it uses that, and if there isn't, it errors out. code is here. what am i missing?
fwiw, when i dump the generated kubeconfig to a file, i can use
kubectl
with that file just fine. it's not a config generation issue
if i do a
pulumi up
on a system without an existing kube config, i get:
Copy code
error: configured Kubernetes cluster is unreachable: unable to load Kubernetes client configuration from kubeconfig file. Make sure you have:
    
         • set up the provider as per <https://www.pulumi.com/registry/packages/kubernetes/installation-configuration/>
    
     invalid configuration: no configuration has been provided, try setting KUBERNETES_MASTER environment variable
most of the hits for that error message are related to terraform and it's unclear how to apply them to pulumi, or to the case of a generated kubeconfig file
a
so when you run that function, that should give you the provider. is it failing on the provider initialization or later on?.
d
later on, when i try to actually use the provider to manage a resource
a
random thing, but did you try wiping the current kubeconfig stack output?
if it is in "pulumi stack output"
d
there is definitely no kubeconfig output in
pulumi stack output
. it's not exported
incidentally, the docs claim that the
kubeconfig
kwarg can be either the contents of a kubeconfig, or a path to the file; neither one works. this really feels like a bug in the k8s python sdk