2019-08-06 08:37:55 +00:00
|
|
|
---
|
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
|
|
|
labels:
|
|
|
|
io.cilium/app: operator
|
|
|
|
name: cilium-operator
|
|
|
|
name: cilium-operator
|
|
|
|
namespace: kube-system
|
|
|
|
spec:
|
|
|
|
replicas: 1
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
io.cilium/app: operator
|
|
|
|
name: cilium-operator
|
|
|
|
strategy:
|
|
|
|
rollingUpdate:
|
|
|
|
maxSurge: 1
|
|
|
|
maxUnavailable: 1
|
|
|
|
type: RollingUpdate
|
|
|
|
template:
|
|
|
|
metadata:
|
2020-08-18 07:35:29 +00:00
|
|
|
{% if cilium_enable_prometheus %}
|
|
|
|
annotations:
|
|
|
|
prometheus.io/port: "6942"
|
|
|
|
prometheus.io/scrape: "true"
|
|
|
|
{% endif %}
|
2019-08-06 08:37:55 +00:00
|
|
|
labels:
|
|
|
|
io.cilium/app: operator
|
|
|
|
name: cilium-operator
|
|
|
|
spec:
|
2020-09-07 09:11:49 +00:00
|
|
|
# In HA mode, cilium-operator pods must not be scheduled on the same
|
|
|
|
# node as they will clash with each other.
|
|
|
|
affinity:
|
|
|
|
podAntiAffinity:
|
|
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
|
|
- labelSelector:
|
|
|
|
matchExpressions:
|
|
|
|
- key: io.cilium/app
|
|
|
|
operator: In
|
|
|
|
values:
|
|
|
|
- operator
|
|
|
|
topologyKey: "kubernetes.io/hostname"
|
2019-08-06 08:37:55 +00:00
|
|
|
containers:
|
|
|
|
- args:
|
|
|
|
- --debug=$(CILIUM_DEBUG)
|
2021-04-01 14:33:22 +00:00
|
|
|
- --config-dir=/tmp/cilium/config-map
|
2022-05-11 13:23:04 +00:00
|
|
|
{% if cilium_operator_custom_args is string %}
|
|
|
|
- {{ cilium_operator_custom_args }}
|
|
|
|
{% else %}
|
|
|
|
{% for flag in cilium_operator_custom_args %}
|
|
|
|
- {{ flag }}
|
|
|
|
{% endfor %}
|
|
|
|
{% endif %}
|
2019-08-06 08:37:55 +00:00
|
|
|
command:
|
|
|
|
- cilium-operator
|
|
|
|
env:
|
|
|
|
- name: POD_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
apiVersion: v1
|
|
|
|
fieldPath: metadata.namespace
|
|
|
|
- name: K8S_NODE_NAME
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
apiVersion: v1
|
|
|
|
fieldPath: spec.nodeName
|
2020-09-07 09:11:49 +00:00
|
|
|
- name: CILIUM_K8S_NAMESPACE
|
|
|
|
valueFrom:
|
|
|
|
fieldRef:
|
|
|
|
apiVersion: v1
|
|
|
|
fieldPath: metadata.namespace
|
2019-08-06 08:37:55 +00:00
|
|
|
- name: CILIUM_DEBUG
|
|
|
|
valueFrom:
|
|
|
|
configMapKeyRef:
|
|
|
|
key: debug
|
|
|
|
name: cilium-config
|
|
|
|
optional: true
|
2022-05-11 13:23:04 +00:00
|
|
|
# We are already mounting the whole ConfigMap as a directory.
|
|
|
|
# https://github.com/cilium/cilium/pull/10347
|
|
|
|
{% if cilium_version | regex_replace('v') is version('1.8', '<') %}
|
2019-08-06 08:37:55 +00:00
|
|
|
- name: CILIUM_CLUSTER_NAME
|
|
|
|
valueFrom:
|
|
|
|
configMapKeyRef:
|
|
|
|
key: cluster-name
|
|
|
|
name: cilium-config
|
|
|
|
optional: true
|
|
|
|
- name: CILIUM_CLUSTER_ID
|
|
|
|
valueFrom:
|
|
|
|
configMapKeyRef:
|
|
|
|
key: cluster-id
|
|
|
|
name: cilium-config
|
|
|
|
optional: true
|
|
|
|
- name: CILIUM_DISABLE_ENDPOINT_CRD
|
|
|
|
valueFrom:
|
|
|
|
configMapKeyRef:
|
|
|
|
key: disable-endpoint-crd
|
|
|
|
name: cilium-config
|
|
|
|
optional: true
|
2022-05-11 13:23:04 +00:00
|
|
|
{% endif %}
|
2019-08-06 08:37:55 +00:00
|
|
|
- name: AWS_ACCESS_KEY_ID
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: AWS_ACCESS_KEY_ID
|
|
|
|
name: cilium-aws
|
|
|
|
optional: true
|
|
|
|
- name: AWS_SECRET_ACCESS_KEY
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: AWS_SECRET_ACCESS_KEY
|
|
|
|
name: cilium-aws
|
|
|
|
optional: true
|
|
|
|
- name: AWS_DEFAULT_REGION
|
|
|
|
valueFrom:
|
|
|
|
secretKeyRef:
|
|
|
|
key: AWS_DEFAULT_REGION
|
|
|
|
name: cilium-aws
|
|
|
|
optional: true
|
2020-08-06 07:14:55 +00:00
|
|
|
{% if cilium_kube_proxy_replacement == 'strict' %}
|
|
|
|
- name: KUBERNETES_SERVICE_HOST
|
|
|
|
value: "{{ kube_apiserver_global_endpoint | urlsplit('hostname') }}"
|
|
|
|
- name: KUBERNETES_SERVICE_PORT
|
|
|
|
value: "{{ kube_apiserver_global_endpoint | urlsplit('port') }}"
|
|
|
|
{% endif %}
|
2020-03-25 09:17:03 +00:00
|
|
|
image: "{{ cilium_operator_image_repo }}:{{ cilium_operator_image_tag }}"
|
2020-05-10 18:37:50 +00:00
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
2019-08-06 08:37:55 +00:00
|
|
|
name: cilium-operator
|
2020-08-18 07:35:29 +00:00
|
|
|
{% if cilium_enable_prometheus %}
|
|
|
|
ports:
|
|
|
|
- containerPort: 6942
|
|
|
|
hostPort: 6942
|
|
|
|
name: prometheus
|
|
|
|
protocol: TCP
|
|
|
|
{% endif %}
|
2019-08-06 08:37:55 +00:00
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
2020-04-27 06:59:29 +00:00
|
|
|
{% if cilium_enable_ipv4 %}
|
|
|
|
host: 127.0.0.1
|
|
|
|
{% else %}
|
2020-06-25 13:16:38 +00:00
|
|
|
host: '::1'
|
2020-04-27 06:59:29 +00:00
|
|
|
{% endif %}
|
2019-08-06 08:37:55 +00:00
|
|
|
path: /healthz
|
|
|
|
port: 9234
|
|
|
|
scheme: HTTP
|
|
|
|
initialDelaySeconds: 60
|
|
|
|
periodSeconds: 10
|
|
|
|
timeoutSeconds: 3
|
|
|
|
volumeMounts:
|
2022-02-08 22:04:35 +00:00
|
|
|
{% if cilium_identity_allocation_mode == "kvstore" %}
|
2019-08-06 08:37:55 +00:00
|
|
|
- mountPath: /var/lib/etcd-config
|
|
|
|
name: etcd-config-path
|
|
|
|
readOnly: true
|
|
|
|
- mountPath: "{{cilium_cert_dir}}"
|
|
|
|
name: etcd-secrets
|
|
|
|
readOnly: true
|
2022-01-16 17:29:28 +00:00
|
|
|
{% endif %}
|
2021-04-01 14:33:22 +00:00
|
|
|
- mountPath: /tmp/cilium/config-map
|
|
|
|
name: cilium-config-path
|
|
|
|
readOnly: true
|
2022-05-11 13:23:04 +00:00
|
|
|
{% for volume_mount in cilium_operator_extra_volume_mounts %}
|
|
|
|
- {{ volume_mount | to_nice_yaml(indent=2) | indent(14) }}
|
|
|
|
{% endfor %}
|
2019-08-06 08:37:55 +00:00
|
|
|
dnsPolicy: ClusterFirst
|
|
|
|
priorityClassName: system-node-critical
|
|
|
|
restartPolicy: Always
|
|
|
|
serviceAccount: cilium-operator
|
|
|
|
serviceAccountName: cilium-operator
|
2020-04-27 06:59:29 +00:00
|
|
|
hostNetwork: true
|
2020-09-07 09:11:49 +00:00
|
|
|
tolerations:
|
|
|
|
- operator: Exists
|
2019-08-06 08:37:55 +00:00
|
|
|
volumes:
|
2022-02-08 22:04:35 +00:00
|
|
|
{% if cilium_identity_allocation_mode == "kvstore" %}
|
2019-08-06 08:37:55 +00:00
|
|
|
# To read the etcd config stored in config maps
|
|
|
|
- configMap:
|
|
|
|
defaultMode: 420
|
|
|
|
items:
|
|
|
|
- key: etcd-config
|
|
|
|
path: etcd.config
|
|
|
|
name: cilium-config
|
|
|
|
name: etcd-config-path
|
|
|
|
# To read the k8s etcd secrets in case the user might want to use TLS
|
|
|
|
- name: etcd-secrets
|
|
|
|
hostPath:
|
|
|
|
path: "{{cilium_cert_dir}}"
|
2022-01-16 17:29:28 +00:00
|
|
|
{% endif %}
|
2021-04-01 14:33:22 +00:00
|
|
|
- configMap:
|
|
|
|
name: cilium-config
|
|
|
|
name: cilium-config-path
|
2022-05-11 13:23:04 +00:00
|
|
|
{% for volume in cilium_operator_extra_volumes %}
|
|
|
|
- {{ volume | to_nice_yaml(indent=2) | indent(10) }}
|
|
|
|
{% endfor %}
|