Hi. Iโ€™m trying to initialize the k8s provider's `k...
# general
c
Hi. Iโ€™m trying to initialize the k8s provider's
kubeconfig
parameter with the output of a Azure
KubernetesCluster
resource. But for some reason, when I run
pulumi up
before even provisioning anything, it fails because the
k8s
resource already tries to connect to the cluster (which doesn't exist at this point in time). I thought that a missing dependency was the issue, but even when I specify the dependency explicitly, it will fail with the connection error. Any ideas? Basically I just want to provision a cluster (with azure provider) and then configure that same cluster (with k8s provider).
b
i do this and havent had any issues, do you want to pastebin some code?
c
l
create the k8s provider based on an output from the cluster resource. This is a snippet of working code
Copy code
// Expose a k8s provider instance of the cluster.
this.provider = new k8s.Provider(`${name}-aks`, {
     kubeconfig: this.cluster.kubeConfigRaw,
}, { parent: this });
b
specify the provider ConfigFile explicitly - it's likely coming from an ambient provider instead
{ dependsOn: [cluster], provider: cluster }
there's a long-standing issue where unless you specify it, an ambient one from your current env. will be used
c
Aaah, yes,
provider: cluster
did the trick! Awesome! Thatโ€™s what I was looking for.
b
remember to do it for everything ๐Ÿ˜„
there is a workaround so that it will fail-fast if you forget but i can't remember what it is
c
Yes, good that Iโ€™m only getting started. Learning early. ๐Ÿ˜„
b
i need to start using that myself actually
c
Well thank you very much for the help ๐Ÿ˜Š
๐Ÿ‘ 1
w