Home > Mobile >  Missing dir /etc/kubernetes
Missing dir /etc/kubernetes

Time:08-24

I am brand new to kubernetes. I am working on a Mac M1. Docker is already installed

I followed the aws instructions here

I got caught with this error:

The connection to the server localhost:8080 was refused - did you specify the right host or port?

This led me to instructions all over the internet that I need to copy /etc/kubernetes/admin.conf to ~/.kube/config

This is where it gets weird. I don't have a etc/kubernetes directory.

Question: Does anyone know why and how to fix?

In addition, it turnes out that kubectl was already installed with homebrew. I uninstalled and reinstalled following aws instructions (above). This still brought no success

Any help deeply appreciated

CodePudding user response:

/etc/kubernetes directory is present inside the master nodes of the cluster. In case of bare-metal kubernetes , you can SSH into one of the nodes & copy the admin.conf file.

For cloud based k8s cluster like AWS's EKS, download the admin.conf file from the dashboard and place it ~/.kube/ folder. This AWS EKS Kubeconfig access may help you

CodePudding user response:

With me, I was on a Mac. I had docker desktop installed. This seemed to include kubectl in homebrew

I traced it down to a link in usr/local/bin and renamed it to kubectl-old

Then I reinstalled kubectl, put it on my path and everything worked.

I know this is very specific to my case, but may help others.

  • Related