kube_dns_template.yaml 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. apiVersion: v1
  2. kind: Service
  3. metadata:
  4. name: kube-dns
  5. namespace: kubemark
  6. labels:
  7. k8s-app: kube-dns
  8. kubernetes.io/cluster-service: "true"
  9. addonmanager.kubernetes.io/mode: Reconcile
  10. kubernetes.io/name: "KubeDNS"
  11. spec:
  12. selector:
  13. k8s-app: kube-dns
  14. ports:
  15. - name: dns
  16. port: 53
  17. protocol: UDP
  18. - name: dns-tcp
  19. port: 53
  20. protocol: TCP
  21. ---
  22. apiVersion: v1
  23. kind: ServiceAccount
  24. metadata:
  25. name: kube-dns
  26. namespace: kubemark
  27. labels:
  28. kubernetes.io/cluster-service: "true"
  29. addonmanager.kubernetes.io/mode: Reconcile
  30. ---
  31. apiVersion: v1
  32. kind: ConfigMap
  33. metadata:
  34. name: kube-dns
  35. namespace: kubemark
  36. labels:
  37. addonmanager.kubernetes.io/mode: EnsureExists
  38. ---
  39. apiVersion: apps/v1
  40. kind: Deployment
  41. metadata:
  42. name: kube-dns
  43. namespace: kubemark
  44. labels:
  45. k8s-app: kube-dns
  46. kubernetes.io/cluster-service: "true"
  47. addonmanager.kubernetes.io/mode: Reconcile
  48. spec:
  49. strategy:
  50. rollingUpdate:
  51. maxSurge: 10%
  52. maxUnavailable: 0
  53. selector:
  54. matchLabels:
  55. k8s-app: kube-dns
  56. template:
  57. metadata:
  58. labels:
  59. k8s-app: kube-dns
  60. annotations:
  61. scheduler.alpha.kubernetes.io/critical-pod: ''
  62. spec:
  63. tolerations:
  64. - key: "CriticalAddonsOnly"
  65. operator: "Exists"
  66. volumes:
  67. - name: kube-dns-config
  68. configMap:
  69. name: kube-dns
  70. optional: true
  71. - name: secret-volume
  72. secret:
  73. secretName: kubeconfig
  74. containers:
  75. - name: kubedns
  76. image: k8s.gcr.io/k8s-dns-kube-dns-amd64:1.14.9
  77. resources:
  78. limits:
  79. memory: 170Mi
  80. requests:
  81. cpu: 100m
  82. memory: 70Mi
  83. livenessProbe:
  84. httpGet:
  85. path: /healthcheck/kubedns
  86. port: 10054
  87. scheme: HTTP
  88. initialDelaySeconds: 60
  89. timeoutSeconds: 5
  90. successThreshold: 1
  91. failureThreshold: 5
  92. readinessProbe:
  93. httpGet:
  94. path: /readiness
  95. port: 8081
  96. scheme: HTTP
  97. initialDelaySeconds: 3
  98. timeoutSeconds: 5
  99. args:
  100. - --domain={{dns_domain}}.
  101. - --dns-port=10053
  102. - --config-dir=/kube-dns-config
  103. - --kubecfg-file=/etc/secret-volume/dns.kubeconfig
  104. - --v=2
  105. env:
  106. - name: PROMETHEUS_PORT
  107. value: "10055"
  108. ports:
  109. - containerPort: 10053
  110. name: dns-local
  111. protocol: UDP
  112. - containerPort: 10053
  113. name: dns-tcp-local
  114. protocol: TCP
  115. - containerPort: 10055
  116. name: metrics
  117. protocol: TCP
  118. volumeMounts:
  119. - name: kube-dns-config
  120. mountPath: /kube-dns-config
  121. - name: secret-volume
  122. mountPath: /etc/secret-volume
  123. - name: dnsmasq
  124. image: k8s.gcr.io/k8s-dns-dnsmasq-nanny-amd64:1.14.9
  125. livenessProbe:
  126. httpGet:
  127. path: /healthcheck/dnsmasq
  128. port: 10054
  129. scheme: HTTP
  130. initialDelaySeconds: 60
  131. timeoutSeconds: 5
  132. successThreshold: 1
  133. failureThreshold: 5
  134. args:
  135. - -v=2
  136. - -logtostderr
  137. - -configDir=/etc/k8s/dns/dnsmasq-nanny
  138. - -restartDnsmasq=true
  139. - --
  140. - -k
  141. - --cache-size=1000
  142. - --no-negcache
  143. - --dns-loop-detect
  144. - --log-facility=-
  145. - --server=/{{dns_domain}}/127.0.0.1#10053
  146. - --server=/in-addr.arpa/127.0.0.1#10053
  147. - --server=/ip6.arpa/127.0.0.1#10053
  148. ports:
  149. - containerPort: 53
  150. name: dns
  151. protocol: UDP
  152. - containerPort: 53
  153. name: dns-tcp
  154. protocol: TCP
  155. # see: https://github.com/kubernetes/kubernetes/issues/29055 for details
  156. resources:
  157. requests:
  158. cpu: 150m
  159. memory: 20Mi
  160. volumeMounts:
  161. - name: kube-dns-config
  162. mountPath: /etc/k8s/dns/dnsmasq-nanny
  163. - name: sidecar
  164. image: k8s.gcr.io/k8s-dns-sidecar-amd64:1.14.9
  165. livenessProbe:
  166. httpGet:
  167. path: /metrics
  168. port: 10054
  169. scheme: HTTP
  170. initialDelaySeconds: 60
  171. timeoutSeconds: 5
  172. successThreshold: 1
  173. failureThreshold: 5
  174. args:
  175. - --v=2
  176. - --logtostderr
  177. - --probe=kubedns,127.0.0.1:10053,kubernetes.default.svc.{{dns_domain}},5,SRV
  178. - --probe=dnsmasq,127.0.0.1:53,kubernetes.default.svc.{{dns_domain}},5,SRV
  179. ports:
  180. - containerPort: 10054
  181. name: metrics
  182. protocol: TCP
  183. resources:
  184. requests:
  185. memory: 20Mi
  186. cpu: 10m
  187. dnsPolicy: Default # Don't use cluster DNS.
  188. serviceAccountName: kube-dns