Skip to content

Commit 734cdb6

Browse files
authored
Merge pull request kubernetes#91977 from varunmar/kube-proxy-disable
Allow the lifecycle of kube-proxy to be managed independently of the …
2 parents aad834b + 04a51ca commit 734cdb6

File tree

3 files changed

+17
-3
lines changed

3 files changed

+17
-3
lines changed

cluster/gce/config-default.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,13 @@ ENABLE_PROMETHEUS_TO_SD="${ENABLE_PROMETHEUS_TO_SD:-false}"
483483
# Optional: [Experiment Only] Run kube-proxy as a DaemonSet if set to true, run as static pods otherwise.
484484
KUBE_PROXY_DAEMONSET="${KUBE_PROXY_DAEMONSET:-false}" # true, false
485485

486+
# Control whether the startup scripts manage the lifecycle of kube-proxy
487+
# When true, the startup scripts do not enable kube-proxy either as a daemonset addon or as a static pod
488+
# regardless of the value of KUBE_PROXY_DAEMONSET.
489+
# When false, the value of KUBE_PROXY_DAEMONSET controls whether kube-proxy comes up as a static pod or
490+
# as an addon daemonset.
491+
KUBE_PROXY_DISABLE="${KUBE_PROXY_DISABLE:-false}" # true, false
492+
486493
# Optional: duration of cluster signed certificates.
487494
CLUSTER_SIGNING_DURATION="${CLUSTER_SIGNING_DURATION:-}"
488495

cluster/gce/config-test.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -525,6 +525,13 @@ ENABLE_PROMETHEUS_TO_SD=${ENABLE_PROMETHEUS_TO_SD:-true}
525525
# Optional: [Experiment Only] Run kube-proxy as a DaemonSet if set to true, run as static pods otherwise.
526526
KUBE_PROXY_DAEMONSET=${KUBE_PROXY_DAEMONSET:-false} # true, false
527527

528+
# Control whether the startup scripts manage the lifecycle of kube-proxy
529+
# When true, the startup scripts do not enable kube-proxy either as a daemonset addon or as a static pod
530+
# regardless of the value of KUBE_PROXY_DAEMONSET.
531+
# When false, the value of KUBE_PROXY_DAEMONSET controls whether kube-proxy comes up as a static pod or
532+
# as an addon daemonset.
533+
KUBE_PROXY_DISABLE="${KUBE_PROXY_DISABLE:-false}" # true, false
534+
528535
# Optional: Change the kube-proxy implementation. Choices are [iptables, ipvs].
529536
KUBE_PROXY_MODE=${KUBE_PROXY_MODE:-iptables}
530537

cluster/gce/gci/configure-helper.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2519,7 +2519,7 @@ function start-kube-addons {
25192519
fi
25202520

25212521
# Set up manifests of other addons.
2522-
if [[ "${KUBE_PROXY_DAEMONSET:-}" == "true" ]]; then
2522+
if [[ "${KUBE_PROXY_DAEMONSET:-}" == "true" ]] && [[ "${KUBE_PROXY_DISABLE:-}" != "true" ]]; then
25232523
if [ -n "${CUSTOM_KUBE_PROXY_YAML:-}" ]; then
25242524
# Replace with custom GKE kube proxy.
25252525
cat > "$src_dir/kube-proxy/kube-proxy-ds.yaml" <<EOF
@@ -3027,7 +3027,7 @@ function main() {
30273027
else
30283028
create-node-pki
30293029
create-kubelet-kubeconfig "${KUBERNETES_MASTER_NAME}"
3030-
if [[ "${KUBE_PROXY_DAEMONSET:-}" != "true" ]]; then
3030+
if [[ "${KUBE_PROXY_DAEMONSET:-}" != "true" ]] && [[ "${KUBE_PROXY_DISABLE:-}" != "true" ]]; then
30313031
create-kubeproxy-user-kubeconfig
30323032
fi
30333033
if [[ "${ENABLE_NODE_PROBLEM_DETECTOR:-}" == "standalone" ]]; then
@@ -3072,7 +3072,7 @@ function main() {
30723072
start-lb-controller
30733073
update-legacy-addon-node-labels &
30743074
else
3075-
if [[ "${KUBE_PROXY_DAEMONSET:-}" != "true" ]]; then
3075+
if [[ "${KUBE_PROXY_DAEMONSET:-}" != "true" ]] && [[ "${KUBE_PROXY_DISABLE:-}" != "true" ]]; then
30763076
start-kube-proxy
30773077
fi
30783078
if [[ "${ENABLE_NODE_PROBLEM_DETECTOR:-}" == "standalone" ]]; then

0 commit comments

Comments
 (0)