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.

96 lines
2.8 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. addonmanager.kubernetes.io/mode: Reconcile
  9. spec:
  10. selector:
  11. matchLabels:
  12. k8s-app: nodelocaldns
  13. template:
  14. metadata:
  15. labels:
  16. k8s-app: nodelocaldns
  17. annotations:
  18. prometheus.io/scrape: 'true'
  19. prometheus.io/port: '9253'
  20. spec:
  21. priorityClassName: system-cluster-critical
  22. serviceAccountName: nodelocaldns
  23. hostNetwork: true
  24. dnsPolicy: Default # Don't use cluster DNS.
  25. tolerations:
  26. - effect: NoSchedule
  27. operator: "Exists"
  28. - effect: NoExecute
  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", "-upstreamsvc", "coredns" ]
  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: {{ nodelocaldns_health_port }}
  57. scheme: HTTP
  58. timeoutSeconds: 5
  59. successThreshold: 1
  60. failureThreshold: 10
  61. readinessProbe:
  62. httpGet:
  63. host: {{ nodelocaldns_ip }}
  64. path: /health
  65. port: {{ nodelocaldns_health_port }}
  66. scheme: HTTP
  67. timeoutSeconds: 5
  68. successThreshold: 1
  69. failureThreshold: 10
  70. volumeMounts:
  71. - name: config-volume
  72. mountPath: /etc/coredns
  73. - name: xtables-lock
  74. mountPath: /run/xtables.lock
  75. volumes:
  76. - name: config-volume
  77. configMap:
  78. name: nodelocaldns
  79. items:
  80. - key: Corefile
  81. path: Corefile
  82. {% if dns_etchosts | default(None) %}
  83. - key: hosts
  84. path: hosts
  85. {% endif %}
  86. - name: xtables-lock
  87. hostPath:
  88. path: /run/xtables.lock
  89. type: FileOrCreate
  90. # Minimize downtime during a rolling upgrade or deletion; tell Kubernetes to do a "force
  91. # deletion": https://kubernetes.io/docs/concepts/workloads/pods/pod/#termination-of-pods.
  92. terminationGracePeriodSeconds: 0
  93. updateStrategy:
  94. rollingUpdate:
  95. maxUnavailable: {{ serial | default('20%') }}
  96. type: RollingUpdate