2018-03-13 11:00:05 +00:00
|
|
|
---
|
2019-09-10 19:06:55 +00:00
|
|
|
apiVersion: apps/v1
|
2018-03-13 11:00:05 +00:00
|
|
|
kind: Deployment
|
|
|
|
metadata:
|
2019-03-26 18:09:17 +00:00
|
|
|
name: "coredns{{ coredns_ordinal_suffix }}"
|
2018-03-30 11:29:13 +00:00
|
|
|
namespace: kube-system
|
2018-03-13 11:00:05 +00:00
|
|
|
labels:
|
2019-04-10 11:12:13 +00:00
|
|
|
k8s-app: "kube-dns{{ coredns_ordinal_suffix }}"
|
2018-11-15 17:52:12 +00:00
|
|
|
addonmanager.kubernetes.io/mode: Reconcile
|
2019-03-26 18:09:17 +00:00
|
|
|
kubernetes.io/name: "coredns{{ coredns_ordinal_suffix }}"
|
2018-03-13 11:00:05 +00:00
|
|
|
spec:
|
|
|
|
strategy:
|
|
|
|
type: RollingUpdate
|
|
|
|
rollingUpdate:
|
|
|
|
maxUnavailable: 0
|
|
|
|
maxSurge: 10%
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
2019-04-10 11:12:13 +00:00
|
|
|
k8s-app: kube-dns{{ coredns_ordinal_suffix }}
|
2018-03-13 11:00:05 +00:00
|
|
|
template:
|
|
|
|
metadata:
|
|
|
|
labels:
|
2019-04-10 11:12:13 +00:00
|
|
|
k8s-app: kube-dns{{ coredns_ordinal_suffix }}
|
2018-03-13 11:00:05 +00:00
|
|
|
annotations:
|
2020-05-27 21:02:02 +00:00
|
|
|
seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
|
2021-02-09 14:02:40 +00:00
|
|
|
createdby: 'kubespray'
|
2018-03-13 11:00:05 +00:00
|
|
|
spec:
|
2018-11-13 12:54:15 +00:00
|
|
|
nodeSelector:
|
2021-05-25 20:40:43 +00:00
|
|
|
{{ coredns_deployment_nodeselector }}
|
|
|
|
priorityClassName: system-cluster-critical
|
2018-03-13 11:00:05 +00:00
|
|
|
serviceAccountName: coredns
|
|
|
|
tolerations:
|
2019-04-17 14:58:06 +00:00
|
|
|
- key: node-role.kubernetes.io/master
|
2018-03-13 11:00:05 +00:00
|
|
|
effect: NoSchedule
|
2021-01-21 16:13:03 +00:00
|
|
|
- key: node-role.kubernetes.io/control-plane
|
|
|
|
effect: NoSchedule
|
2019-11-27 13:49:21 +00:00
|
|
|
{% if dns_extra_tolerations | default(None) %}
|
|
|
|
{{ dns_extra_tolerations | list | to_nice_yaml(indent=2) | indent(8) }}
|
|
|
|
{% endif %}
|
2018-08-09 15:42:53 +00:00
|
|
|
affinity:
|
|
|
|
podAntiAffinity:
|
|
|
|
requiredDuringSchedulingIgnoredDuringExecution:
|
|
|
|
- topologyKey: "kubernetes.io/hostname"
|
|
|
|
labelSelector:
|
|
|
|
matchLabels:
|
2019-04-10 11:12:13 +00:00
|
|
|
k8s-app: kube-dns{{ coredns_ordinal_suffix }}
|
2018-08-09 15:42:53 +00:00
|
|
|
nodeAffinity:
|
|
|
|
preferredDuringSchedulingIgnoredDuringExecution:
|
|
|
|
- weight: 100
|
|
|
|
preference:
|
|
|
|
matchExpressions:
|
2021-01-21 16:13:03 +00:00
|
|
|
- key: node-role.kubernetes.io/control-plane
|
2018-08-09 15:42:53 +00:00
|
|
|
operator: In
|
|
|
|
values:
|
2018-11-22 13:27:25 +00:00
|
|
|
- ""
|
2018-03-13 11:00:05 +00:00
|
|
|
containers:
|
|
|
|
- name: coredns
|
|
|
|
image: "{{ coredns_image_repo }}:{{ coredns_image_tag }}"
|
|
|
|
imagePullPolicy: {{ k8s_image_pull_policy }}
|
|
|
|
resources:
|
|
|
|
# TODO: Set memory limits when we've profiled the container for large
|
|
|
|
# clusters, then set request = limit to keep this container in
|
|
|
|
# guaranteed class. Currently, this container falls into the
|
|
|
|
# "burstable" category so the kubelet doesn't backoff from restarting it.
|
|
|
|
limits:
|
|
|
|
memory: {{ dns_memory_limit }}
|
|
|
|
requests:
|
|
|
|
cpu: {{ dns_cpu_requests }}
|
|
|
|
memory: {{ dns_memory_requests }}
|
|
|
|
args: [ "-conf", "/etc/coredns/Corefile" ]
|
|
|
|
volumeMounts:
|
|
|
|
- name: config-volume
|
|
|
|
mountPath: /etc/coredns
|
|
|
|
ports:
|
|
|
|
- containerPort: 53
|
|
|
|
name: dns
|
|
|
|
protocol: UDP
|
|
|
|
- containerPort: 53
|
|
|
|
name: dns-tcp
|
|
|
|
protocol: TCP
|
|
|
|
- containerPort: 9153
|
|
|
|
name: metrics
|
|
|
|
protocol: TCP
|
2018-10-11 07:12:58 +00:00
|
|
|
securityContext:
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
capabilities:
|
|
|
|
add:
|
|
|
|
- NET_BIND_SERVICE
|
|
|
|
drop:
|
|
|
|
- all
|
|
|
|
readOnlyRootFilesystem: true
|
2018-03-13 11:00:05 +00:00
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
path: /health
|
|
|
|
port: 8080
|
|
|
|
scheme: HTTP
|
|
|
|
timeoutSeconds: 5
|
|
|
|
successThreshold: 1
|
2019-04-23 21:46:02 +00:00
|
|
|
failureThreshold: 10
|
2019-04-04 07:40:50 +00:00
|
|
|
readinessProbe:
|
|
|
|
httpGet:
|
2019-05-28 13:47:57 +00:00
|
|
|
path: /ready
|
|
|
|
port: 8181
|
2019-04-04 07:40:50 +00:00
|
|
|
scheme: HTTP
|
|
|
|
timeoutSeconds: 5
|
|
|
|
successThreshold: 1
|
2019-04-23 21:46:02 +00:00
|
|
|
failureThreshold: 10
|
2018-03-13 11:00:05 +00:00
|
|
|
dnsPolicy: Default
|
|
|
|
volumes:
|
|
|
|
- name: config-volume
|
|
|
|
configMap:
|
|
|
|
name: coredns
|
|
|
|
items:
|
|
|
|
- key: Corefile
|
|
|
|
path: Corefile
|
2020-06-26 07:03:31 +00:00
|
|
|
{% if dns_etchosts | default(None) %}
|
|
|
|
- key: hosts
|
|
|
|
path: hosts
|
|
|
|
{% endif %}
|