From 4d55dbe69fc7e1f134c4e7aa25d86e3118ff16e1 Mon Sep 17 00:00:00 2001 From: Mike Spreitzer Date: Fri, 12 Feb 2016 14:00:41 -0500 Subject: [PATCH] Introduced envar KUBE_PROXY_EXTRA_OPTS Resolves #21168 --- cluster/ubuntu/config-default.sh | 4 ++++ cluster/ubuntu/util.sh | 9 ++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/cluster/ubuntu/config-default.sh b/cluster/ubuntu/config-default.sh index ef3aaaf2131..53cdf76da3b 100755 --- a/cluster/ubuntu/config-default.sh +++ b/cluster/ubuntu/config-default.sh @@ -67,6 +67,10 @@ ENABLE_CLUSTER_MONITORING="${KUBE_ENABLE_CLUSTER_MONITORING:-true}" # --insecure-registry for local registries. DOCKER_OPTS=${DOCKER_OPTS:-""} +# Extra options to set on the kube-proxy command line. This is useful +# for selecting the iptables proxy-mode, for example. +KUBE_PROXY_EXTRA_OPTS=${KUBE_PROXY_EXTRA_OPTS:-""} + # Optional: Install cluster DNS. ENABLE_CLUSTER_DNS="${KUBE_ENABLE_CLUSTER_DNS:-true}" # DNS_SERVER_IP must be a IP in SERVICE_CLUSTER_IP_RANGE diff --git a/cluster/ubuntu/util.sh b/cluster/ubuntu/util.sh index 390c2eb70dd..6f9b080c698 100755 --- a/cluster/ubuntu/util.sh +++ b/cluster/ubuntu/util.sh @@ -248,7 +248,8 @@ function create-kube-proxy-opts() { KUBE_PROXY_OPTS="\ --hostname-override=${1} \ --master=http://${2}:8080 \ - --logtostderr=true" + --logtostderr=true \ + ${3}" EOF } @@ -450,7 +451,8 @@ function provision-node() { '${KUBELET_CONFIG}' create-kube-proxy-opts \ '${1#*@}' \ - '${MASTER_IP}' + '${MASTER_IP}' \ + '${KUBE_PROXY_EXTRA_OPTS}' create-flanneld-opts '${MASTER_IP}' '${1#*@}' sudo -E -p '[sudo] password to start node: ' -- /bin/bash -ce ' @@ -526,7 +528,8 @@ function provision-masterandnode() { '${KUBELET_CONFIG}' create-kube-proxy-opts \ '${MASTER_IP}' \ - '${MASTER_IP}' + '${MASTER_IP}' \ + '${KUBE_PROXY_EXTRA_OPTS}' create-flanneld-opts '127.0.0.1' '${MASTER_IP}' FLANNEL_OTHER_NET_CONFIG='${FLANNEL_OTHER_NET_CONFIG}' sudo -E -p '[sudo] password to start master: ' -- /bin/bash -ce '