hi guys, im trying to setup an AKS cluster then fo...
# azure
h
hi guys, im trying to setup an AKS cluster then follow up and install a helm chart, i've managed to do the first,
managed_cluster = containerservice.ManagedCluster
creds = containerservice.list_managed_cluster_user_credentials_output(
resource_group_name=resource_group.name,
resource_name=managed_cluster.name)
encoded = creds.kubeconfigs[0].value
self.kubeconfig = encoded.apply(
lambda enc: base64.b64decode(enc).decode())
pulumi.export("kubeconfig", self.kubeconfig)
but how do I fetch kubeconfig to be used by the Helm release ?
helm_release = Release(
"traefik",
ReleaseArgs(XXX
),
ResourceOptions(provider=k8s_provider),
)
I think this is related to Output feature, but I'm lost
b
not sure if the ManagedCluster has the kubeconfig as a built-in property, what we did, is just created an output which gets you the azcli command:
Copy code
az_command = Output.all(aksResourceGroup.name, cluster.name).apply(
    lambda args: f"az aks get-credentials --resource-group {args[0]} --name {args[1]}"
)
also there's creds and kubeconfig outputs in this example: https://www.pulumi.com/registry/packages/kubernetes/how-to-guides/aks/
w
Here's an example of exactly that... Https://github.com/martinjt/aks-otel-demo
h
awesome, yes it worked i was looking for this:
Copy code
custom_provider = Provider(
    "inflation_provider", kubeconfig=kube_config
)
which I missed in the official tutorial Peter mentioned, I also liked how you structured the app Martin thanks a lot