|
| 1 | +# Copyright 2016 The Kubernetes Authors. |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
1 | 15 | apiVersion: v1
|
2 |
| -kind: ServiceAccount |
| 16 | +kind: Service |
3 | 17 | metadata:
|
4 | 18 | name: kube-dns
|
5 | 19 | namespace: kube-system
|
| 20 | + labels: |
| 21 | + k8s-app: kube-dns |
| 22 | + kubernetes.io/cluster-service: "true" |
| 23 | + addonmanager.kubernetes.io/mode: Reconcile |
| 24 | + kubernetes.io/name: "KubeDNS" |
| 25 | +spec: |
| 26 | + selector: |
| 27 | + k8s-app: kube-dns |
| 28 | + clusterIP: 10.32.0.10 |
| 29 | + ports: |
| 30 | + - name: dns |
| 31 | + port: 53 |
| 32 | + protocol: UDP |
| 33 | + - name: dns-tcp |
| 34 | + port: 53 |
| 35 | + protocol: TCP |
6 | 36 | ---
|
7 | 37 | apiVersion: v1
|
8 |
| -kind: ConfigMap |
| 38 | +kind: ServiceAccount |
9 | 39 | metadata:
|
10 | 40 | name: kube-dns
|
11 | 41 | namespace: kube-system
|
12 | 42 | labels:
|
13 |
| - addonmanager.kubernetes.io/mode: EnsureExists |
| 43 | + kubernetes.io/cluster-service: "true" |
| 44 | + addonmanager.kubernetes.io/mode: Reconcile |
14 | 45 | ---
|
15 | 46 | apiVersion: v1
|
16 |
| -kind: Service |
| 47 | +kind: ConfigMap |
17 | 48 | metadata:
|
18 | 49 | name: kube-dns
|
19 | 50 | namespace: kube-system
|
20 | 51 | labels:
|
21 |
| - k8s-app: kube-dns |
22 |
| - kubernetes.io/cluster-service: "true" |
23 |
| - kubernetes.io/name: "KubeDNS" |
24 |
| -spec: |
25 |
| - clusterIP: 10.32.0.10 |
26 |
| - ports: |
27 |
| - - name: dns |
28 |
| - port: 53 |
29 |
| - protocol: UDP |
30 |
| - targetPort: 53 |
31 |
| - - name: dns-tcp |
32 |
| - port: 53 |
33 |
| - protocol: TCP |
34 |
| - targetPort: 53 |
35 |
| - selector: |
36 |
| - k8s-app: kube-dns |
37 |
| - sessionAffinity: None |
38 |
| - type: ClusterIP |
| 52 | + addonmanager.kubernetes.io/mode: EnsureExists |
39 | 53 | ---
|
40 | 54 | apiVersion: extensions/v1beta1
|
41 | 55 | kind: Deployment
|
42 | 56 | metadata:
|
| 57 | + name: kube-dns |
| 58 | + namespace: kube-system |
43 | 59 | labels:
|
44 | 60 | k8s-app: kube-dns
|
45 | 61 | kubernetes.io/cluster-service: "true"
|
46 |
| - name: kube-dns |
47 |
| - namespace: kube-system |
| 62 | + addonmanager.kubernetes.io/mode: Reconcile |
48 | 63 | spec:
|
49 |
| - replicas: 2 |
50 |
| - selector: |
51 |
| - matchLabels: |
52 |
| - k8s-app: kube-dns |
| 64 | + # replicas: not specified here: |
| 65 | + # 1. In order to make Addon Manager do not reconcile this replicas parameter. |
| 66 | + # 2. Default is 1. |
| 67 | + # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on. |
53 | 68 | strategy:
|
54 | 69 | rollingUpdate:
|
55 | 70 | maxSurge: 10%
|
56 | 71 | maxUnavailable: 0
|
57 |
| - type: RollingUpdate |
| 72 | + selector: |
| 73 | + matchLabels: |
| 74 | + k8s-app: kube-dns |
58 | 75 | template:
|
59 | 76 | metadata:
|
60 |
| - annotations: |
61 |
| - scheduler.alpha.kubernetes.io/critical-pod: "" |
62 |
| - creationTimestamp: null |
63 | 77 | labels:
|
64 | 78 | k8s-app: kube-dns
|
| 79 | + annotations: |
| 80 | + scheduler.alpha.kubernetes.io/critical-pod: '' |
65 | 81 | spec:
|
66 |
| - containers: |
67 |
| - - name: kubedns |
68 |
| - image: gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.4 |
69 |
| - env: |
70 |
| - - name: PROMETHEUS_PORT |
71 |
| - value: "10055" |
72 |
| - args: |
73 |
| - - --domain=cluster.local. |
74 |
| - - --dns-port=10053 |
75 |
| - - --config-dir=/kube-dns-config |
76 |
| - - --v=2 |
77 |
| - livenessProbe: |
78 |
| - failureThreshold: 5 |
79 |
| - httpGet: |
80 |
| - path: /healthcheck/kubedns |
81 |
| - port: 10054 |
82 |
| - scheme: HTTP |
83 |
| - initialDelaySeconds: 60 |
84 |
| - periodSeconds: 10 |
85 |
| - successThreshold: 1 |
86 |
| - timeoutSeconds: 5 |
87 |
| - ports: |
88 |
| - - name: dns-local |
89 |
| - containerPort: 10053 |
90 |
| - protocol: UDP |
91 |
| - - name: dns-tcp-local |
92 |
| - containerPort: 10053 |
93 |
| - protocol: TCP |
94 |
| - - name: metrics |
95 |
| - containerPort: 10055 |
96 |
| - protocol: TCP |
97 |
| - readinessProbe: |
98 |
| - failureThreshold: 3 |
99 |
| - httpGet: |
100 |
| - path: /readiness |
101 |
| - port: 8081 |
102 |
| - scheme: HTTP |
103 |
| - initialDelaySeconds: 3 |
104 |
| - periodSeconds: 10 |
105 |
| - successThreshold: 1 |
106 |
| - timeoutSeconds: 5 |
107 |
| - resources: |
108 |
| - limits: |
109 |
| - memory: 170Mi |
110 |
| - requests: |
111 |
| - cpu: 100m |
112 |
| - memory: 70Mi |
113 |
| - volumeMounts: |
114 |
| - - name: kube-dns-config |
115 |
| - mountPath: /kube-dns-config |
116 |
| - - name: dnsmasq |
117 |
| - image: gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.4 |
118 |
| - args: |
119 |
| - - -v=2 |
120 |
| - - -logtostderr |
121 |
| - - -configDir=/etc/k8s/dns/dnsmasq-nanny |
122 |
| - - -restartDnsmasq=true |
123 |
| - - -- |
124 |
| - - -k |
125 |
| - - --cache-size=1000 |
126 |
| - - --log-facility=- |
127 |
| - - --server=/cluster.local/127.0.0.1#10053 |
128 |
| - - --server=/in-addr.arpa/127.0.0.1#10053 |
129 |
| - - --server=/ip6.arpa/127.0.0.1#10053 |
130 |
| - livenessProbe: |
131 |
| - failureThreshold: 5 |
132 |
| - httpGet: |
133 |
| - path: /healthcheck/dnsmasq |
134 |
| - port: 10054 |
135 |
| - scheme: HTTP |
136 |
| - initialDelaySeconds: 60 |
137 |
| - periodSeconds: 10 |
138 |
| - successThreshold: 1 |
139 |
| - timeoutSeconds: 5 |
140 |
| - ports: |
141 |
| - - name: dns |
142 |
| - containerPort: 53 |
143 |
| - protocol: UDP |
144 |
| - - name: dns-tcp |
145 |
| - containerPort: 53 |
146 |
| - protocol: TCP |
147 |
| - resources: |
148 |
| - requests: |
149 |
| - cpu: 150m |
150 |
| - memory: 20Mi |
151 |
| - volumeMounts: |
152 |
| - - name: kube-dns-config |
153 |
| - mountPath: /etc/k8s/dns/dnsmasq-nanny |
154 |
| - - name: sidecar |
155 |
| - image: gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.4 |
156 |
| - args: |
157 |
| - - --v=2 |
158 |
| - - --logtostderr |
159 |
| - - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.cluster.local,5,A |
160 |
| - - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.cluster.local,5,A |
161 |
| - livenessProbe: |
162 |
| - failureThreshold: 5 |
163 |
| - httpGet: |
164 |
| - path: /metrics |
165 |
| - port: 10054 |
166 |
| - scheme: HTTP |
167 |
| - initialDelaySeconds: 60 |
168 |
| - periodSeconds: 10 |
169 |
| - successThreshold: 1 |
170 |
| - timeoutSeconds: 5 |
171 |
| - ports: |
172 |
| - - name: metrics |
173 |
| - containerPort: 10054 |
174 |
| - protocol: TCP |
175 |
| - resources: |
176 |
| - requests: |
177 |
| - cpu: 10m |
178 |
| - memory: 20Mi |
179 |
| - dnsPolicy: Default |
180 |
| - restartPolicy: Always |
181 |
| - serviceAccount: kube-dns |
182 |
| - serviceAccountName: kube-dns |
183 |
| - terminationGracePeriodSeconds: 30 |
184 | 82 | tolerations:
|
185 |
| - - key: CriticalAddonsOnly |
186 |
| - operator: Exists |
| 83 | + - key: "CriticalAddonsOnly" |
| 84 | + operator: "Exists" |
187 | 85 | volumes:
|
| 86 | + - name: kube-dns-config |
| 87 | + configMap: |
| 88 | + name: kube-dns |
| 89 | + optional: true |
| 90 | + containers: |
| 91 | + - name: kubedns |
| 92 | + image: gcr.io/google_containers/k8s-dns-kube-dns-amd64:1.14.7 |
| 93 | + resources: |
| 94 | + # TODO: Set memory limits when we've profiled the container for large |
| 95 | + # clusters, then set request = limit to keep this container in |
| 96 | + # guaranteed class. Currently, this container falls into the |
| 97 | + # "burstable" category so the kubelet doesn't backoff from restarting it. |
| 98 | + limits: |
| 99 | + memory: 170Mi |
| 100 | + requests: |
| 101 | + cpu: 100m |
| 102 | + memory: 70Mi |
| 103 | + livenessProbe: |
| 104 | + httpGet: |
| 105 | + path: /healthcheck/kubedns |
| 106 | + port: 10054 |
| 107 | + scheme: HTTP |
| 108 | + initialDelaySeconds: 60 |
| 109 | + timeoutSeconds: 5 |
| 110 | + successThreshold: 1 |
| 111 | + failureThreshold: 5 |
| 112 | + readinessProbe: |
| 113 | + httpGet: |
| 114 | + path: /readiness |
| 115 | + port: 8081 |
| 116 | + scheme: HTTP |
| 117 | + # we poll on pod startup for the Kubernetes master service and |
| 118 | + # only setup the /readiness HTTP server once that's available. |
| 119 | + initialDelaySeconds: 3 |
| 120 | + timeoutSeconds: 5 |
| 121 | + args: |
| 122 | + - --domain=cluster.local. |
| 123 | + - --dns-port=10053 |
| 124 | + - --config-dir=/kube-dns-config |
| 125 | + - --v=2 |
| 126 | + env: |
| 127 | + - name: PROMETHEUS_PORT |
| 128 | + value: "10055" |
| 129 | + ports: |
| 130 | + - containerPort: 10053 |
| 131 | + name: dns-local |
| 132 | + protocol: UDP |
| 133 | + - containerPort: 10053 |
| 134 | + name: dns-tcp-local |
| 135 | + protocol: TCP |
| 136 | + - containerPort: 10055 |
| 137 | + name: metrics |
| 138 | + protocol: TCP |
| 139 | + volumeMounts: |
188 | 140 | - name: kube-dns-config
|
189 |
| - configMap: |
190 |
| - defaultMode: 420 |
191 |
| - name: kube-dns |
192 |
| - optional: true |
| 141 | + mountPath: /kube-dns-config |
| 142 | + - name: dnsmasq |
| 143 | + image: gcr.io/google_containers/k8s-dns-dnsmasq-nanny-amd64:1.14.7 |
| 144 | + livenessProbe: |
| 145 | + httpGet: |
| 146 | + path: /healthcheck/dnsmasq |
| 147 | + port: 10054 |
| 148 | + scheme: HTTP |
| 149 | + initialDelaySeconds: 60 |
| 150 | + timeoutSeconds: 5 |
| 151 | + successThreshold: 1 |
| 152 | + failureThreshold: 5 |
| 153 | + args: |
| 154 | + - -v=2 |
| 155 | + - -logtostderr |
| 156 | + - -configDir=/etc/k8s/dns/dnsmasq-nanny |
| 157 | + - -restartDnsmasq=true |
| 158 | + - -- |
| 159 | + - -k |
| 160 | + - --cache-size=1000 |
| 161 | + - --no-negcache |
| 162 | + - --log-facility=- |
| 163 | + - --server=/cluster.local/127.0.0.1#10053 |
| 164 | + - --server=/in-addr.arpa/127.0.0.1#10053 |
| 165 | + - --server=/ip6.arpa/127.0.0.1#10053 |
| 166 | + ports: |
| 167 | + - containerPort: 53 |
| 168 | + name: dns |
| 169 | + protocol: UDP |
| 170 | + - containerPort: 53 |
| 171 | + name: dns-tcp |
| 172 | + protocol: TCP |
| 173 | + # see: https://github.com/kubernetes/kubernetes/issues/29055 for details |
| 174 | + resources: |
| 175 | + requests: |
| 176 | + cpu: 150m |
| 177 | + memory: 20Mi |
| 178 | + volumeMounts: |
| 179 | + - name: kube-dns-config |
| 180 | + mountPath: /etc/k8s/dns/dnsmasq-nanny |
| 181 | + - name: sidecar |
| 182 | + image: gcr.io/google_containers/k8s-dns-sidecar-amd64:1.14.7 |
| 183 | + livenessProbe: |
| 184 | + httpGet: |
| 185 | + path: /metrics |
| 186 | + port: 10054 |
| 187 | + scheme: HTTP |
| 188 | + initialDelaySeconds: 60 |
| 189 | + timeoutSeconds: 5 |
| 190 | + successThreshold: 1 |
| 191 | + failureThreshold: 5 |
| 192 | + args: |
| 193 | + - --v=2 |
| 194 | + - --logtostderr |
| 195 | + - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.cluster.local,5,SRV |
| 196 | + - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.cluster.local,5,SRV |
| 197 | + ports: |
| 198 | + - containerPort: 10054 |
| 199 | + name: metrics |
| 200 | + protocol: TCP |
| 201 | + resources: |
| 202 | + requests: |
| 203 | + memory: 20Mi |
| 204 | + cpu: 10m |
| 205 | + dnsPolicy: Default # Don't use cluster DNS. |
| 206 | + serviceAccountName: kube-dns |
0 commit comments