kops validate cluster: returns "cluster not found" even though cluster is healthy and kubectl works fine

2/7/2018

I created a cluster using kops. It worked fine and the cluster is healthy. I can see my nodes using kubectl and have created some deployments and services. I tried adding a node using "kops edit ig nodes" and got an error "cluster not found". Now I get that error for all kops commands:

kops validate cluster
Using cluster from kubectl context: <clustername>

cluster "<clustername>" not found

So my question is: where does kops look for clusters and how do I configure it to see my cluster.

-- frankd
kops
kubernetes

2 Answers

2/7/2018

Kubectl and Kops access the configuration file from the following the location.

When the cluster is created.The configuration will be saved into a users

$HOME/.kube/config 

I have attached the link for further insight for instance, If you have another config file you can EXPORT it. kube-config

-- Suresh Vishnoi
Source: StackOverflow

2/7/2018

My KOPS_STATE_STORE environment variable got messed up. I corrected it to be the correct s3 bucket and everything is fine.

export KOPS_STATE_STORE=s3://correctbucketname
-- frankd
Source: StackOverflow