Hey everyone! I'm trying to connect to my Kubernetes cluster from my computer running Ubuntu. I've installed `kubectl`, downloaded the configuration file from the master node, and saved it at `/home/user/.kube/config`. However, whenever I attempt to connect with the command `kubectl get nodes -o wide`, I get an error that says I need to specify either client-key-data or client-key for clientCert authentication. I'm pretty new to DevOps and would love any help you can provide!
1 Answer
First off, it seems like you didn't actually place the config file correctly. You can create a kubeconfig file with a name like 'name.kubeconfig' instead and then set the environment variable by running `export KUBECONFIG=/path/to/name.kubeconfig`.
Also, make sure your personal desktop can reach the kube-apiserver. For example, if your kube-apiserver's IP is 10.0.0.1, your desktop needs to be able to connect to that IP.
Can I ask another question? I installed K9s and followed the official instructions. I can see the cluster using `kubectl` from my local desktop, but it doesn't show up in K9s. Do I need to set environment variables for K9s, too?
Awesome! Thank you so much for the tips! I set the environment variable and added the IP and DNS to /etc/hosts.