mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-27 03:44:04 +00:00
Merge pull request #50705 from MrHohn/kube-proxy-ds
Automatic merge from submit-queue (batch tested with PRs 50932, 49610, 51312, 51415, 50705) Allow running kube-proxy as a DaemonSet when using kube-up.sh on GCE **What this PR does / why we need it**: From #23225, this PR adds an option for user to run kube-proxy as a DaemonSet instead of static pods using GCE startup scripts. By default, kube-proxy will run as static pods. This is the first step for moving kube-proxy into a DaemonSet in GCE, remaining tasks will be tracked on #23225. **Special notes for your reviewer**: The last commit are purely for testing out kube-proxy as daemonset via CIs. cc @kubernetes/sig-network-misc @kubernetes/sig-cluster-lifecycle-misc **Release note**: ```release-note When using kube-up.sh on GCE, user could set env `KUBE_PROXY_DAEMONSET=true` to run kube-proxy as a DaemonSet. kube-proxy is run as static pods by default. ```
This commit is contained in:
@@ -7,6 +7,7 @@
|
||||
- makedirs: true
|
||||
|
||||
# kube-proxy in a static pod
|
||||
{% if pillar.get('kube_proxy_daemonset', '').lower() != 'true' %}
|
||||
/etc/kubernetes/manifests/kube-proxy.manifest:
|
||||
file.managed:
|
||||
- source: salt://kube-proxy/kube-proxy.manifest
|
||||
@@ -24,6 +25,7 @@
|
||||
- require:
|
||||
- service: docker
|
||||
- service: kubelet
|
||||
{% endif %}
|
||||
|
||||
/var/log/kube-proxy.log:
|
||||
file.managed:
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
# Please keep kube-proxy configuration in-sync with:
|
||||
# cluster/addons/kube-proxy/kube-proxy-ds.yaml
|
||||
|
||||
{% set kubeconfig = "--kubeconfig=/var/lib/kube-proxy/kubeconfig" -%}
|
||||
{% if grains.api_servers is defined -%}
|
||||
{% set api_servers = "--master=https://" + grains.api_servers -%}
|
||||
@@ -35,6 +38,8 @@
|
||||
{% set params = log_level + " " + throttles + " " + feature_gates + " " + test_args -%}
|
||||
|
||||
{% set container_env = "" -%}
|
||||
{% set kube_cache_mutation_detector_env_name = "" -%}
|
||||
{% set kube_cache_mutation_detector_env_value = "" -%}
|
||||
|
||||
# kube-proxy podspec
|
||||
apiVersion: v1
|
||||
@@ -75,6 +80,8 @@ spec:
|
||||
- -c
|
||||
- echo -998 > /proc/$$$/oom_score_adj && kube-proxy {{api_servers_with_port}} {{kubeconfig}} {{cluster_cidr}} --resource-container="" {{params}} 1>>/var/log/kube-proxy.log 2>&1
|
||||
{{container_env}}
|
||||
{{kube_cache_mutation_detector_env_name}}
|
||||
{{kube_cache_mutation_detector_env_value}}
|
||||
securityContext:
|
||||
privileged: true
|
||||
volumeMounts:
|
||||
|
||||
Reference in New Issue
Block a user