File tree Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Expand file tree Collapse file tree 4 files changed +18
-4
lines changed Original file line number Diff line number Diff line change @@ -539,7 +539,11 @@ export KONNECTIVITY_SERVICE_PROXY_PROTOCOL_MODE="${KUBE_KONNECTIVITY_SERVICE_PRO
539
539
# Optional: Enable Windows CSI-Proxy
540
540
export ENABLE_CSI_PROXY=" ${ENABLE_CSI_PROXY:- true} "
541
541
542
- # ETCD_LISTEN_ON_HOST_IP decides whether etcd servers should also listen on host IP,
542
+ # KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP decides whether
543
+ # kube-apiserver is healthchecked on host IP instead of 127.0.0.1.
544
+ export KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP=" ${KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP:- false} "
545
+
546
+ # ETCD_LISTEN_ON_HOST_IP decides whether etcd servers should also listen on host IP,
543
547
# in addition to listening to 127.0.0.1, and whether kube-apiserver should connect to etcd servers
544
548
# through host IP.
545
549
export ETCD_LISTEN_ON_HOST_IP=" ${ETCD_LISTEN_ON_HOST_IP:- false} "
Original file line number Diff line number Diff line change @@ -575,7 +575,11 @@ export GCE_UPLOAD_KUBCONFIG_TO_MASTER_METADATA=true
575
575
# Optoinal: Enable Windows CSI-Proxy
576
576
export ENABLE_CSI_PROXY=" ${ENABLE_CSI_PROXY:- true} "
577
577
578
- # ETCD_LISTEN_ON_HOST_IP decides whether etcd servers should also listen on host IP,
578
+ # KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP decides whether
579
+ # kube-apiserver is healthchecked on host IP instead of 127.0.0.1.
580
+ export KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP=" ${KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP:- false} "
581
+
582
+ # ETCD_LISTEN_ON_HOST_IP decides whether etcd servers should also listen on host IP,
579
583
# in addition to listening to 127.0.0.1, and whether kube-apiserver should connect to etcd servers
580
584
# through host IP.
581
585
export ETCD_LISTEN_ON_HOST_IP=" ${ETCD_LISTEN_ON_HOST_IP:- false} "
Original file line number Diff line number Diff line change @@ -374,6 +374,11 @@ function start-kube-apiserver {
374
374
# params is passed by reference, so no "$"
375
375
setup-etcd-encryption " ${src_file} " params
376
376
377
+ local healthcheck_ip=" 127.0.0.1"
378
+ if [[ ${KUBE_APISERVER_HEALTHCHECK_ON_HOST_IP:- } == " true" ]]; then
379
+ healthcheck_ip=$( hostname -i)
380
+ fi
381
+
377
382
params=" $( convert-manifest-params " ${params} " ) "
378
383
# Evaluate variables.
379
384
local -r kube_apiserver_docker_tag=" ${KUBE_API_SERVER_DOCKER_TAG:- $(cat / home/ kubernetes/ kube-docker-files/ kube-apiserver.docker_tag)} "
@@ -404,6 +409,7 @@ function start-kube-apiserver {
404
409
sed -i -e " s@{{webhook_exec_auth_plugin_volume}}@${webhook_exec_auth_plugin_volume} @g" " ${src_file} "
405
410
sed -i -e " s@{{konnectivity_socket_mount}}@${default_konnectivity_socket_mnt} @g" " ${src_file} "
406
411
sed -i -e " s@{{konnectivity_socket_volume}}@${default_konnectivity_socket_vol} @g" " ${src_file} "
412
+ sed -i -e " s@{{healthcheck_ip}}@${healthcheck_ip} @g" " ${src_file} "
407
413
408
414
cp " ${src_file} " " ${ETC_MANIFESTS:-/ etc/ kubernetes/ manifests} "
409
415
}
Original file line number Diff line number Diff line change 37
37
"livenessProbe": {
38
38
"httpGet": {
39
39
"scheme": "HTTPS",
40
- "host": "127.0.0.1 ",
40
+ "host": "{{healthcheck_ip}} ",
41
41
"port": {{secure_port}},
42
42
"path": "/livez?exclude=etcd&exclude=kms-provider-0&exclude=kms-provider-1"
43
43
},
47
47
"readinessProbe": {
48
48
"httpGet": {
49
49
"scheme": "HTTPS",
50
- "host": "127.0.0.1 ",
50
+ "host": "{{healthcheck_ip}} ",
51
51
"port": {{secure_port}},
52
52
"path": "/readyz"
53
53
},
You can’t perform that action at this time.
0 commit comments