Using Helm_Release with dynamic config

Hi,

I have setup a fairly big (at least for me) repo with a possibility to deploy machine on my proxmox hypervisor.
After that, it will deploy kubernetes with either rke or k3s.

Those two will create a kubeconfig.yaml file.
I wish to use this generated file into the config_path of the helm provider.

The issue is that the file does not exist at startup and I could not figure out how to do it in a proper way.

In other words, is it possible to initiate the helm provider with an not “yet” existing kubeconfig.yaml file.

Thx

Hi,

Are you using Rancher to deploy rke ?

I got a similar issue and I’m using a local_file resource to generate the kubeconfig file, which can used by helm.

resource "local_file" "kubeconfig" {
  filename = pathexpand("~/.kube/${rancher2_cluster.k8s_cluster.name}")
  sensitive_content  = rancher2_cluster.k8s_cluster.kube_config
 }

provider "helm" {
   kubernetes {
   config_path = local_file.kubeconfig.filename
    }
 }