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.

165 lines
5.1 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. - --kvstore=etcd
  48. - --kvstore-opt=etcd.config=/var/lib/etcd-config/etcd.config
  49. command:
  50. - cilium-operator
  51. env:
  52. - name: POD_NAMESPACE
  53. valueFrom:
  54. fieldRef:
  55. apiVersion: v1
  56. fieldPath: metadata.namespace
  57. - name: K8S_NODE_NAME
  58. valueFrom:
  59. fieldRef:
  60. apiVersion: v1
  61. fieldPath: spec.nodeName
  62. - name: CILIUM_K8S_NAMESPACE
  63. valueFrom:
  64. fieldRef:
  65. apiVersion: v1
  66. fieldPath: metadata.namespace
  67. - name: CILIUM_DEBUG
  68. valueFrom:
  69. configMapKeyRef:
  70. key: debug
  71. name: cilium-config
  72. optional: true
  73. - name: CILIUM_CLUSTER_NAME
  74. valueFrom:
  75. configMapKeyRef:
  76. key: cluster-name
  77. name: cilium-config
  78. optional: true
  79. - name: CILIUM_CLUSTER_ID
  80. valueFrom:
  81. configMapKeyRef:
  82. key: cluster-id
  83. name: cilium-config
  84. optional: true
  85. - name: CILIUM_DISABLE_ENDPOINT_CRD
  86. valueFrom:
  87. configMapKeyRef:
  88. key: disable-endpoint-crd
  89. name: cilium-config
  90. optional: true
  91. - name: AWS_ACCESS_KEY_ID
  92. valueFrom:
  93. secretKeyRef:
  94. key: AWS_ACCESS_KEY_ID
  95. name: cilium-aws
  96. optional: true
  97. - name: AWS_SECRET_ACCESS_KEY
  98. valueFrom:
  99. secretKeyRef:
  100. key: AWS_SECRET_ACCESS_KEY
  101. name: cilium-aws
  102. optional: true
  103. - name: AWS_DEFAULT_REGION
  104. valueFrom:
  105. secretKeyRef:
  106. key: AWS_DEFAULT_REGION
  107. name: cilium-aws
  108. optional: true
  109. {% if cilium_kube_proxy_replacement == 'strict' %}
  110. - name: KUBERNETES_SERVICE_HOST
  111. value: "{{ kube_apiserver_global_endpoint | urlsplit('hostname') }}"
  112. - name: KUBERNETES_SERVICE_PORT
  113. value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
  114. {% endif %}
  115. image: "{{ cilium_operator_image_repo }}:{{ cilium_operator_image_tag }}"
  116. imagePullPolicy: {{ k8s_image_pull_policy }}
  117. name: cilium-operator
  118. {% if cilium_enable_prometheus %}
  119. ports:
  120. - containerPort: 6942
  121. hostPort: 6942
  122. name: prometheus
  123. protocol: TCP
  124. {% endif %}
  125. livenessProbe:
  126. httpGet:
  127. {% if cilium_enable_ipv4 %}
  128. host: 127.0.0.1
  129. {% else %}
  130. host: '::1'
  131. {% endif %}
  132. path: /healthz
  133. port: 9234
  134. scheme: HTTP
  135. initialDelaySeconds: 60
  136. periodSeconds: 10
  137. timeoutSeconds: 3
  138. volumeMounts:
  139. - mountPath: /var/lib/etcd-config
  140. name: etcd-config-path
  141. readOnly: true
  142. - mountPath: "{{cilium_cert_dir}}"
  143. name: etcd-secrets
  144. readOnly: true
  145. dnsPolicy: ClusterFirst
  146. priorityClassName: system-node-critical
  147. restartPolicy: Always
  148. serviceAccount: cilium-operator
  149. serviceAccountName: cilium-operator
  150. hostNetwork: true
  151. tolerations:
  152. - operator: Exists
  153. volumes:
  154. # To read the etcd config stored in config maps
  155. - configMap:
  156. defaultMode: 420
  157. items:
  158. - key: etcd-config
  159. path: etcd.config
  160. name: cilium-config
  161. name: etcd-config-path
  162. # To read the k8s etcd secrets in case the user might want to use TLS
  163. - name: etcd-secrets
  164. hostPath:
  165. path: "{{cilium_cert_dir}}"