Merge pull request #36346 from jszczepkowski/ha-masterip

Automatic merge from submit-queue

Change master to advertise external IP in kubernetes service.

Change master to advertise external IP in kubernetes service.
In effect, in HA mode in case of multiple masters, IP of external load
balancer will be advertise in kubernetes service.
pull/6/head
Kubernetes Submit Queue 2016-11-10 05:00:48 -08:00 committed by GitHub
commit 1014bc411a
4 changed files with 6 additions and 0 deletions

View File

@ -701,6 +701,7 @@ MANIFEST_URL_HEADER: $(yaml-quote ${MANIFEST_URL_HEADER:-})
NUM_NODES: $(yaml-quote ${NUM_NODES}) NUM_NODES: $(yaml-quote ${NUM_NODES})
STORAGE_BACKEND: $(yaml-quote ${STORAGE_BACKEND:-etcd2}) STORAGE_BACKEND: $(yaml-quote ${STORAGE_BACKEND:-etcd2})
ENABLE_GARBAGE_COLLECTOR: $(yaml-quote ${ENABLE_GARBAGE_COLLECTOR:-}) ENABLE_GARBAGE_COLLECTOR: $(yaml-quote ${ENABLE_GARBAGE_COLLECTOR:-})
MASTER_ADVERTISE_ADDRESS: $(yaml-quote ${MASTER_ADVERTISE_ADDRESS:-})
EOF EOF
# ETCD_IMAGE (if set) allows to use a custom etcd image. # ETCD_IMAGE (if set) allows to use a custom etcd image.
if [ -n "${ETCD_IMAGE:-}" ]; then if [ -n "${ETCD_IMAGE:-}" ]; then

View File

@ -783,6 +783,8 @@ function start-kube-apiserver {
params+=" --advertise-address=${vm_external_ip}" params+=" --advertise-address=${vm_external_ip}"
params+=" --ssh-user=${PROXY_SSH_USER}" params+=" --ssh-user=${PROXY_SSH_USER}"
params+=" --ssh-keyfile=/etc/srv/sshproxy/.sshkeyfile" params+=" --ssh-keyfile=/etc/srv/sshproxy/.sshkeyfile"
else [ -n "${MASTER_ADVERTISE_ADDRESS:-}" ]
params="${params} --advertise-address=${MASTER_ADVERTISE_ADDRESS}"
fi fi
local webhook_authn_config_mount="" local webhook_authn_config_mount=""

View File

@ -607,6 +607,8 @@ start_kube_apiserver() {
params="${params} --advertise-address=${vm_external_ip}" params="${params} --advertise-address=${vm_external_ip}"
params="${params} --ssh-user=${PROXY_SSH_USER}" params="${params} --ssh-user=${PROXY_SSH_USER}"
params="${params} --ssh-keyfile=/etc/srv/sshproxy/.sshkeyfile" params="${params} --ssh-keyfile=/etc/srv/sshproxy/.sshkeyfile"
else [ -n "${MASTER_ADVERTISE_ADDRESS:-}" ]
params="${params} --advertise-address=${MASTER_ADVERTISE_ADDRESS}"
fi fi
readonly kube_apiserver_docker_tag=$(cat /home/kubernetes/kube-docker-files/kube-apiserver.docker_tag) readonly kube_apiserver_docker_tag=$(cat /home/kubernetes/kube-docker-files/kube-apiserver.docker_tag)

View File

@ -782,6 +782,7 @@ function create-master() {
fi fi
KUBERNETES_MASTER_NAME="${MASTER_RESERVED_IP}" KUBERNETES_MASTER_NAME="${MASTER_RESERVED_IP}"
MASTER_ADVERTISE_ADDRESS="${MASTER_RESERVED_IP}"
create-certs "${MASTER_RESERVED_IP}" create-certs "${MASTER_RESERVED_IP}"