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