error no configuration has been provided try setting KUBERNETES MASTER environment variable

+2 votes

Hi Guys,

I installed Kubectl program in my Linux system and also set path. But when I tried to run the below command it shows me the error.

[root@localhost ~]# kubectl get pods
error: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

How can I solve this error?

May 19, 2020 in Kubernetes by akhtar
• 38,230 points
16,128 views

1 answer to this question.

0 votes

Hi@akhtar,

When you try to connect your kubernetes cluster using kubectl, you have to provide client-key and certificate. You can use the below given command.

$ kubectl get pods --server https://minikube_IP:8443 --client-key /root/client.key --client-certificate /root/client.crt --cerfificate-authority /root/ca.crt

You can change path of your file accordingly.

For further details, refer to the Kubernetes Training.

answered May 19, 2020 by MD
• 95,440 points
I created a yml file called config in directory ~/.kube/. even though It is showing the same error
Can you share screenshot of your error?

Related Questions In Kubernetes

0 votes
1 answer

image can't be pulled error when I try to pull a docker image - kubernetes

I think the image is being pulled ...READ MORE

answered Sep 4, 2018 in Kubernetes by Kalgi
• 52,360 points
5,805 views
0 votes
3 answers

Error while setting up kubernetes

echo "1" > /proc/sys/net/bridge/bridge-nf-call-iptables READ MORE

answered May 16, 2019 in Kubernetes by sivashankar
16,212 views
+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
14,525 views
+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,360 points

reshown Apr 12, 2019 by Kalgi 5,978 views
+2 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP