Updating kubectl with new configurations

10/27/2016

As I need to change Kubernetes cluster details I picked up ca.pem of master and ran following command in my local machine with correct path to my new ca.pem

$ kubectl config set-cluster default-cluster --  server=https://${MASTER_HOST} --certificate-authority=${CA_CERT}
$ kubectl config set-credentials default-admin --certificate-authority=${CA_CERT} --client-key=${ADMIN_KEY} --client-certificate=${ADMIN_CERT}
$ kubectl config set-context default-system --cluster=default-cluster --user=default-admin
$ kubectl config use-context default-system

When I try to get nodes:

kubectl get nodes

It gives an error as follows:

Unable to connect to the server: x509: certificate is valid for xxx.xx.xx.209, xxx.xx.xx.209, not xxx.xx.xx.216

xxx.xx.xx.209 means my old master and it still not changed to new master. What should I do to change the master and update kubectl accordingly.

-- Dilshani Subasinghe
docker
kubectl
kubernetes

0 Answers