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.

74 lines
2.0 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. {% endif %}
  37. securityContext:
  38. privileged: true
  39. volumeMounts:
  40. - mountPath: /etc/ssl/certs
  41. name: ssl-certs-host
  42. readOnly: true
  43. - mountPath: "{{ kube_config_dir }}/ssl"
  44. name: etc-kube-ssl
  45. readOnly: true
  46. - mountPath: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
  47. name: kubeconfig
  48. readOnly: true
  49. - mountPath: /var/run/dbus
  50. name: var-run-dbus
  51. readOnly: false
  52. - mountPath: /lib/modules
  53. name: lib-modules
  54. readOnly: true
  55. volumes:
  56. - name: ssl-certs-host
  57. hostPath:
  58. {% if ansible_os_family == 'RedHat' %}
  59. path: /etc/pki/tls
  60. {% else %}
  61. path: /usr/share/ca-certificates
  62. {% endif %}
  63. - name: etc-kube-ssl
  64. hostPath:
  65. path: "{{ kube_config_dir }}/ssl"
  66. - name: kubeconfig
  67. hostPath:
  68. path: "{{ kube_config_dir }}/kube-proxy-kubeconfig.yaml"
  69. - name: var-run-dbus
  70. hostPath:
  71. path: /var/run/dbus
  72. - hostPath:
  73. path: /lib/modules
  74. name: lib-modules