2015-12-11 10:32:13 +00:00
|
|
|
apiVersion: v1
|
|
|
|
kind: Pod
|
|
|
|
metadata:
|
|
|
|
name: kube-proxy
|
2018-03-30 11:29:13 +00:00
|
|
|
namespace: kube-system
|
2016-11-09 13:15:27 +00:00
|
|
|
labels:
|
|
|
|
k8s-app: kube-proxy
|
2017-09-01 06:02:23 +00:00
|
|
|
annotations:
|
|
|
|
kubespray.kube-proxy-cert/serial: "{{ kube_proxy_cert_serial }}"
|
2015-12-11 10:32:13 +00:00
|
|
|
spec:
|
|
|
|
hostNetwork: true
|
2017-03-28 14:33:07 +00:00
|
|
|
{% if kube_version | version_compare('v1.6', '>=') %}
|
2017-04-20 09:07:34 +00:00
|
|
|
dnsPolicy: ClusterFirst
|
2017-03-28 14:33:07 +00:00
|
|
|
{% endif %}
|
2015-12-11 10:32:13 +00:00
|
|
|
containers:
|
|
|
|
- name: kube-proxy
|
2015-12-14 08:54:58 +00:00
|
|
|
image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}
|
2016-11-22 15:16:04 +00:00
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
2016-12-23 14:44:44 +00:00
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: {{ kube_proxy_cpu_limit }}
|
|
|
|
memory: {{ kube_proxy_memory_limit }}
|
|
|
|
requests:
|
|
|
|
cpu: {{ kube_proxy_cpu_requests }}
|
|
|
|
memory: {{ kube_proxy_memory_requests }}
|
2018-02-21 20:14:45 +00:00
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
host: 127.0.0.1
|
|
|
|
path: /healthz
|
|
|
|
port: 10256
|
|
|
|
failureThreshold: 8
|
|
|
|
initialDelaySeconds: 15
|
|
|
|
periodSeconds: 10
|
|
|
|
successThreshold: 1
|
|
|
|
timeoutSeconds: 15
|
2015-12-11 10:32:13 +00:00
|
|
|
command:
|
|
|
|
- /hyperkube
|
|
|
|
- proxy
|
2016-11-25 10:33:39 +00:00
|
|
|
- --v={{ kube_log_level }}
|
2017-06-27 04:27:25 +00:00
|
|
|
- --kubeconfig={{kube_config_dir}}/kube-proxy-kubeconfig.yaml
|
2016-02-08 21:48:57 +00:00
|
|
|
- --bind-address={{ ip | default(ansible_default_ipv4.address) }}
|
2016-10-12 16:12:02 +00:00
|
|
|
- --cluster-cidr={{ kube_pods_subnet }}
|
2016-02-29 10:41:08 +00:00
|
|
|
- --proxy-mode={{ kube_proxy_mode }}
|
2018-02-12 09:21:38 +00:00
|
|
|
- --oom-score-adj=-998
|
2018-07-13 14:15:28 +00:00
|
|
|
- --healthz-bind-address={{ kube_proxy_healthz_bind_address }}
|
2016-10-03 10:08:41 +00:00
|
|
|
{% if kube_proxy_masquerade_all and kube_proxy_mode == "iptables" %}
|
|
|
|
- --masquerade-all
|
2018-01-29 05:15:32 +00:00
|
|
|
{% elif kube_proxy_mode == 'ipvs' %}
|
|
|
|
- --masquerade-all
|
2018-05-15 13:00:29 +00:00
|
|
|
{% if kube_version | version_compare('v1.10', '<') %}
|
2018-01-29 05:15:32 +00:00
|
|
|
- --feature-gates=SupportIPVSProxyMode=true
|
2018-05-15 13:00:29 +00:00
|
|
|
{% endif %}
|
2018-01-29 05:15:32 +00:00
|
|
|
- --ipvs-min-sync-period=5s
|
|
|
|
- --ipvs-sync-period=5s
|
|
|
|
- --ipvs-scheduler=rr
|
2016-10-03 10:08:41 +00:00
|
|
|
{% endif %}
|
2015-12-11 10:32:13 +00:00
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
volumeMounts:
|
|
|
|
- mountPath: /etc/ssl/certs
|
|
|
|
name: ssl-certs-host
|
|
|
|
readOnly: true
|
2017-06-27 04:27:25 +00:00
|
|
|
- mountPath: "{{ kube_config_dir }}/ssl"
|
|
|
|
name: etc-kube-ssl
|
2015-12-11 10:32:13 +00:00
|
|
|
readOnly: true
|
2017-06-27 04:27:25 +00:00
|
|
|
- mountPath: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
|
|
|
|
name: kubeconfig
|
2015-12-11 10:32:13 +00:00
|
|
|
readOnly: true
|
2016-12-05 16:25:27 +00:00
|
|
|
- mountPath: /var/run/dbus
|
2017-06-27 04:27:25 +00:00
|
|
|
name: var-run-dbus
|
2016-12-05 16:25:27 +00:00
|
|
|
readOnly: false
|
2018-01-17 15:35:53 +00:00
|
|
|
- mountPath: /lib/modules
|
|
|
|
name: lib-modules
|
|
|
|
readOnly: true
|
2018-02-12 09:21:38 +00:00
|
|
|
- mountPath: /run/xtables.lock
|
|
|
|
name: xtables-lock
|
|
|
|
readOnly: false
|
2015-12-11 10:32:13 +00:00
|
|
|
volumes:
|
|
|
|
- name: ssl-certs-host
|
|
|
|
hostPath:
|
2017-02-24 21:41:27 +00:00
|
|
|
{% if ansible_os_family == 'RedHat' %}
|
|
|
|
path: /etc/pki/tls
|
|
|
|
{% else %}
|
2015-12-11 10:32:13 +00:00
|
|
|
path: /usr/share/ca-certificates
|
2017-02-24 21:41:27 +00:00
|
|
|
{% endif %}
|
2017-06-27 04:27:25 +00:00
|
|
|
- name: etc-kube-ssl
|
2015-12-11 10:32:13 +00:00
|
|
|
hostPath:
|
2017-06-27 04:27:25 +00:00
|
|
|
path: "{{ kube_config_dir }}/ssl"
|
|
|
|
- name: kubeconfig
|
2015-12-11 10:32:13 +00:00
|
|
|
hostPath:
|
2017-06-27 04:27:25 +00:00
|
|
|
path: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
|
|
|
|
- name: var-run-dbus
|
2016-12-05 16:25:27 +00:00
|
|
|
hostPath:
|
2017-06-27 04:27:25 +00:00
|
|
|
path: /var/run/dbus
|
2018-01-17 15:35:53 +00:00
|
|
|
- hostPath:
|
|
|
|
path: /lib/modules
|
|
|
|
name: lib-modules
|
2018-02-12 09:21:38 +00:00
|
|
|
- hostPath:
|
|
|
|
path: /run/xtables.lock
|
|
|
|
type: FileOrCreate
|
|
|
|
name: xtables-lock
|