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.

87 lines
2.7 KiB

  1. apiVersion: apps/v1
  2. kind: Deployment
  3. metadata:
  4. name: calico-kube-controllers
  5. namespace: kube-system
  6. labels:
  7. k8s-app: calico-kube-controllers
  8. spec:
  9. replicas: 1
  10. strategy:
  11. type: Recreate
  12. selector:
  13. matchLabels:
  14. k8s-app: calico-kube-controllers
  15. template:
  16. metadata:
  17. name: calico-kube-controllers
  18. namespace: kube-system
  19. labels:
  20. k8s-app: calico-kube-controllers
  21. spec:
  22. nodeSelector:
  23. {{ calico_policy_controller_deployment_nodeselector }}
  24. {% if calico_datastore == "etcd" %}
  25. hostNetwork: true
  26. {% endif %}
  27. serviceAccountName: calico-kube-controllers
  28. tolerations:
  29. - key: CriticalAddonsOnly
  30. operator: Exists
  31. - key: node-role.kubernetes.io/control-plane
  32. effect: NoSchedule
  33. {% if policy_controller_extra_tolerations is defined %}
  34. {{ policy_controller_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
  35. {% endif %}
  36. priorityClassName: system-cluster-critical
  37. containers:
  38. - name: calico-kube-controllers
  39. image: {{ calico_policy_image_repo }}:{{ calico_policy_image_tag }}
  40. imagePullPolicy: {{ k8s_image_pull_policy }}
  41. resources:
  42. limits:
  43. cpu: {{ calico_policy_controller_cpu_limit }}
  44. memory: {{ calico_policy_controller_memory_limit }}
  45. requests:
  46. cpu: {{ calico_policy_controller_cpu_requests }}
  47. memory: {{ calico_policy_controller_memory_requests }}
  48. livenessProbe:
  49. exec:
  50. command:
  51. - /usr/bin/check-status
  52. - -l
  53. periodSeconds: 10
  54. initialDelaySeconds: 10
  55. failureThreshold: 6
  56. readinessProbe:
  57. exec:
  58. command:
  59. - /usr/bin/check-status
  60. - -r
  61. periodSeconds: 10
  62. env:
  63. - name: LOG_LEVEL
  64. value: {{ calico_policy_controller_log_level }}
  65. {% if calico_datastore == "kdd" %}
  66. - name: ENABLED_CONTROLLERS
  67. value: node
  68. - name: DATASTORE_TYPE
  69. value: kubernetes
  70. {% else %}
  71. - name: ETCD_ENDPOINTS
  72. value: "{{ etcd_access_addresses }}"
  73. - name: ETCD_CA_CERT_FILE
  74. value: "{{ calico_cert_dir }}/ca_cert.crt"
  75. - name: ETCD_CERT_FILE
  76. value: "{{ calico_cert_dir }}/cert.crt"
  77. - name: ETCD_KEY_FILE
  78. value: "{{ calico_cert_dir }}/key.pem"
  79. volumeMounts:
  80. - mountPath: {{ calico_cert_dir }}
  81. name: etcd-certs
  82. readOnly: true
  83. volumes:
  84. - hostPath:
  85. path: {{ calico_cert_dir }}
  86. name: etcd-certs
  87. {% endif %}