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.

100 lines
2.7 KiB

  1. apiVersion: v1
  2. kind: Pod
  3. metadata:
  4. name: kube-proxy
  5. namespace: {{system_namespace}}
  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. - --feature-gates=SupportIPVSProxyMode=true
  51. - --proxy-mode=ipvs
  52. - --ipvs-min-sync-period=5s
  53. - --ipvs-sync-period=5s
  54. - --ipvs-scheduler=rr
  55. {% endif %}
  56. securityContext:
  57. privileged: true
  58. volumeMounts:
  59. - mountPath: /etc/ssl/certs
  60. name: ssl-certs-host
  61. readOnly: true
  62. - mountPath: "{{ kube_config_dir }}/ssl"
  63. name: etc-kube-ssl
  64. readOnly: true
  65. - mountPath: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
  66. name: kubeconfig
  67. readOnly: true
  68. - mountPath: /var/run/dbus
  69. name: var-run-dbus
  70. readOnly: false
  71. - mountPath: /lib/modules
  72. name: lib-modules
  73. readOnly: true
  74. - mountPath: /run/xtables.lock
  75. name: xtables-lock
  76. readOnly: false
  77. volumes:
  78. - name: ssl-certs-host
  79. hostPath:
  80. {% if ansible_os_family == 'RedHat' %}
  81. path: /etc/pki/tls
  82. {% else %}
  83. path: /usr/share/ca-certificates
  84. {% endif %}
  85. - name: etc-kube-ssl
  86. hostPath:
  87. path: "{{ kube_config_dir }}/ssl"
  88. - name: kubeconfig
  89. hostPath:
  90. path: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
  91. - name: var-run-dbus
  92. hostPath:
  93. path: /var/run/dbus
  94. - hostPath:
  95. path: /lib/modules
  96. name: lib-modules
  97. - hostPath:
  98. path: /run/xtables.lock
  99. type: FileOrCreate
  100. name: xtables-lock