2018-12-11 01:28:03 +00:00
|
|
|
apiVersion: apps/v1
|
|
|
|
kind: DaemonSet
|
|
|
|
metadata:
|
|
|
|
name: nodelocaldns
|
|
|
|
namespace: kube-system
|
|
|
|
labels:
|
|
|
|
k8s-app: kube-dns
|
|
|
|
kubernetes.io/cluster-service: "true"
|
|
|
|
addonmanager.kubernetes.io/mode: Reconcile
|
|
|
|
spec:
|
|
|
|
selector:
|
|
|
|
matchLabels:
|
|
|
|
k8s-app: nodelocaldns
|
|
|
|
template:
|
|
|
|
metadata:
|
2019-01-28 09:57:40 +00:00
|
|
|
labels:
|
|
|
|
k8s-app: nodelocaldns
|
|
|
|
annotations:
|
|
|
|
prometheus.io/scrape: 'true'
|
|
|
|
prometheus.io/port: '9253'
|
2018-12-11 01:28:03 +00:00
|
|
|
spec:
|
|
|
|
priorityClassName: system-cluster-critical
|
|
|
|
serviceAccountName: nodelocaldns
|
|
|
|
hostNetwork: true
|
|
|
|
dnsPolicy: Default # Don't use cluster DNS.
|
|
|
|
tolerations:
|
2019-04-08 09:24:26 +00:00
|
|
|
- effect: NoSchedule
|
|
|
|
operator: "Exists"
|
|
|
|
- effect: NoExecute
|
|
|
|
operator: "Exists"
|
2018-12-11 01:28:03 +00:00
|
|
|
- key: "CriticalAddonsOnly"
|
|
|
|
operator: "Exists"
|
|
|
|
containers:
|
|
|
|
- name: node-cache
|
|
|
|
image: "{{ nodelocaldns_image_repo }}:{{ nodelocaldns_image_tag }}"
|
|
|
|
resources:
|
|
|
|
limits:
|
|
|
|
memory: {{ nodelocaldns_memory_limit }}
|
|
|
|
requests:
|
|
|
|
cpu: {{ nodelocaldns_cpu_requests }}
|
|
|
|
memory: {{ nodelocaldnsdns_memory_requests }}
|
2019-12-13 10:22:55 +00:00
|
|
|
args: [ "-localip", "{{ nodelocaldns_ip }}", "-conf", "/etc/coredns/Corefile", "-upstreamsvc", "coredns" ]
|
2018-12-11 01:28:03 +00:00
|
|
|
securityContext:
|
|
|
|
privileged: true
|
|
|
|
ports:
|
|
|
|
- containerPort: 53
|
|
|
|
name: dns
|
|
|
|
protocol: UDP
|
|
|
|
- containerPort: 53
|
|
|
|
name: dns-tcp
|
|
|
|
protocol: TCP
|
|
|
|
- containerPort: 9253
|
|
|
|
name: metrics
|
|
|
|
protocol: TCP
|
|
|
|
livenessProbe:
|
|
|
|
httpGet:
|
|
|
|
host: {{ nodelocaldns_ip }}
|
|
|
|
path: /health
|
2019-07-09 07:52:01 +00:00
|
|
|
port: {{ nodelocaldns_health_port }}
|
2018-12-11 01:28:03 +00:00
|
|
|
scheme: HTTP
|
|
|
|
timeoutSeconds: 5
|
|
|
|
successThreshold: 1
|
2019-04-23 21:46:02 +00:00
|
|
|
failureThreshold: 10
|
|
|
|
readinessProbe:
|
|
|
|
httpGet:
|
|
|
|
host: {{ nodelocaldns_ip }}
|
|
|
|
path: /health
|
2019-07-09 07:52:01 +00:00
|
|
|
port: {{ nodelocaldns_health_port }}
|
2019-04-23 21:46:02 +00:00
|
|
|
scheme: HTTP
|
|
|
|
timeoutSeconds: 5
|
|
|
|
successThreshold: 1
|
|
|
|
failureThreshold: 10
|
2018-12-11 01:28:03 +00:00
|
|
|
volumeMounts:
|
|
|
|
- name: config-volume
|
|
|
|
mountPath: /etc/coredns
|
2019-01-28 09:57:40 +00:00
|
|
|
- name: xtables-lock
|
|
|
|
mountPath: /run/xtables.lock
|
2018-12-11 01:28:03 +00:00
|
|
|
volumes:
|
|
|
|
- name: config-volume
|
|
|
|
configMap:
|
|
|
|
name: nodelocaldns
|
|
|
|
items:
|
|
|
|
- key: Corefile
|
|
|
|
path: Corefile
|
2019-01-28 09:57:40 +00:00
|
|
|
- name: xtables-lock
|
|
|
|
hostPath:
|
|
|
|
path: /run/xtables.lock
|
|
|
|
type: FileOrCreate
|
|
|
|
# Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force
|
|
|
|
# deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
|
|
|
|
terminationGracePeriodSeconds: 0
|
|
|
|
updateStrategy:
|
|
|
|
rollingUpdate:
|
|
|
|
maxUnavailable: {{ serial | default('20%') }}
|
|
|
|
type: RollingUpdate
|