mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-31 15:25:57 +00:00
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.
This commit is contained in:
parent
cc7070d5d8
commit
633c237913
@ -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
|
||||||
|
@ -777,6 +777,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=""
|
||||||
|
@ -603,6 +603,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)
|
||||||
|
|
||||||
|
@ -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}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user