kube-dns.yaml.base 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220
  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. # Should keep target in cluster/addons/dns-horizontal-autoscaler/dns-horizontal-autoscaler.yaml
  15. # in sync with this file.
  16. # __MACHINE_GENERATED_WARNING__
  17. apiVersion: v1
  18. kind: Service
  19. metadata:
  20. name: kube-dns
  21. namespace: kube-system
  22. labels:
  23. k8s-app: kube-dns
  24. kubernetes.io/cluster-service: "true"
  25. addonmanager.kubernetes.io/mode: Reconcile
  26. kubernetes.io/name: "KubeDNS"
  27. spec:
  28. selector:
  29. k8s-app: kube-dns
  30. clusterIP: __PILLAR__DNS__SERVER__
  31. ports:
  32. - name: dns
  33. port: 53
  34. protocol: UDP
  35. - name: dns-tcp
  36. port: 53
  37. protocol: TCP
  38. ---
  39. apiVersion: v1
  40. kind: ServiceAccount
  41. metadata:
  42. name: kube-dns
  43. namespace: kube-system
  44. labels:
  45. kubernetes.io/cluster-service: "true"
  46. addonmanager.kubernetes.io/mode: Reconcile
  47. ---
  48. apiVersion: v1
  49. kind: ConfigMap
  50. metadata:
  51. name: kube-dns
  52. namespace: kube-system
  53. labels:
  54. addonmanager.kubernetes.io/mode: EnsureExists
  55. ---
  56. apiVersion: apps/v1
  57. kind: Deployment
  58. metadata:
  59. name: kube-dns
  60. namespace: kube-system
  61. labels:
  62. k8s-app: kube-dns
  63. kubernetes.io/cluster-service: "true"
  64. addonmanager.kubernetes.io/mode: Reconcile
  65. spec:
  66. # replicas: not specified here:
  67. # 1. In order to make Addon Manager do not reconcile this replicas parameter.
  68. # 2. Default is 1.
  69. # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
  70. strategy:
  71. rollingUpdate:
  72. maxSurge: 10%
  73. maxUnavailable: 0
  74. selector:
  75. matchLabels:
  76. k8s-app: kube-dns
  77. template:
  78. metadata:
  79. labels:
  80. k8s-app: kube-dns
  81. annotations:
  82. scheduler.alpha.kubernetes.io/critical-pod: ''
  83. seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
  84. prometheus.io/port: "10054"
  85. prometheus.io/scrape: "true"
  86. spec:
  87. priorityClassName: system-cluster-critical
  88. securityContext:
  89. supplementalGroups: [ 65534 ]
  90. fsGroup: 65534
  91. tolerations:
  92. - key: "CriticalAddonsOnly"
  93. operator: "Exists"
  94. volumes:
  95. - name: kube-dns-config
  96. configMap:
  97. name: kube-dns
  98. optional: true
  99. containers:
  100. - name: kubedns
  101. image: k8s.gcr.io/k8s-dns-kube-dns:1.14.13
  102. resources:
  103. # TODO: Set memory limits when we've profiled the container for large
  104. # clusters, then set request = limit to keep this container in
  105. # guaranteed class. Currently, this container falls into the
  106. # "burstable" category so the kubelet doesn't backoff from restarting it.
  107. limits:
  108. memory: __PILLAR__DNS__MEMORY__LIMIT__
  109. requests:
  110. cpu: 100m
  111. memory: 70Mi
  112. livenessProbe:
  113. httpGet:
  114. path: /healthcheck/kubedns
  115. port: 10054
  116. scheme: HTTP
  117. initialDelaySeconds: 60
  118. timeoutSeconds: 5
  119. successThreshold: 1
  120. failureThreshold: 5
  121. readinessProbe:
  122. httpGet:
  123. path: /readiness
  124. port: 8081
  125. scheme: HTTP
  126. # we poll on pod startup for the Kubernetes master service and
  127. # only setup the /readiness HTTP server once that's available.
  128. initialDelaySeconds: 3
  129. timeoutSeconds: 5
  130. args:
  131. - --domain=__PILLAR__DNS__DOMAIN__.
  132. - --dns-port=10053
  133. - --config-dir=/kube-dns-config
  134. - --v=2
  135. env:
  136. - name: PROMETHEUS_PORT
  137. value: "10055"
  138. ports:
  139. - containerPort: 10053
  140. name: dns-local
  141. protocol: UDP
  142. - containerPort: 10053
  143. name: dns-tcp-local
  144. protocol: TCP
  145. - containerPort: 10055
  146. name: metrics
  147. protocol: TCP
  148. volumeMounts:
  149. - name: kube-dns-config
  150. mountPath: /kube-dns-config
  151. - name: dnsmasq
  152. image: k8s.gcr.io/k8s-dns-dnsmasq-nanny:1.14.13
  153. livenessProbe:
  154. httpGet:
  155. path: /healthcheck/dnsmasq
  156. port: 10054
  157. scheme: HTTP
  158. initialDelaySeconds: 60
  159. timeoutSeconds: 5
  160. successThreshold: 1
  161. failureThreshold: 5
  162. args:
  163. - -v=2
  164. - -logtostderr
  165. - -configDir=/etc/k8s/dns/dnsmasq-nanny
  166. - -restartDnsmasq=true
  167. - --
  168. - -k
  169. - --cache-size=1000
  170. - --no-negcache
  171. - --dns-loop-detect
  172. - --log-facility=-
  173. - --server=/__PILLAR__DNS__DOMAIN__/127.0.0.1#10053
  174. - --server=/in-addr.arpa/127.0.0.1#10053
  175. - --server=/ip6.arpa/127.0.0.1#10053
  176. ports:
  177. - containerPort: 53
  178. name: dns
  179. protocol: UDP
  180. - containerPort: 53
  181. name: dns-tcp
  182. protocol: TCP
  183. # see: https://github.com/kubernetes/kubernetes/issues/29055 for details
  184. resources:
  185. requests:
  186. cpu: 150m
  187. memory: 20Mi
  188. volumeMounts:
  189. - name: kube-dns-config
  190. mountPath: /etc/k8s/dns/dnsmasq-nanny
  191. - name: sidecar
  192. image: k8s.gcr.io/k8s-dns-sidecar:1.14.13
  193. livenessProbe:
  194. httpGet:
  195. path: /metrics
  196. port: 10054
  197. scheme: HTTP
  198. initialDelaySeconds: 60
  199. timeoutSeconds: 5
  200. successThreshold: 1
  201. failureThreshold: 5
  202. args:
  203. - --v=2
  204. - --logtostderr
  205. - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.__PILLAR__DNS__DOMAIN__,5,SRV
  206. - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.__PILLAR__DNS__DOMAIN__,5,SRV
  207. ports:
  208. - containerPort: 10054
  209. name: metrics
  210. protocol: TCP
  211. resources:
  212. requests:
  213. memory: 20Mi
  214. cpu: 10m
  215. dnsPolicy: Default # Don't use cluster DNS.
  216. serviceAccountName: kube-dns