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,210 points

1 answer to this question.

0 votes


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,300 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,370 points
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
+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,628 views