kube-dns.yaml.sed 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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. # Warning: This is a file generated from the base underscore template file: kube-dns.yaml.base
  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: $DNS_SERVER_IP
  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. seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
  83. prometheus.io/port: "10054"
  84. prometheus.io/scrape: "true"
  85. spec:
  86. priorityClassName: system-cluster-critical
  87. securityContext:
  88. supplementalGroups: [ 65534 ]
  89. fsGroup: 65534
  90. tolerations:
  91. - key: "CriticalAddonsOnly"
  92. operator: "Exists"
  93. nodeSelector:
  94. kubernetes.io/os: linux
  95. volumes:
  96. - name: kube-dns-config
  97. configMap:
  98. name: kube-dns
  99. optional: true
  100. nodeSelector:
  101. kubernetes.io/os: linux
  102. containers:
  103. - name: kubedns
  104. image: k8s.gcr.io/k8s-dns-kube-dns:1.14.13
  105. resources:
  106. # TODO: Set memory limits when we've profiled the container for large
  107. # clusters, then set request = limit to keep this container in
  108. # guaranteed class. Currently, this container falls into the
  109. # "burstable" category so the kubelet doesn't backoff from restarting it.
  110. limits:
  111. memory: $DNS_MEMORY_LIMIT
  112. requests:
  113. cpu: 100m
  114. memory: 70Mi
  115. livenessProbe:
  116. httpGet:
  117. path: /healthcheck/kubedns
  118. port: 10054
  119. scheme: HTTP
  120. initialDelaySeconds: 60
  121. timeoutSeconds: 5
  122. successThreshold: 1
  123. failureThreshold: 5
  124. readinessProbe:
  125. httpGet:
  126. path: /readiness
  127. port: 8081
  128. scheme: HTTP
  129. # we poll on pod startup for the Kubernetes master service and
  130. # only setup the /readiness HTTP server once that's available.
  131. initialDelaySeconds: 3
  132. timeoutSeconds: 5
  133. args:
  134. - --domain=$DNS_DOMAIN.
  135. - --dns-port=10053
  136. - --config-dir=/kube-dns-config
  137. - --v=2
  138. env:
  139. - name: PROMETHEUS_PORT
  140. value: "10055"
  141. ports:
  142. - containerPort: 10053
  143. name: dns-local
  144. protocol: UDP
  145. - containerPort: 10053
  146. name: dns-tcp-local
  147. protocol: TCP
  148. - containerPort: 10055
  149. name: metrics
  150. protocol: TCP
  151. volumeMounts:
  152. - name: kube-dns-config
  153. mountPath: /kube-dns-config
  154. securityContext:
  155. allowPrivilegeEscalation: false
  156. readOnlyRootFilesystem: true
  157. runAsUser: 1001
  158. runAsGroup: 1001
  159. - name: dnsmasq
  160. image: k8s.gcr.io/k8s-dns-dnsmasq-nanny:1.14.13
  161. livenessProbe:
  162. httpGet:
  163. path: /healthcheck/dnsmasq
  164. port: 10054
  165. scheme: HTTP
  166. initialDelaySeconds: 60
  167. timeoutSeconds: 5
  168. successThreshold: 1
  169. failureThreshold: 5
  170. args:
  171. - -v=2
  172. - -logtostderr
  173. - -configDir=/etc/k8s/dns/dnsmasq-nanny
  174. - -restartDnsmasq=true
  175. - --
  176. - -k
  177. - --cache-size=1000
  178. - --no-negcache
  179. - --dns-loop-detect
  180. - --log-facility=-
  181. - --server=/$DNS_DOMAIN/127.0.0.1#10053
  182. - --server=/in-addr.arpa/127.0.0.1#10053
  183. - --server=/ip6.arpa/127.0.0.1#10053
  184. ports:
  185. - containerPort: 53
  186. name: dns
  187. protocol: UDP
  188. - containerPort: 53
  189. name: dns-tcp
  190. protocol: TCP
  191. # see: https://github.com/kubernetes/kubernetes/issues/29055 for details
  192. resources:
  193. requests:
  194. cpu: 150m
  195. memory: 20Mi
  196. volumeMounts:
  197. - name: kube-dns-config
  198. mountPath: /etc/k8s/dns/dnsmasq-nanny
  199. securityContext:
  200. capabilities:
  201. drop:
  202. - all
  203. add:
  204. - NET_BIND_SERVICE
  205. - SETGID
  206. - name: sidecar
  207. image: k8s.gcr.io/k8s-dns-sidecar:1.14.13
  208. livenessProbe:
  209. httpGet:
  210. path: /metrics
  211. port: 10054
  212. scheme: HTTP
  213. initialDelaySeconds: 60
  214. timeoutSeconds: 5
  215. successThreshold: 1
  216. failureThreshold: 5
  217. args:
  218. - --v=2
  219. - --logtostderr
  220. - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.$DNS_DOMAIN,5,SRV
  221. - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.$DNS_DOMAIN,5,SRV
  222. ports:
  223. - containerPort: 10054
  224. name: metrics
  225. protocol: TCP
  226. resources:
  227. requests:
  228. memory: 20Mi
  229. cpu: 10m
  230. securityContext:
  231. allowPrivilegeEscalation: false
  232. readOnlyRootFilesystem: true
  233. runAsUser: 1001
  234. runAsGroup: 1001
  235. dnsPolicy: Default # Don't use cluster DNS.
  236. serviceAccountName: kube-dns