kubectl needs a config file to connect to the api-server. It is typically stored at ~/.kube/config
I have a pod in my cluster. It has the kubectl binary
# ls -al /usr/local/bin/kubectl -rwxr-xr-x 1 root root 43115328 Apr 8 18:38 ./usr/local/bin/kubectl
and also these 3 files:
# cd /run/secrets/kubernetes.io/serviceaccount # ls -al lrwxrwxrwx 1 root root 13 May 15 22:45 ca.crt -> ..data/ca.crt lrwxrwxrwx 1 root root 16 May 15 22:45 namespace -> ..data/namespace lrwxrwxrwx 1 root root 12 May 15 22:45 token -> ..data/token
Can I contruct a config file from the ca.crt, namespace, token files that can be used by the kubectl commandline to talk to the API server?