diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index c72ac806822..24025fed37d 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -483,6 +483,13 @@ ENABLE_PROMETHEUS_TO_SD="${ENABLE_PROMETHEUS_TO_SD:-false}" # Optional: [Experiment Only] Run kube-proxy as a DaemonSet if set to true, run as static pods otherwise. KUBE_PROXY_DAEMONSET="${KUBE_PROXY_DAEMONSET:-false}" # true, false +# Control whether the startup scripts manage the lifecycle of kube-proxy +# When true, the startup scripts do not enable kube-proxy either as a daemonset addon or as a static pod +# regardless of the value of KUBE_PROXY_DAEMONSET. +# When false, the value of KUBE_PROXY_DAEMONSET controls whether kube-proxy comes up as a static pod or +# as an addon daemonset. +KUBE_PROXY_DISABLE="${KUBE_PROXY_DISABLE:-false}" # true, false + # Optional: duration of cluster signed certificates. CLUSTER_SIGNING_DURATION="${CLUSTER_SIGNING_DURATION:-}" diff --git a/cluster/gce/config-test.sh b/cluster/gce/config-test.sh index 05eccfe1ecc..7abc6d2d89c 100755 --- a/cluster/gce/config-test.sh +++ b/cluster/gce/config-test.sh @@ -525,6 +525,13 @@ ENABLE_PROMETHEUS_TO_SD=${ENABLE_PROMETHEUS_TO_SD:-true} # Optional: [Experiment Only] Run kube-proxy as a DaemonSet if set to true, run as static pods otherwise. KUBE_PROXY_DAEMONSET=${KUBE_PROXY_DAEMONSET:-false} # true, false +# Control whether the startup scripts manage the lifecycle of kube-proxy +# When true, the startup scripts do not enable kube-proxy either as a daemonset addon or as a static pod +# regardless of the value of KUBE_PROXY_DAEMONSET. +# When false, the value of KUBE_PROXY_DAEMONSET controls whether kube-proxy comes up as a static pod or +# as an addon daemonset. +KUBE_PROXY_DISABLE="${KUBE_PROXY_DISABLE:-false}" # true, false + # Optional: Change the kube-proxy implementation. Choices are [iptables, ipvs]. KUBE_PROXY_MODE=${KUBE_PROXY_MODE:-iptables} diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 8e97035f184..f4b6490e9d8 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -2519,7 +2519,7 @@ function start-kube-addons { fi # Set up manifests of other addons. - if [[ "${KUBE_PROXY_DAEMONSET:-}" == "true" ]]; then + if [[ "${KUBE_PROXY_DAEMONSET:-}" == "true" ]] && [[ "${KUBE_PROXY_DISABLE:-}" != "true" ]]; then if [ -n "${CUSTOM_KUBE_PROXY_YAML:-}" ]; then # Replace with custom GKE kube proxy. cat > "$src_dir/kube-proxy/kube-proxy-ds.yaml" <