Skip to content

fix: in-cluster config should be the fallback if no kubeconfig is found

Robin Graillon requested to merge fix-kubecontext-incluster into master

I have the following issue:

I'm running my app in a pod, and I want it tu use a particular kubeconfig to authenticate, not using in-cluster config.

I put a kubeconfig file somewhere in my filesystem, set the KUBECONFIG to the right location, but when I use the K8S client, I'm logged as the pod's service account, not the one from my kubeconfig.

IMO the lib should try to find the kubeconfig first before falling back to in-cluster config if nothing is found.

I hope this change is safe to merge I cannot measure the impacts

Edited by Robin Graillon

Merge request reports