https://pulumi.com logo
#general
Title
# general
b

bulky-noon-79266

10/10/2023, 5:47 AM
(yaml) I'm trying to create an AKS cluster + install helm chart (ingress-nginx), but I didn't find a way to tell to pulumi to wait for AKS cluster creation completed before execute helm and I didn't find how to pass kubeconfig between AKS creation stage and helm stage. Any idea / example ?
s

salmon-account-74572

10/10/2023, 1:55 PM
@bulky-noon-79266 Take a look at our AKS example, found at https://github.com/pulumi/templates/tree/master/kubernetes-azure-yaml and you’ll see an example of how to get the Kubeconfig. Use that Kubeconfig to create a new explicit provider, and then use that explicit provider for your Helm chart.
b

bulky-noon-79266

10/10/2023, 1:57 PM
Hi, Thanks a lot, it should work
Actually, that's already what's I'm doing, I have the kubeconfig at the end of the pulumi up but I have another stage (type: kubernetes:helm.sh/v3:Release) just after managed cluster creation, in the same yaml, that needs cluster kubeconfig
I'm looking for a way to use the kubeconfig in the kuberneteshelm.sh/v3Release stage
if I try to use the variable, the kubernetes:helm.sh/v3:Release stage doesn't wait for the azure-nativecontainerserviceManagedCluster to be completed
s

salmon-account-74572

10/10/2023, 2:06 PM
Right---you need to create a Kubernetes provider, specifying the Kubeconfig when creating the provider. Then, you specify that provider when creating the Helm chart resource.
b

bulky-noon-79266

10/10/2023, 2:08 PM
ok, I understand, this is the example I'm looking for
+ ├─ azure-nativecontainerserviceManagedCluster managedCluster create + ├─ kubernetes:helm.sh/v3:Release ingressController create + └─ pulumiproviderskubernetes kubernetesProvider create
helm stage doesn't seems to be linked to the kubernetes provider
s

salmon-account-74572

10/10/2023, 3:00 PM
Did you specify the Kubernetes provider as the provider to use for the Helm resource? Otherwise, it won’t know and it will try to use the default provider and won’t know to take a dependency on the cluster itself.
b

bulky-noon-79266

10/10/2023, 3:02 PM
that's my issue, helm try to use my ~/.kube/config instead of the generated config file
event if I drop ~/.kube from my filesystem
s

salmon-account-74572

10/10/2023, 3:04 PM
You need to specify the explicit provider you created as the one to use for the Helm resource, see https://www.pulumi.com/docs/concepts/options/provider/
b

bulky-noon-79266

10/10/2023, 3:10 PM
it's ok now
kubernetesProvider: type: pulumiproviderskubernetes properties: kubeconfig: ${actualKubeConfig} ingressController: type: kuberneteshelm.sh/v3Release options: provider: ${kubernetesProvider} properties:
it could be great to add a yaml example with custom provider, this information is not easy to find
Thanks a lot, have a nice day Scott
s

salmon-account-74572

10/10/2023, 3:20 PM
Happy to help. You have a great day, too!
4 Views