From 12d4eac0383db9d952a4b96ebfc0e8bfa9fb1952 Mon Sep 17 00:00:00 2001 From: Rohit Ramkumar Date: Wed, 7 Feb 2018 13:58:26 -0800 Subject: [PATCH] Add a new environment variable to the startup scripts called KUBE_PROXY_MODE --- cluster/common.sh | 1 + cluster/gce/config-test.sh | 3 +++ cluster/gce/gci/configure-helper.sh | 3 +++ hack/local-up-cluster.sh | 2 +- 4 files changed, 8 insertions(+), 1 deletion(-) diff --git a/cluster/common.sh b/cluster/common.sh index 99cd1b1c470..1ff5ccd2aba 100755 --- a/cluster/common.sh +++ b/cluster/common.sh @@ -523,6 +523,7 @@ DNS_DOMAIN: $(yaml-quote ${DNS_DOMAIN:-}) ENABLE_DNS_HORIZONTAL_AUTOSCALER: $(yaml-quote ${ENABLE_DNS_HORIZONTAL_AUTOSCALER:-false}) 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}) 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:-}) diff --git a/cluster/gce/config-test.sh b/cluster/gce/config-test.sh index b3490014eca..b9ab61937cc 100755 --- a/cluster/gce/config-test.sh +++ b/cluster/gce/config-test.sh @@ -410,6 +410,9 @@ 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 +# Optional: Change the kube-proxy implementation. Choices are [iptables, ipvs]. +KUBE_PROXY_MODE="${KUBE_PROXY_MODE:-iptables}" + # 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 fed87cfba33..78085e86237 100644 --- a/cluster/gce/gci/configure-helper.sh +++ b/cluster/gce/gci/configure-helper.sh @@ -1298,6 +1298,9 @@ function prepare-kube-proxy-manifest-variables { if [[ -n "${FEATURE_GATES:-}" ]]; then params+=" --feature-gates=${FEATURE_GATES}" fi + if [[ "${KUBE_PROXY_MODE:-}" == "ipvs" ]];then + params+=" --proxy-mode=ipvs --feature-gates=SupportIPVSProxyMode=true" + fi params+=" --iptables-sync-period=1m --iptables-min-sync-period=10s --ipvs-sync-period=1m --ipvs-min-sync-period=10s" if [[ -n "${KUBEPROXY_TEST_ARGS:-}" ]]; then params+=" ${KUBEPROXY_TEST_ARGS}" diff --git a/hack/local-up-cluster.sh b/hack/local-up-cluster.sh index 22fb06e4736..00b26be55f9 100755 --- a/hack/local-up-cluster.sh +++ b/hack/local-up-cluster.sh @@ -57,7 +57,7 @@ EVICTION_PRESSURE_TRANSITION_PERIOD=${EVICTION_PRESSURE_TRANSITION_PERIOD:-"1m"} # and we don't know the IP of the DNS pod to pass in as --cluster-dns. # To set this up by hand, set this flag and change DNS_SERVER_IP. # Note also that you need API_HOST (defined above) for correct DNS. -KUBEPROXY_MODE=${KUBEPROXY_MODE:-""} +KUBE_PROXY_MODE=${KUBE_PROXY_MODE:-""} ENABLE_CLUSTER_DNS=${KUBE_ENABLE_CLUSTER_DNS:-true} DNS_SERVER_IP=${KUBE_DNS_SERVER_IP:-10.0.0.10} DNS_DOMAIN=${KUBE_DNS_NAME:-"cluster.local"}