Skip to content

Commit

Permalink
Fix coredns
Browse files Browse the repository at this point in the history
  • Loading branch information
kvaps committed Jun 15, 2021
1 parent 376c648 commit ed78b51
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
# Source: https://github.com/kubernetes/kubernetes/blob/master/cluster/addons/dns/coredns/coredns.yaml.base
---
apiVersion: v1
kind: ServiceAccount
metadata:
name: coredns
namespace: kube-system
labels:
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
kubernetes.io/bootstrapping: rbac-defaults
addonmanager.kubernetes.io/mode: Reconcile
name: system:coredns
rules:
- apiGroups:
Expand Down Expand Up @@ -42,6 +48,7 @@ metadata:
rbac.authorization.kubernetes.io/autoupdate: "true"
labels:
kubernetes.io/bootstrapping: rbac-defaults
addonmanager.kubernetes.io/mode: EnsureExists
name: system:coredns
roleRef:
apiGroup: rbac.authorization.k8s.io
Expand All @@ -61,13 +68,19 @@ data:
Corefile: |
.:53 {
errors
health
health {
lameduck 5s
}
ready
kubernetes cluster.local in-addr.arpa ip6.arpa {
pods insecure
fallthrough in-addr.arpa ip6.arpa
pods insecure
fallthrough in-addr.arpa ip6.arpa
ttl 30
}
prometheus :9153
forward . /etc/resolv.conf {
max_concurrent 1000
}
cache 30
loop
reload
Expand All @@ -81,6 +94,8 @@ metadata:
namespace: kube-system
labels:
k8s-app: kube-dns
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/name: "CoreDNS"
spec:
replicas: {{ .Values.coredns.replicaCount }}
Expand All @@ -96,13 +111,27 @@ spec:
labels:
k8s-app: kube-dns
spec:
securityContext:
seccompProfile:
type: RuntimeDefault
priorityClassName: system-cluster-critical
serviceAccountName: coredns
affinity:
podAntiAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
- weight: 100
podAffinityTerm:
labelSelector:
matchExpressions:
- key: k8s-app
operator: In
values: ["kube-dns"]
topologyKey: kubernetes.io/hostname
tolerations:
- key: "CriticalAddonsOnly"
operator: "Exists"
nodeSelector:
beta.kubernetes.io/os: linux
kubernetes.io/os: linux
{{- with .Values.coredns.image.pullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 10 }}
Expand Down Expand Up @@ -130,14 +159,6 @@ spec:
- containerPort: 9153
name: metrics
protocol: TCP
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
livenessProbe:
httpGet:
path: /health
Expand All @@ -152,6 +173,14 @@ spec:
path: /ready
port: 8181
scheme: HTTP
securityContext:
allowPrivilegeEscalation: false
capabilities:
add:
- NET_BIND_SERVICE
drop:
- all
readOnlyRootFilesystem: true
dnsPolicy: Default
volumes:
- name: config-volume
Expand All @@ -172,6 +201,7 @@ metadata:
labels:
k8s-app: kube-dns
kubernetes.io/cluster-service: "true"
addonmanager.kubernetes.io/mode: Reconcile
kubernetes.io/name: "CoreDNS"
spec:
selector:
Expand Down
2 changes: 1 addition & 1 deletion deploy/helm/kubernetes/templates/kubedns-manifests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ metadata:
data:
{{- if .Values.coredns.enabled }}
coredns.yaml: |
{{- tpl (.Files.Get "manifests/coredns-1.8.yaml") . | nindent 4 }}
{{- tpl (.Files.Get "manifests/coredns.yaml") . | nindent 4 }}
{{- end }}
{{- end }}

0 comments on commit ed78b51

Please sign in to comment.