[FEATURE] Special Handling for KUBECONFIG
Is your feature request related to a problem? Please describe.
kubectl can only be configured by setting KUBECONFIG to a file path and having the file contain the configuration.
Describe the solution you'd like
When KUBECONFIG exists within a config and we use doppler run, the contents should be mounted and KUBECONFIG env should point to the mounted location
Describe alternatives you've considered
Nothing is really good, we need to write the file to a location ourselves - but Doppler can already do some nice mounting stuff
Additional context
N/A
Just to make sure I understand, you'd want to mount the contents of an individual secret (in this case KUBECONFIG) to its own file. Is that right?
Yeah. In Doppler there’d be a secret called KUBECONFIG and when I do Doppler run, I’d want /magic/fs/kubeconfig to be a file with the KUBECONFIG contents and the environment variables KUBECONFIG to be set to the path of said file
Hi @rawkode,
Here is how you could achieve this today using a mounted secrets file.
Create the template to render the contents of the Kube config file:
# kube-config.tmpl
{{.KUBE_CONFIG}}
Then run:
KUBECONFIG=./kube-config doppler run --mount kube-config --mount-template ./kube-config.tmpl -- kubectl get secrets