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
Jerzy Szczepkowski 2016-11-07 10:21:07 +01:00
parent cc7070d5d8
commit 633c237913
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})
STORAGE_BACKEND: $(yaml-quote ${STORAGE_BACKEND:-etcd2})
ENABLE_GARBAGE_COLLECTOR: $(yaml-quote ${ENABLE_GARBAGE_COLLECTOR:-})
MASTER_ADVERTISE_ADDRESS: $(yaml-quote ${MASTER_ADVERTISE_ADDRESS:-})
EOF
# ETCD_IMAGE (if set) allows to use a custom etcd image.
if [ -n "${ETCD_IMAGE:-}" ]; then

View File

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

View File

@ -603,6 +603,8 @@ start_kube_apiserver() {
params="${params} --advertise-address=${vm_external_ip}"
params="${params} --ssh-user=${PROXY_SSH_USER}"
params="${params} --ssh-keyfile=/etc/srv/sshproxy/.sshkeyfile"
else [ -n "${MASTER_ADVERTISE_ADDRESS:-}" ]
params="${params} --advertise-address=${MASTER_ADVERTISE_ADDRESS}"
fi
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
KUBERNETES_MASTER_NAME="${MASTER_RESERVED_IP}"
MASTER_ADVERTISE_ADDRESS="${MASTER_RESERVED_IP}"
create-certs "${MASTER_RESERVED_IP}"