You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

72 lines
2.0 KiB

  1. apiVersion: apps/v1
  2. kind: DaemonSet
  3. metadata:
  4. name: nodelocaldns
  5. namespace: kube-system
  6. labels:
  7. k8s-app: kube-dns
  8. kubernetes.io/cluster-service: "true"
  9. addonmanager.kubernetes.io/mode: Reconcile
  10. spec:
  11. selector:
  12. matchLabels:
  13. k8s-app: nodelocaldns
  14. template:
  15. metadata:
  16. labels:
  17. k8s-app: nodelocaldns
  18. spec:
  19. {% if kube_version is version('v1.11.1', '>=') %}
  20. priorityClassName: system-cluster-critical
  21. {% endif %}
  22. serviceAccountName: nodelocaldns
  23. hostNetwork: true
  24. dnsPolicy: Default # Don't use cluster DNS.
  25. tolerations:
  26. - key: node-role.kubernetes.io/master
  27. effect: NoSchedule
  28. - key: "CriticalAddonsOnly"
  29. operator: "Exists"
  30. containers:
  31. - name: node-cache
  32. image: "{{ nodelocaldns_image_repo }}:{{ nodelocaldns_image_tag }}"
  33. resources:
  34. limits:
  35. memory: {{ nodelocaldns_memory_limit }}
  36. requests:
  37. cpu: {{ nodelocaldns_cpu_requests }}
  38. memory: {{ nodelocaldnsdns_memory_requests }}
  39. args: [ "-localip", "{{ nodelocaldns_ip }}", "-conf", "/etc/coredns/Corefile" ]
  40. securityContext:
  41. privileged: true
  42. ports:
  43. - containerPort: 53
  44. name: dns
  45. protocol: UDP
  46. - containerPort: 53
  47. name: dns-tcp
  48. protocol: TCP
  49. - containerPort: 9253
  50. name: metrics
  51. protocol: TCP
  52. livenessProbe:
  53. httpGet:
  54. host: {{ nodelocaldns_ip }}
  55. path: /health
  56. port: 8080
  57. scheme: HTTP
  58. initialDelaySeconds: 60
  59. timeoutSeconds: 5
  60. successThreshold: 1
  61. failureThreshold: 3
  62. volumeMounts:
  63. - name: config-volume
  64. mountPath: /etc/coredns
  65. volumes:
  66. - name: config-volume
  67. configMap:
  68. name: nodelocaldns
  69. items:
  70. - key: Corefile
  71. path: Corefile
  72. terminationGracePeriodSeconds: 30