error: no configuration has been provided, try setting KUBERNETES_MASTER environment variable

+1 vote

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 in Kubernetes by akhtar
• 15,260 points
2,832 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.

answered May 19 by MD
• 34,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
• 51,890 points
1,624 views
0 votes
3 answers

Error while setting up kubernetes

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

answered May 15, 2019 in Kubernetes by sivashankar
5,756 views
0 votes
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
7,197 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 11, 2019 in Kubernetes by Kalgi
• 51,890 points

reshown Apr 12, 2019 by Kalgi 2,123 views
0 votes
1 answer