123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184 |
- # Copyright 2018 The Kubernetes Authors.
- #
- # Licensed under the Apache License, Version 2.0 (the "License");
- # you may not use this file except in compliance with the License.
- # You may obtain a copy of the License at
- #
- # http://www.apache.org/licenses/LICENSE-2.0
- #
- # Unless required by applicable law or agreed to in writing, software
- # distributed under the License is distributed on an "AS IS" BASIS,
- # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- # See the License for the specific language governing permissions and
- # limitations under the License.
- #
- apiVersion: v1
- kind: ServiceAccount
- metadata:
- name: node-local-dns
- namespace: kube-system
- labels:
- kubernetes.io/cluster-service: "true"
- addonmanager.kubernetes.io/mode: Reconcile
- ---
- apiVersion: v1
- kind: Service
- metadata:
- name: kube-dns-upstream
- namespace: kube-system
- labels:
- k8s-app: kube-dns
- kubernetes.io/cluster-service: "true"
- addonmanager.kubernetes.io/mode: Reconcile
- kubernetes.io/name: "KubeDNSUpstream"
- spec:
- ports:
- - name: dns
- port: 53
- protocol: UDP
- targetPort: 53
- - name: dns-tcp
- port: 53
- protocol: TCP
- targetPort: 53
- selector:
- k8s-app: kube-dns
- ---
- apiVersion: v1
- kind: ConfigMap
- metadata:
- name: node-local-dns
- namespace: kube-system
- labels:
- addonmanager.kubernetes.io/mode: Reconcile
- data:
- Corefile: |
- __PILLAR__DNS__DOMAIN__:53 {
- errors
- cache {
- success 9984 30
- denial 9984 5
- }
- reload
- loop
- bind __PILLAR__LOCAL__DNS__ __PILLAR__DNS__SERVER__
- forward . __PILLAR__CLUSTER__DNS__ {
- force_tcp
- }
- prometheus :9253
- health __PILLAR__LOCAL__DNS__:8080
- }
- in-addr.arpa:53 {
- errors
- cache 30
- reload
- loop
- bind __PILLAR__LOCAL__DNS__ __PILLAR__DNS__SERVER__
- forward . __PILLAR__CLUSTER__DNS__ {
- force_tcp
- }
- prometheus :9253
- }
- ip6.arpa:53 {
- errors
- cache 30
- reload
- loop
- bind __PILLAR__LOCAL__DNS__ __PILLAR__DNS__SERVER__
- forward . __PILLAR__CLUSTER__DNS__ {
- force_tcp
- }
- prometheus :9253
- }
- .:53 {
- errors
- cache 30
- reload
- loop
- bind __PILLAR__LOCAL__DNS__ __PILLAR__DNS__SERVER__
- forward . __PILLAR__UPSTREAM__SERVERS__ {
- force_tcp
- }
- prometheus :9253
- }
- ---
- apiVersion: apps/v1
- kind: DaemonSet
- metadata:
- name: node-local-dns
- namespace: kube-system
- labels:
- k8s-app: node-local-dns
- kubernetes.io/cluster-service: "true"
- addonmanager.kubernetes.io/mode: Reconcile
- spec:
- updateStrategy:
- rollingUpdate:
- maxUnavailable: 10%
- selector:
- matchLabels:
- k8s-app: node-local-dns
- template:
- metadata:
- labels:
- k8s-app: node-local-dns
- spec:
- priorityClassName: system-node-critical
- serviceAccountName: node-local-dns
- hostNetwork: true
- dnsPolicy: Default # Don't use cluster DNS.
- tolerations:
- - key: "CriticalAddonsOnly"
- operator: "Exists"
- containers:
- - name: node-cache
- image: k8s.gcr.io/k8s-dns-node-cache:1.15.7
- resources:
- requests:
- cpu: 25m
- memory: 5Mi
- args: [ "-localip", "__PILLAR__LOCAL__DNS__,__PILLAR__DNS__SERVER__", "-conf", "/etc/Corefile", "-upstreamsvc", "kube-dns-upstream" ]
- 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: __PILLAR__LOCAL__DNS__
- path: /health
- port: 8080
- initialDelaySeconds: 60
- timeoutSeconds: 5
- volumeMounts:
- - mountPath: /run/xtables.lock
- name: xtables-lock
- readOnly: false
- - name: config-volume
- mountPath: /etc/coredns
- - name: kube-dns-config
- mountPath: /etc/kube-dns
- volumes:
- - name: xtables-lock
- hostPath:
- path: /run/xtables.lock
- type: FileOrCreate
- - name: kube-dns-config
- configMap:
- name: kube-dns
- optional: true
- - name: config-volume
- configMap:
- name: node-local-dns
- items:
- - key: Corefile
- path: Corefile.base
|