connect to shell terminal of other container in a pod connect to shell terminal of other container in a pod kubernetes kubernetes

connect to shell terminal of other container in a pod


docker run -it -v ~/.kube:/root/.kube lachlanevenson/k8s-kubectl get nodes

  1. First off, every Pod within a k8s cluster has its own k8s credentials provided by /var/run/secrets/kubernetes.io/serviceaccount/token, and thus there is absolutely no need to attempt to volume mount your home directory into a docker container
  2. The reason you are getting the error about client-cert is because the contents of ~/.kube are merely strings that point to the externally defined ssl key, ssl certificate, and ssl CA certificate defined inside ~/.kube/config -- but I won't speak to fixing that problem further since there is no good reason to be using that approach