1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
apiVersion: v1
kind: ServiceAccount
metadata:
name: socialweb-node-dns
namespace: kube-system
labels:
app.kubernetes.io/name: socialweb-node-dns
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: socialweb-node-dns
labels:
app.kubernetes.io/name: socialweb-node-dns
rules:
- apiGroups: [""]
resources: ["endpoints", "services", "pods", "namespaces"]
verbs: ["list", "watch"]
- apiGroups: ["discovery.k8s.io"]
resources: ["endpointslices"]
verbs: ["list", "watch"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: socialweb-node-dns
labels:
app.kubernetes.io/name: socialweb-node-dns
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: socialweb-node-dns
subjects:
- kind: ServiceAccount
name: socialweb-node-dns
namespace: kube-system
---
apiVersion: v1
kind: ConfigMap
metadata:
name: socialweb-node-dns
namespace: kube-system
labels:
app.kubernetes.io/name: socialweb-node-dns
data:
Corefile: |
.:53 {
bind 169.254.20.10
errors
health 169.254.20.10:8080
ready 169.254.20.10:8181
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
}
forward . /etc/resolv.conf
cache 30
loop
reload
loadbalance
}
---
apiVersion: apps/v1
kind: DaemonSet
metadata:
name: socialweb-node-dns
namespace: kube-system
labels:
app.kubernetes.io/name: socialweb-node-dns
spec:
selector:
matchLabels:
app.kubernetes.io/name: socialweb-node-dns
updateStrategy:
type: RollingUpdate
rollingUpdate:
maxUnavailable: 1
template:
metadata:
labels:
app.kubernetes.io/name: socialweb-node-dns
spec:
serviceAccountName: socialweb-node-dns
priorityClassName: system-node-critical
hostNetwork: true
dnsPolicy: Default
nodeSelector:
socialweb.computer/node-local-dns: "true"
tolerations:
- operator: Exists
containers:
- name: coredns
image: rancher/mirrored-coredns-coredns:1.14.6@sha256:1ba6f47265602e2e50a9c4669e3a955e4298a0d30dc82f39293d4bf1a851e0ff
imagePullPolicy: IfNotPresent
args: ["-conf", "/etc/coredns/Corefile"]
resources:
requests:
cpu: 25m
memory: 32Mi
limits:
memory: 170Mi
securityContext:
allowPrivilegeEscalation: false
readOnlyRootFilesystem: true
capabilities:
add: ["NET_BIND_SERVICE"]
drop: ["all"]
livenessProbe:
httpGet:
host: 169.254.20.10
path: /health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
host: 169.254.20.10
path: /ready
port: 8181
periodSeconds: 2
volumeMounts:
- name: config
mountPath: /etc/coredns
readOnly: true
volumes:
- name: config
configMap:
name: socialweb-node-dns
items:
- key: Corefile
path: Corefile