coredns.yaml.sed 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. # Warning: This is a file generated from the base underscore template file: coredns.yaml.base
  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. kubernetes $DNS_DOMAIN in-addr.arpa ip6.arpa {
  67. pods insecure
  68. upstream
  69. fallthrough in-addr.arpa ip6.arpa
  70. ttl 30
  71. }
  72. prometheus :9153
  73. forward . /etc/resolv.conf
  74. cache 30
  75. loop
  76. reload
  77. loadbalance
  78. }
  79. ---
  80. apiVersion: apps/v1
  81. kind: Deployment
  82. metadata:
  83. name: coredns
  84. namespace: kube-system
  85. labels:
  86. k8s-app: kube-dns
  87. kubernetes.io/cluster-service: "true"
  88. addonmanager.kubernetes.io/mode: Reconcile
  89. kubernetes.io/name: "CoreDNS"
  90. spec:
  91. # replicas: not specified here:
  92. # 1. In order to make Addon Manager do not reconcile this replicas parameter.
  93. # 2. Default is 1.
  94. # 3. Will be tuned in real time if DNS horizontal auto-scaling is turned on.
  95. strategy:
  96. type: RollingUpdate
  97. rollingUpdate:
  98. maxUnavailable: 1
  99. selector:
  100. matchLabels:
  101. k8s-app: kube-dns
  102. template:
  103. metadata:
  104. labels:
  105. k8s-app: kube-dns
  106. annotations:
  107. seccomp.security.alpha.kubernetes.io/pod: 'docker/default'
  108. spec:
  109. priorityClassName: system-cluster-critical
  110. serviceAccountName: coredns
  111. tolerations:
  112. - key: "CriticalAddonsOnly"
  113. operator: "Exists"
  114. nodeSelector:
  115. beta.kubernetes.io/os: linux
  116. containers:
  117. - name: coredns
  118. image: k8s.gcr.io/coredns:1.3.1
  119. imagePullPolicy: IfNotPresent
  120. resources:
  121. limits:
  122. memory: $DNS_MEMORY_LIMIT
  123. requests:
  124. cpu: 100m
  125. memory: 70Mi
  126. args: [ "-conf", "/etc/coredns/Corefile" ]
  127. volumeMounts:
  128. - name: config-volume
  129. mountPath: /etc/coredns
  130. readOnly: true
  131. ports:
  132. - containerPort: 53
  133. name: dns
  134. protocol: UDP
  135. - containerPort: 53
  136. name: dns-tcp
  137. protocol: TCP
  138. - containerPort: 9153
  139. name: metrics
  140. protocol: TCP
  141. livenessProbe:
  142. httpGet:
  143. path: /health
  144. port: 8080
  145. scheme: HTTP
  146. initialDelaySeconds: 60
  147. timeoutSeconds: 5
  148. successThreshold: 1
  149. failureThreshold: 5
  150. readinessProbe:
  151. httpGet:
  152. path: /health
  153. port: 8080
  154. scheme: HTTP
  155. securityContext:
  156. allowPrivilegeEscalation: false
  157. capabilities:
  158. add:
  159. - NET_BIND_SERVICE
  160. drop:
  161. - all
  162. readOnlyRootFilesystem: true
  163. dnsPolicy: Default
  164. volumes:
  165. - name: config-volume
  166. configMap:
  167. name: coredns
  168. items:
  169. - key: Corefile
  170. path: Corefile
  171. ---
  172. apiVersion: v1
  173. kind: Service
  174. metadata:
  175. name: kube-dns
  176. namespace: kube-system
  177. annotations:
  178. prometheus.io/port: "9153"
  179. prometheus.io/scrape: "true"
  180. labels:
  181. k8s-app: kube-dns
  182. kubernetes.io/cluster-service: "true"
  183. addonmanager.kubernetes.io/mode: Reconcile
  184. kubernetes.io/name: "CoreDNS"
  185. spec:
  186. selector:
  187. k8s-app: kube-dns
  188. clusterIP: $DNS_SERVER_IP
  189. ports:
  190. - name: dns
  191. port: 53
  192. protocol: UDP
  193. - name: dns-tcp
  194. port: 53
  195. protocol: TCP
  196. - name: metrics
  197. port: 9153
  198. protocol: TCP