I m trying to create a simple service on kubernetes

0 votes

but it throws the following error

root@ip-172-31-24-50:/home/ubuntu# kubectl get pods

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

Dec 20, 2020 in DevOps & Agile by Edureka
• 130 points

1 answer to this question.

0 votes


After you run the kubeadm init command in your master node, it will show you that you need to run the below-given command to your master node.

mkdir -p $HOME/.kube
sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

If you get the same error again, then check the context in your cluster using the below command.

$ kubectl config view

If the context is not set, then you need to set that.

answered Dec 21, 2020 by MD
• 95,300 points

Related Questions In DevOps & Agile

0 votes
1 answer
0 votes
1 answer

Upgrading a service leads to Rancher losing persistence of environment variables

when you upgrade, what it will do ...READ MORE

answered Apr 27, 2018 in DevOps & Agile by shubham
• 7,320 points
0 votes
1 answer
+1 vote
1 answer
0 votes
3 answers

Error while joining cluster with node

Hi Kalgi after following above steps it ...READ MORE

answered Jan 17, 2019 in Others by anonymous
+4 votes
1 answer

Installing Web UI (Dashboard):kubernetes-dashboard on main Ubuntu 16.04.6 LTS (Xenial Xerus) server

Follow these steps: $ kubeadm reset $ kubeadm init ...READ MORE

answered Apr 12, 2019 in Kubernetes by Kalgi
• 52,370 points

reshown Apr 12, 2019 by Kalgi 3,547 views
+1 vote
1 answer

What are some best sites available to learn Kubernetes?

Hi@akhtar There are a number of websites which offers ...READ MORE

answered May 23, 2020 in DevOps & Agile by MD
• 95,300 points
0 votes
2 answers

What are the prerequisites required to learn Kubernetes?

Pre-requistic knowledge you requires before get started ...READ MORE

answered Oct 13, 2020 in DevOps & Agile by vivek kumar sahu