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.

170 lines
5.2 KiB

  1. ---
  2. apiVersion: apps/v1
  3. kind: Deployment
  4. metadata:
  5. labels:
  6. io.cilium/app: operator
  7. name: cilium-operator
  8. name: cilium-operator
  9. namespace: kube-system
  10. spec:
  11. replicas: 1
  12. selector:
  13. matchLabels:
  14. io.cilium/app: operator
  15. name: cilium-operator
  16. strategy:
  17. rollingUpdate:
  18. maxSurge: 1
  19. maxUnavailable: 1
  20. type: RollingUpdate
  21. template:
  22. metadata:
  23. {% if cilium_enable_prometheus %}
  24. annotations:
  25. prometheus.io/port: "6942"
  26. prometheus.io/scrape: "true"
  27. {% endif %}
  28. labels:
  29. io.cilium/app: operator
  30. name: cilium-operator
  31. spec:
  32. # In HA mode, cilium-operator pods must not be scheduled on the same
  33. # node as they will clash with each other.
  34. affinity:
  35. podAntiAffinity:
  36. requiredDuringSchedulingIgnoredDuringExecution:
  37. - labelSelector:
  38. matchExpressions:
  39. - key: io.cilium/app
  40. operator: In
  41. values:
  42. - operator
  43. topologyKey: "kubernetes.io/hostname"
  44. containers:
  45. - args:
  46. - --debug=$(CILIUM_DEBUG)
  47. - --config-dir=/tmp/cilium/config-map
  48. command:
  49. - cilium-operator
  50. env:
  51. - name: POD_NAMESPACE
  52. valueFrom:
  53. fieldRef:
  54. apiVersion: v1
  55. fieldPath: metadata.namespace
  56. - name: K8S_NODE_NAME
  57. valueFrom:
  58. fieldRef:
  59. apiVersion: v1
  60. fieldPath: spec.nodeName
  61. - name: CILIUM_K8S_NAMESPACE
  62. valueFrom:
  63. fieldRef:
  64. apiVersion: v1
  65. fieldPath: metadata.namespace
  66. - name: CILIUM_DEBUG
  67. valueFrom:
  68. configMapKeyRef:
  69. key: debug
  70. name: cilium-config
  71. optional: true
  72. - name: CILIUM_CLUSTER_NAME
  73. valueFrom:
  74. configMapKeyRef:
  75. key: cluster-name
  76. name: cilium-config
  77. optional: true
  78. - name: CILIUM_CLUSTER_ID
  79. valueFrom:
  80. configMapKeyRef:
  81. key: cluster-id
  82. name: cilium-config
  83. optional: true
  84. - name: CILIUM_DISABLE_ENDPOINT_CRD
  85. valueFrom:
  86. configMapKeyRef:
  87. key: disable-endpoint-crd
  88. name: cilium-config
  89. optional: true
  90. - name: AWS_ACCESS_KEY_ID
  91. valueFrom:
  92. secretKeyRef:
  93. key: AWS_ACCESS_KEY_ID
  94. name: cilium-aws
  95. optional: true
  96. - name: AWS_SECRET_ACCESS_KEY
  97. valueFrom:
  98. secretKeyRef:
  99. key: AWS_SECRET_ACCESS_KEY
  100. name: cilium-aws
  101. optional: true
  102. - name: AWS_DEFAULT_REGION
  103. valueFrom:
  104. secretKeyRef:
  105. key: AWS_DEFAULT_REGION
  106. name: cilium-aws
  107. optional: true
  108. {% if cilium_kube_proxy_replacement == 'strict' %}
  109. - name: KUBERNETES_SERVICE_HOST
  110. value: "{{ kube_apiserver_global_endpoint | urlsplit('hostname') }}"
  111. - name: KUBERNETES_SERVICE_PORT
  112. value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
  113. {% endif %}
  114. image: "{{ cilium_operator_image_repo }}:{{ cilium_operator_image_tag }}"
  115. imagePullPolicy: {{ k8s_image_pull_policy }}
  116. name: cilium-operator
  117. {% if cilium_enable_prometheus %}
  118. ports:
  119. - containerPort: 6942
  120. hostPort: 6942
  121. name: prometheus
  122. protocol: TCP
  123. {% endif %}
  124. livenessProbe:
  125. httpGet:
  126. {% if cilium_enable_ipv4 %}
  127. host: 127.0.0.1
  128. {% else %}
  129. host: '::1'
  130. {% endif %}
  131. path: /healthz
  132. port: 9234
  133. scheme: HTTP
  134. initialDelaySeconds: 60
  135. periodSeconds: 10
  136. timeoutSeconds: 3
  137. volumeMounts:
  138. - mountPath: /var/lib/etcd-config
  139. name: etcd-config-path
  140. readOnly: true
  141. - mountPath: "{{cilium_cert_dir}}"
  142. name: etcd-secrets
  143. readOnly: true
  144. - mountPath: /tmp/cilium/config-map
  145. name: cilium-config-path
  146. readOnly: true
  147. dnsPolicy: ClusterFirst
  148. priorityClassName: system-node-critical
  149. restartPolicy: Always
  150. serviceAccount: cilium-operator
  151. serviceAccountName: cilium-operator
  152. hostNetwork: true
  153. tolerations:
  154. - operator: Exists
  155. volumes:
  156. # To read the etcd config stored in config maps
  157. - configMap:
  158. defaultMode: 420
  159. items:
  160. - key: etcd-config
  161. path: etcd.config
  162. name: cilium-config
  163. name: etcd-config-path
  164. # To read the k8s etcd secrets in case the user might want to use TLS
  165. - name: etcd-secrets
  166. hostPath:
  167. path: "{{cilium_cert_dir}}"
  168. - configMap:
  169. name: cilium-config
  170. name: cilium-config-path