coredns.yaml.base 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202
  1. # __MACHINE_GENERATED_WARNING__
  2. apiVersion: v1
  3. kind: ServiceAccount
  4. metadata:
  5. name: coredns
  6. namespace: kube-system
  7. labels:
  8. kubernetes.io/cluster-service: "true"
  9. addonmanager.kubernetes.io/mode: Reconcile
  10. ---
  11. apiVersion: rbac.authorization.k8s.io/v1
  12. kind: ClusterRole
  13. metadata:
  14. labels:
  15. kubernetes.io/bootstrapping: rbac-defaults
  16. addonmanager.kubernetes.io/mode: Reconcile
  17. name: system:coredns
  18. rules:
  19. - apiGroups:
  20. - ""
  21. resources:
  22. - endpoints
  23. - services
  24. - pods
  25. - namespaces
  26. verbs:
  27. - list
  28. - watch
  29. - apiGroups:
  30. - ""
  31. resources:
  32. - nodes
  33. verbs:
  34. - get
  35. ---
  36. apiVersion: rbac.authorization.k8s.io/v1
  37. kind: ClusterRoleBinding
  38. metadata:
  39. annotations:
  40. rbac.authorization.kubernetes.io/autoupdate: "true"
  41. labels:
  42. kubernetes.io/bootstrapping: rbac-defaults
  43. addonmanager.kubernetes.io/mode: EnsureExists
  44. name: system:coredns
  45. roleRef:
  46. apiGroup: rbac.authorization.k8s.io
  47. kind: ClusterRole
  48. name: system:coredns
  49. subjects:
  50. - kind: ServiceAccount
  51. name: coredns
  52. namespace: kube-system
  53. ---
  54. apiVersion: v1
  55. kind: ConfigMap
  56. metadata:
  57. name: coredns
  58. namespace: kube-system
  59. labels:
  60. addonmanager.kubernetes.io/mode: EnsureExists
  61. data:
  62. Corefile: |
  63. .:53 {
  64. errors
  65. health {
  66. lameduck 5s
  67. }
  68. ready
  69. kubernetes __PILLAR__DNS__DOMAIN__ in-addr.arpa ip6.arpa {
  70. pods insecure
  71. fallthrough in-addr.arpa ip6.arpa
  72. ttl 30
  73. }
  74. prometheus :9153
  75. forward . /etc/resolv.conf
  76. cache 30
  77. loop
  78. reload
  79. loadbalance
  80. }
  81. ---
  82. apiVersion: apps/v1
  83. kind: Deployment
  84. metadata:
  85. name: coredns
  86. namespace: kube-system
  87. labels:
  88. k8s-app: kube-dns
  89. kubernetes.io/cluster-service: "true"
  90. addonmanager.kubernetes.io/mode: Reconcile
  91. kubernetes.io/name: "CoreDNS"
  92. spec:
  93. # replicas: not specified here:
  94. # 1. In order to make Addon Manager do not reconcile this replicas parameter.
  95. # 2. Default is 1.
  96. # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
  97. strategy:
  98. type: RollingUpdate
  99. rollingUpdate:
  100. maxUnavailable: 1
  101. selector:
  102. matchLabels:
  103. k8s-app: kube-dns
  104. template:
  105. metadata:
  106. labels:
  107. k8s-app: kube-dns
  108. annotations:
  109. seccomp.security.alpha.kubernetes.io/pod: 'runtime/default'
  110. spec:
  111. priorityClassName: system-cluster-critical
  112. serviceAccountName: coredns
  113. tolerations:
  114. - key: "CriticalAddonsOnly"
  115. operator: "Exists"
  116. nodeSelector:
  117. kubernetes.io/os: linux
  118. containers:
  119. - name: coredns
  120. image: k8s.gcr.io/coredns:1.6.5
  121. imagePullPolicy: IfNotPresent
  122. resources:
  123. limits:
  124. memory: __PILLAR__DNS__MEMORY__LIMIT__
  125. requests:
  126. cpu: 100m
  127. memory: 70Mi
  128. args: [ "-conf", "/etc/coredns/Corefile" ]
  129. volumeMounts:
  130. - name: config-volume
  131. mountPath: /etc/coredns
  132. readOnly: true
  133. ports:
  134. - containerPort: 53
  135. name: dns
  136. protocol: UDP
  137. - containerPort: 53
  138. name: dns-tcp
  139. protocol: TCP
  140. - containerPort: 9153
  141. name: metrics
  142. protocol: TCP
  143. livenessProbe:
  144. httpGet:
  145. path: /health
  146. port: 8080
  147. scheme: HTTP
  148. initialDelaySeconds: 60
  149. timeoutSeconds: 5
  150. successThreshold: 1
  151. failureThreshold: 5
  152. readinessProbe:
  153. httpGet:
  154. path: /ready
  155. port: 8181
  156. scheme: HTTP
  157. securityContext:
  158. allowPrivilegeEscalation: false
  159. capabilities:
  160. add:
  161. - NET_BIND_SERVICE
  162. drop:
  163. - all
  164. readOnlyRootFilesystem: true
  165. dnsPolicy: Default
  166. volumes:
  167. - name: config-volume
  168. configMap:
  169. name: coredns
  170. items:
  171. - key: Corefile
  172. path: Corefile
  173. ---
  174. apiVersion: v1
  175. kind: Service
  176. metadata:
  177. name: kube-dns
  178. namespace: kube-system
  179. annotations:
  180. prometheus.io/port: "9153"
  181. prometheus.io/scrape: "true"
  182. labels:
  183. k8s-app: kube-dns
  184. kubernetes.io/cluster-service: "true"
  185. addonmanager.kubernetes.io/mode: Reconcile
  186. kubernetes.io/name: "CoreDNS"
  187. spec:
  188. selector:
  189. k8s-app: kube-dns
  190. clusterIP: __PILLAR__DNS__SERVER__
  191. ports:
  192. - name: dns
  193. port: 53
  194. protocol: UDP
  195. - name: dns-tcp
  196. port: 53
  197. protocol: TCP
  198. - name: metrics
  199. port: 9153
  200. protocol: TCP