diff --git a/cluster/gce/config-default.sh b/cluster/gce/config-default.sh index 8b8016a97dd..444b34a8aa7 100755 --- a/cluster/gce/config-default.sh +++ b/cluster/gce/config-default.sh @@ -490,6 +490,9 @@ KUBE_PROXY_DAEMONSET="${KUBE_PROXY_DAEMONSET:-false}" # true, false # as an addon daemonset. KUBE_PROXY_DISABLE="${KUBE_PROXY_DISABLE:-false}" # true, false +# Will be passed into the kube-proxy via `--detect-local-mode` +DETECT_LOCAL_MODE="${DETECT_LOCAL_MODE:-}" + # 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 f2566269b1c..37a97148ac3 100755 --- a/cluster/gce/config-test.sh +++ b/cluster/gce/config-test.sh @@ -535,6 +535,9 @@ 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} +# Will be passed into the kube-proxy via `--detect-local-mode` +DETECT_LOCAL_MODE="${DETECT_LOCAL_MODE:-NodeCIDR}" + # Optional: duration of cluster signed certificates. CLUSTER_SIGNING_DURATION=${CLUSTER_SIGNING_DURATION:-} diff --git a/cluster/gce/gci/configure-helper.sh b/cluster/gce/gci/configure-helper.sh index 1a64c81ab06..b829d65db5f 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -1657,6 +1657,9 @@ function prepare-kube-proxy-manifest-variables { if [[ -n "${KUBEPROXY_TEST_ARGS:-}" ]]; then params+=" ${KUBEPROXY_TEST_ARGS}" fi + if [[ -n "${DETECT_LOCAL_MODE:-}" ]]; then + params+=" --detect-local-mode=${DETECT_LOCAL_MODE}" + fi local container_env="" local kube_cache_mutation_detector_env_name="" local kube_cache_mutation_detector_env_value="" diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index f9ec0b40f2f..5e0bfa4ff58 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -1159,6 +1159,7 @@ ENABLE_DNS_HORIZONTAL_AUTOSCALER: $(yaml-quote "${ENABLE_DNS_HORIZONTAL_AUTOSCAL KUBE_PROXY_DAEMONSET: $(yaml-quote "${KUBE_PROXY_DAEMONSET:-false}") KUBE_PROXY_TOKEN: $(yaml-quote "${KUBE_PROXY_TOKEN:-}") KUBE_PROXY_MODE: $(yaml-quote "${KUBE_PROXY_MODE:-iptables}") +DETECT_LOCAL_MODE: $(yaml-quote "${DETECT_LOCAL_MODE:-}") NODE_PROBLEM_DETECTOR_TOKEN: $(yaml-quote "${NODE_PROBLEM_DETECTOR_TOKEN:-}") ADMISSION_CONTROL: $(yaml-quote "${ADMISSION_CONTROL:-}") ENABLE_POD_SECURITY_POLICY: $(yaml-quote "${ENABLE_POD_SECURITY_POLICY:-}")