2019-01-29 03:03:49 +08:00
|
|
|
apiVersion: apps/v1
|
2017-11-28 20:01:30 +08:00
|
|
|
kind: Deployment
|
2016-10-10 22:09:50 +08:00
|
|
|
metadata:
|
2017-11-28 20:01:30 +08:00
|
|
|
name: calico-kube-controllers
|
2018-03-30 19:29:13 +08:00
|
|
|
namespace: kube-system
|
2016-10-10 22:09:50 +08:00
|
|
|
labels:
|
2017-11-28 20:01:30 +08:00
|
|
|
k8s-app: calico-kube-controllers
|
2016-10-10 22:09:50 +08:00
|
|
|
spec:
|
|
|
|
replicas: 1
|
2018-08-23 22:17:18 +08:00
|
|
|
strategy:
|
2019-01-29 03:03:49 +08:00
|
|
|
type: Recreate
|
2016-10-10 22:09:50 +08:00
|
|
|
selector:
|
|
|
|
matchLabels:
|
2017-11-28 20:01:30 +08:00
|
|
|
k8s-app: calico-kube-controllers
|
2016-10-10 22:09:50 +08:00
|
|
|
template:
|
|
|
|
metadata:
|
2017-11-28 20:01:30 +08:00
|
|
|
name: calico-kube-controllers
|
2018-03-30 19:29:13 +08:00
|
|
|
namespace: kube-system
|
2016-10-10 22:09:50 +08:00
|
|
|
labels:
|
2017-11-28 20:01:30 +08:00
|
|
|
k8s-app: calico-kube-controllers
|
2016-10-10 22:09:50 +08:00
|
|
|
spec:
|
2019-01-29 03:03:49 +08:00
|
|
|
nodeSelector:
|
2021-05-26 04:40:43 +08:00
|
|
|
{{ calico_policy_controller_deployment_nodeselector }}
|
2022-12-14 12:41:34 +08:00
|
|
|
{% if calico_datastore == "etcd" %}
|
|
|
|
hostNetwork: true
|
|
|
|
{% endif %}
|
2017-11-28 20:01:30 +08:00
|
|
|
serviceAccountName: calico-kube-controllers
|
2017-08-24 17:04:25 +08:00
|
|
|
tolerations:
|
2022-11-07 09:34:17 +08:00
|
|
|
- key: CriticalAddonsOnly
|
|
|
|
operator: Exists
|
2021-01-22 00:13:03 +08:00
|
|
|
- key: node-role.kubernetes.io/control-plane
|
|
|
|
effect: NoSchedule
|
2022-06-20 16:36:06 +08:00
|
|
|
{% if policy_controller_extra_tolerations is defined %}
|
|
|
|
{{ policy_controller_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
|
|
|
|
{% endif %}
|
2018-09-25 22:50:22 +08:00
|
|
|
priorityClassName: system-cluster-critical
|
2016-10-10 22:09:50 +08:00
|
|
|
containers:
|
2017-11-28 20:01:30 +08:00
|
|
|
- name: calico-kube-controllers
|
2016-11-21 18:20:44 +08:00
|
|
|
image: {{ calico_policy_image_repo }}:{{ calico_policy_image_tag }}
|
2016-11-22 23:16:04 +08:00
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
2016-12-23 22:44:44 +08:00
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
cpu: {{ calico_policy_controller_cpu_limit }}
|
|
|
|
memory: {{ calico_policy_controller_memory_limit }}
|
|
|
|
requests:
|
|
|
|
cpu: {{ calico_policy_controller_cpu_requests }}
|
|
|
|
memory: {{ calico_policy_controller_memory_requests }}
|
2021-05-26 04:40:50 +08:00
|
|
|
livenessProbe:
|
|
|
|
exec:
|
|
|
|
command:
|
|
|
|
- /usr/bin/check-status
|
|
|
|
- -l
|
|
|
|
periodSeconds: 10
|
|
|
|
initialDelaySeconds: 10
|
|
|
|
failureThreshold: 6
|
2019-07-10 03:42:28 +08:00
|
|
|
readinessProbe:
|
|
|
|
exec:
|
|
|
|
command:
|
|
|
|
- /usr/bin/check-status
|
|
|
|
- -r
|
2021-05-26 04:40:50 +08:00
|
|
|
periodSeconds: 10
|
2016-10-10 22:09:50 +08:00
|
|
|
env:
|
2024-07-02 22:13:59 +08:00
|
|
|
- name: LOG_LEVEL
|
|
|
|
value: {{ calico_policy_controller_log_level }}
|
2020-09-25 00:04:06 +08:00
|
|
|
{% if calico_datastore == "kdd" %}
|
2019-07-10 03:42:28 +08:00
|
|
|
- name: ENABLED_CONTROLLERS
|
|
|
|
value: node
|
|
|
|
- name: DATASTORE_TYPE
|
|
|
|
value: kubernetes
|
|
|
|
{% else %}
|
2016-10-10 22:09:50 +08:00
|
|
|
- name: ETCD_ENDPOINTS
|
2017-10-04 20:27:55 +08:00
|
|
|
value: "{{ etcd_access_addresses }}"
|
2016-11-09 18:44:41 +08:00
|
|
|
- name: ETCD_CA_CERT_FILE
|
2016-12-30 20:47:12 +08:00
|
|
|
value: "{{ calico_cert_dir }}/ca_cert.crt"
|
2016-11-09 18:44:41 +08:00
|
|
|
- name: ETCD_CERT_FILE
|
2016-12-30 20:47:12 +08:00
|
|
|
value: "{{ calico_cert_dir }}/cert.crt"
|
2016-11-09 18:44:41 +08:00
|
|
|
- name: ETCD_KEY_FILE
|
2016-12-30 20:47:12 +08:00
|
|
|
value: "{{ calico_cert_dir }}/key.pem"
|
2016-11-10 20:13:03 +08:00
|
|
|
volumeMounts:
|
2016-12-30 20:47:12 +08:00
|
|
|
- mountPath: {{ calico_cert_dir }}
|
2016-11-10 20:13:03 +08:00
|
|
|
name: etcd-certs
|
|
|
|
readOnly: true
|
|
|
|
volumes:
|
|
|
|
- hostPath:
|
2016-12-30 20:47:12 +08:00
|
|
|
path: {{ calico_cert_dir }}
|
2016-11-10 20:13:03 +08:00
|
|
|
name: etcd-certs
|
2019-07-10 03:42:28 +08:00
|
|
|
{% endif %}
|