mirror of https://github.com/k3s-io/k3s
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
commit
1014bc411a
|
@ -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
|
||||
|
|
|
@ -783,6 +783,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=""
|
||||
|
|
|
@ -607,6 +607,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)
|
||||
|
||||
|
|
|
@ -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}"
|
||||
|
||||
|
|
Loading…
Reference in New Issue