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,260 points
16,796 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 Course.

answered May 19, 2020 by MD
• 95,460 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,350 points
6,253 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
17,003 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
15,576 views
0 votes
1 answer

permissions related to AWS ECR

if you add allowContainerRegistry: true, kops will add those permissions ...READ MORE

answered Oct 9, 2018 in Kubernetes by Kalgi
• 52,350 points
1,433 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