Skip to content

Commit ed78b51

Browse files
committed
Fix coredns
1 parent 376c648 commit ed78b51

File tree

2 files changed

+43
-13
lines changed

2 files changed

+43
-13
lines changed

deploy/helm/kubernetes/manifests/coredns-1.8.yaml renamed to deploy/helm/kubernetes/manifests/coredns.yaml

+42-12
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,20 @@
1+
# Source: https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/dns/coredns/coredns.yaml.base
2+
---
13
apiVersion: v1
24
kind: ServiceAccount
35
metadata:
46
name: coredns
57
namespace: kube-system
8+
labels:
9+
kubernetes.io/cluster-service: "true"
10+
addonmanager.kubernetes.io/mode: Reconcile
611
---
712
apiVersion: rbac.authorization.k8s.io/v1
813
kind: ClusterRole
914
metadata:
1015
labels:
1116
kubernetes.io/bootstrapping: rbac-defaults
17+
addonmanager.kubernetes.io/mode: Reconcile
1218
name: system:coredns
1319
rules:
1420
- apiGroups:
@@ -42,6 +48,7 @@ metadata:
4248
rbac.authorization.kubernetes.io/autoupdate: "true"
4349
labels:
4450
kubernetes.io/bootstrapping: rbac-defaults
51+
addonmanager.kubernetes.io/mode: EnsureExists
4552
name: system:coredns
4653
roleRef:
4754
apiGroup: rbac.authorization.k8s.io
@@ -61,13 +68,19 @@ data:
6168
Corefile: |
6269
.:53 {
6370
errors
64-
health
71+
health {
72+
lameduck 5s
73+
}
6574
ready
6675
kubernetes cluster.local in-addr.arpa ip6.arpa {
67-
pods insecure
68-
fallthrough in-addr.arpa ip6.arpa
76+
pods insecure
77+
fallthrough in-addr.arpa ip6.arpa
78+
ttl 30
6979
}
7080
prometheus :9153
81+
forward . /etc/resolv.conf {
82+
max_concurrent 1000
83+
}
7184
cache 30
7285
loop
7386
reload
@@ -81,6 +94,8 @@ metadata:
8194
namespace: kube-system
8295
labels:
8396
k8s-app: kube-dns
97+
kubernetes.io/cluster-service: "true"
98+
addonmanager.kubernetes.io/mode: Reconcile
8499
kubernetes.io/name: "CoreDNS"
85100
spec:
86101
replicas: {{ .Values.coredns.replicaCount }}
@@ -96,13 +111,27 @@ spec:
96111
labels:
97112
k8s-app: kube-dns
98113
spec:
114+
securityContext:
115+
seccompProfile:
116+
type: RuntimeDefault
99117
priorityClassName: system-cluster-critical
100118
serviceAccountName: coredns
119+
affinity:
120+
podAntiAffinity:
121+
preferredDuringSchedulingIgnoredDuringExecution:
122+
- weight: 100
123+
podAffinityTerm:
124+
labelSelector:
125+
matchExpressions:
126+
- key: k8s-app
127+
operator: In
128+
values: ["kube-dns"]
129+
topologyKey: kubernetes.io/hostname
101130
tolerations:
102131
- key: "CriticalAddonsOnly"
103132
operator: "Exists"
104133
nodeSelector:
105-
beta.kubernetes.io/os: linux
134+
kubernetes.io/os: linux
106135
{{- with .Values.coredns.image.pullSecrets }}
107136
imagePullSecrets:
108137
{{- toYaml . | nindent 10 }}
@@ -130,14 +159,6 @@ spec:
130159
- containerPort: 9153
131160
name: metrics
132161
protocol: TCP
133-
securityContext:
134-
allowPrivilegeEscalation: false
135-
capabilities:
136-
add:
137-
- NET_BIND_SERVICE
138-
drop:
139-
- all
140-
readOnlyRootFilesystem: true
141162
livenessProbe:
142163
httpGet:
143164
path: /health
@@ -152,6 +173,14 @@ spec:
152173
path: /ready
153174
port: 8181
154175
scheme: HTTP
176+
securityContext:
177+
allowPrivilegeEscalation: false
178+
capabilities:
179+
add:
180+
- NET_BIND_SERVICE
181+
drop:
182+
- all
183+
readOnlyRootFilesystem: true
155184
dnsPolicy: Default
156185
volumes:
157186
- name: config-volume
@@ -172,6 +201,7 @@ metadata:
172201
labels:
173202
k8s-app: kube-dns
174203
kubernetes.io/cluster-service: "true"
204+
addonmanager.kubernetes.io/mode: Reconcile
175205
kubernetes.io/name: "CoreDNS"
176206
spec:
177207
selector:

deploy/helm/kubernetes/templates/kubedns-manifests.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ metadata:
88
data:
99
{{- if .Values.coredns.enabled }}
1010
coredns.yaml: |
11-
{{- tpl (.Files.Get "manifests/coredns-1.8.yaml") . | nindent 4 }}
11+
{{- tpl (.Files.Get "manifests/coredns.yaml") . | nindent 4 }}
1212
{{- end }}
1313
{{- end }}

0 commit comments

Comments
 (0)