I am trying to create a deployment which is deployed on K8S instance on which it does migration of services. This needs kubeconfig as part of the code right now. We do not have access to create service accounts. We also have kubectl binary inside the container which does some operations. Whats the best way to take kubeconfig as input ?
Kubernetes kubeconfig inside pod
helmkubernetes
Best Answer
Volume mount the kubeconfig that is in a
Secret
, and then point theKUBECONFIG
environment variable at the path in which theSecret
is mounted