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.

81 lines
2.2 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. command:
  27. - /hyperkube
  28. - proxy
  29. - --v={{ kube_log_level }}
  30. - --kubeconfig={{kube_config_dir}}/kube-proxy-kubeconfig.yaml
  31. - --bind-address={{ ip | default(ansible_default_ipv4.address) }}
  32. - --cluster-cidr={{ kube_pods_subnet }}
  33. - --proxy-mode={{ kube_proxy_mode }}
  34. {% if kube_proxy_masquerade_all and kube_proxy_mode == "iptables" %}
  35. - --masquerade-all
  36. {% elif kube_proxy_mode == 'ipvs' %}
  37. - --masquerade-all
  38. - --feature-gates=SupportIPVSProxyMode=true
  39. - --proxy-mode=ipvs
  40. - --ipvs-min-sync-period=5s
  41. - --ipvs-sync-period=5s
  42. - --ipvs-scheduler=rr
  43. {% endif %}
  44. securityContext:
  45. privileged: true
  46. volumeMounts:
  47. - mountPath: /etc/ssl/certs
  48. name: ssl-certs-host
  49. readOnly: true
  50. - mountPath: "{{ kube_config_dir }}/ssl"
  51. name: etc-kube-ssl
  52. readOnly: true
  53. - mountPath: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
  54. name: kubeconfig
  55. readOnly: true
  56. - mountPath: /var/run/dbus
  57. name: var-run-dbus
  58. readOnly: false
  59. - mountPath: /lib/modules
  60. name: lib-modules
  61. readOnly: true
  62. volumes:
  63. - name: ssl-certs-host
  64. hostPath:
  65. {% if ansible_os_family == 'RedHat' %}
  66. path: /etc/pki/tls
  67. {% else %}
  68. path: /usr/share/ca-certificates
  69. {% endif %}
  70. - name: etc-kube-ssl
  71. hostPath:
  72. path: "{{ kube_config_dir }}/ssl"
  73. - name: kubeconfig
  74. hostPath:
  75. path: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
  76. - name: var-run-dbus
  77. hostPath:
  78. path: /var/run/dbus
  79. - hostPath:
  80. path: /lib/modules
  81. name: lib-modules