How do I force helm.v3 to use a custom kube-config...
# general
v
How do I force helm.v3 to use a custom kube-config location without using global env variables? In my case, I have multiple k8 clusters (and hence multiple kube configs that are kept in different folders). When I launch helm, I’d like to point it to a specific cluster’s kube config. This is what my code looks like:
Copy code
# Deploy the bitnami/wordpress chart.
edgeChart = Release(
    "lilac-edge",
    ReleaseArgs(
        chart="./lilac-edge",
        version="0.1.0",
        namespace="lilac-edge",
        values=values,
        timeout=600
    ),
)
This works as long as ~/.kube/cofig is setup OR set the KUBECONFIG env variable is set. I will be unable to do either of the above as my code is running inside flask application (actually flask + celery) and the specific cluster is chose based on the input received. Is there a way to set the kube config location at the per pulumi stack level ? can we setup ENV variables on a per stack basis?
b
You should be able to pass a provider when creating this resource, and the provider can be configured however you want.
v
thanks @bored-table-20691, can you point me to an example of using a provider with Helm Release I am checking https://www.pulumi.com/registry/packages/kubernetes/api-docs/helm/v3/release/ and I cannot see a provider parameter in the documentation or the usage example
b
It's passed as part of the opts argument
This is true in all resources
v
thanks , this works!!👍