I am running kube on a cluster of nodes. When i set the context on the cluster I get an error that says "error: You must be logged in to the server (Unauthorized)" when i try to run kubectl get pods
If I unset the current-context the error goes away and i can view my pods and nodes. So my guess is it has something to do with my kubeconfig but I'm not sure where i got it wrong.
apiVersion: v1
clusters:
- cluster:
certificate-authority: /home/user/ssl/ca.pem
server: https://<ip for my master node>
name: default-cluster
contexts:
- context:
cluster: default-cluster
user: user
name: kubeflow
current-context: kubeflow
kind: Config
preferences: {}
users:
- name: user
user:
client-certificate: /home/user/ssl/client-ca.pem
client-key: /home/user/ssl/client-ca-key.pem
EDIT:
Kube version 1.14
user@kube01:~$ kubectl version
Client Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:11:31Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"14", GitVersion:"v1.14.1", GitCommit:"b7394102d6ef778017f2ca4046abbaa23b88c290", GitTreeState:"clean", BuildDate:"2019-04-08T17:02:58Z", GoVersion:"go1.12.1", Compiler:"gc", Platform:"linux/amd64"}
- Running on a cluster with 3 master nodes and 4 workers. Not on GCP or any cloud platform