Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (108k points)

I'm trying to create a simple service on kubernetes

kubectl create serviceaccount dashboard -n default

but it throws the following error:

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

1 Answer

0 votes
by (50.2k points)

Execute the following command as a normal user:

mkdir -p $HOME/.kube

$ sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config

$ sudo chown $(id -u):$(id -g) $HOME/.kube/config

You should read Kubernetes to learn more about the concept. You can also enroll in Kubernetes Training in order to get a deeper understanding of Kubernetes.

Browse Categories