How do I bind my kubernetes cluster master to an elastic ip with AWS?

3/6/2016

I ran the install script:

export KUBERNETES_PROVIDER=aws; curl -sS https://get.k8s.io | bash

And it set up my cluster just fine. The problem is that the master was not on an elastic ip. So I went to the VPC settings in the AWS management console and bound it to one. This obviously changed the ip of the master which I correspondingly changed in .kube/config.

Now whenever I try to do anything with kubectl (e.g. kubectl get pods) I get the error: error: couldn't read version from server: Get https://NEW_IP/api: x509: certificate is valid for OLD_IP, 10.0.0.1, not NEW_IP.

Is there a correct way to bind the master to an elastic IP? How do I fix this?

-- chacham15
amazon-ec2
amazon-web-services
kubernetes

1 Answer

3/6/2016

Solved by doing: kube-down then export MASTER_RESERVED_IP=[NEW_IP] and then kube-up

-- chacham15
Source: StackOverflow