You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

101 lines
2.7 KiB

  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: kube-proxy
  5. namespace: kube-system
  6. labels:
  7. k8s-app: kube-proxy
  8. annotations:
  9. kubespray.kube-proxy-cert/serial: "{{ kube_proxy_cert_serial }}"
  10. spec:
  11. hostNetwork: true
  12. {% if kube_version | version_compare('v1.6', '>=') %}
  13. dnsPolicy: ClusterFirst
  14. {% endif %}
  15. containers:
  16. - name: kube-proxy
  17. image: {{ hyperkube_image_repo }}:{{ hyperkube_image_tag }}
  18. imagePullPolicy: {{ k8s_image_pull_policy }}
  19. resources:
  20. limits:
  21. cpu: {{ kube_proxy_cpu_limit }}
  22. memory: {{ kube_proxy_memory_limit }}
  23. requests:
  24. cpu: {{ kube_proxy_cpu_requests }}
  25. memory: {{ kube_proxy_memory_requests }}
  26. livenessProbe:
  27. httpGet:
  28. host: 127.0.0.1
  29. path: /healthz
  30. port: 10256
  31. failureThreshold: 8
  32. initialDelaySeconds: 15
  33. periodSeconds: 10
  34. successThreshold: 1
  35. timeoutSeconds: 15
  36. command:
  37. - /hyperkube
  38. - proxy
  39. - --v={{ kube_log_level }}
  40. - --kubeconfig={{kube_config_dir}}/kube-proxy-kubeconfig.yaml
  41. - --bind-address={{ ip | default(ansible_default_ipv4.address) }}
  42. - --cluster-cidr={{ kube_pods_subnet }}
  43. - --proxy-mode={{ kube_proxy_mode }}
  44. - --oom-score-adj=-998
  45. - --healthz-bind-address=127.0.0.1
  46. {% if kube_proxy_masquerade_all and kube_proxy_mode == "iptables" %}
  47. - --masquerade-all
  48. {% elif kube_proxy_mode == 'ipvs' %}
  49. - --masquerade-all
  50. {% if kube_version | version_compare('v1.10', '<') %}
  51. - --feature-gates=SupportIPVSProxyMode=true
  52. {% endif %}
  53. - --ipvs-min-sync-period=5s
  54. - --ipvs-sync-period=5s
  55. - --ipvs-scheduler=rr
  56. {% endif %}
  57. securityContext:
  58. privileged: true
  59. volumeMounts:
  60. - mountPath: /etc/ssl/certs
  61. name: ssl-certs-host
  62. readOnly: true
  63. - mountPath: "{{ kube_config_dir }}/ssl"
  64. name: etc-kube-ssl
  65. readOnly: true
  66. - mountPath: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
  67. name: kubeconfig
  68. readOnly: true
  69. - mountPath: /var/run/dbus
  70. name: var-run-dbus
  71. readOnly: false
  72. - mountPath: /lib/modules
  73. name: lib-modules
  74. readOnly: true
  75. - mountPath: /run/xtables.lock
  76. name: xtables-lock
  77. readOnly: false
  78. volumes:
  79. - name: ssl-certs-host
  80. hostPath:
  81. {% if ansible_os_family == 'RedHat' %}
  82. path: /etc/pki/tls
  83. {% else %}
  84. path: /usr/share/ca-certificates
  85. {% endif %}
  86. - name: etc-kube-ssl
  87. hostPath:
  88. path: "{{ kube_config_dir }}/ssl"
  89. - name: kubeconfig
  90. hostPath:
  91. path: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
  92. - name: var-run-dbus
  93. hostPath:
  94. path: /var/run/dbus
  95. - hostPath:
  96. path: /lib/modules
  97. name: lib-modules
  98. - hostPath:
  99. path: /run/xtables.lock
  100. type: FileOrCreate
  101. name: xtables-lock