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.

114 lines
3.7 KiB

  1. apiVersion: v1
  2. kind: ReplicationController
  3. metadata:
  4. name: kubedns
  5. namespace: {{ system_namespace }}
  6. labels:
  7. k8s-app: kubedns
  8. version: v19
  9. kubernetes.io/cluster-service: "true"
  10. spec:
  11. replicas: {{ dns_replicas }}
  12. selector:
  13. k8s-app: kubedns
  14. version: v19
  15. template:
  16. metadata:
  17. labels:
  18. k8s-app: kubedns
  19. version: v19
  20. kubernetes.io/cluster-service: "true"
  21. spec:
  22. containers:
  23. - name: kubedns
  24. image: "{{ kubedns_image_repo }}:{{ kubedns_image_tag }}"
  25. imagePullPolicy: {{ k8s_image_pull_policy }}
  26. resources:
  27. # TODO: Set memory limits when we've profiled the container for large
  28. # clusters, then set request = limit to keep this container in
  29. # guaranteed class. Currently, this container falls into the
  30. # "burstable" category so the kubelet doesn't backoff from restarting it.
  31. limits:
  32. cpu: {{ dns_cpu_limit }}
  33. memory: {{ dns_memory_limit }}
  34. requests:
  35. cpu: {{ dns_cpu_requests }}
  36. memory: {{ dns_memory_requests }}
  37. livenessProbe:
  38. httpGet:
  39. path: /healthz
  40. port: 8080
  41. scheme: HTTP
  42. initialDelaySeconds: 60
  43. timeoutSeconds: 5
  44. successThreshold: 1
  45. failureThreshold: 5
  46. readinessProbe:
  47. httpGet:
  48. path: /readiness
  49. port: 8081
  50. scheme: HTTP
  51. # we poll on pod startup for the Kubernetes master service and
  52. # only setup the /readiness HTTP server once that's available.
  53. initialDelaySeconds: 30
  54. timeoutSeconds: 5
  55. args:
  56. # command = "/kube-dns"
  57. - --domain={{ dns_domain }}.
  58. - --dns-port=10053
  59. - --v={{ kube_log_level }}
  60. ports:
  61. - containerPort: 10053
  62. name: dns-local
  63. protocol: UDP
  64. - containerPort: 10053
  65. name: dns-tcp-local
  66. protocol: TCP
  67. - name: dnsmasq
  68. image: "{{ kubednsmasq_image_repo }}:{{ kubednsmasq_image_tag }}"
  69. imagePullPolicy: {{ k8s_image_pull_policy }}
  70. resources:
  71. limits:
  72. cpu: {{ dns_cpu_limit }}
  73. memory: {{ dns_memory_limit }}
  74. requests:
  75. cpu: {{ dns_cpu_requests }}
  76. memory: {{ dns_memory_requests }}
  77. args:
  78. - --log-facility=-
  79. - --cache-size=1000
  80. - --no-resolv
  81. - --server=127.0.0.1#10053
  82. {% if kube_log_level == '4' %}
  83. - --log-queries
  84. {% endif %}
  85. ports:
  86. - containerPort: 53
  87. name: dns
  88. protocol: UDP
  89. - containerPort: 53
  90. name: dns-tcp
  91. protocol: TCP
  92. - name: healthz
  93. image: "{{ exechealthz_image_repo }}:{{ exechealthz_image_tag }}"
  94. imagePullPolicy: {{ k8s_image_pull_policy }}
  95. resources:
  96. # keep request = limit to keep this container in guaranteed class
  97. limits:
  98. cpu: 10m
  99. memory: 50Mi
  100. requests:
  101. cpu: 10m
  102. # Note that this container shouldn't really need 50Mi of memory. The
  103. # limits are set higher than expected pending investigation on #29688.
  104. # The extra memory was stolen from the kubedns container to keep the
  105. # net memory requested by the pod constant.
  106. memory: 50Mi
  107. args:
  108. - -cmd=nslookup kubernetes.default.svc.{{ dns_domain }} 127.0.0.1 >/dev/null && nslookup kubernetes.default.svc.{{ dns_domain }} 127.0.0.1:10053 >/dev/null
  109. - -port=8080
  110. - -quiet
  111. ports:
  112. - containerPort: 8080
  113. protocol: TCP
  114. dnsPolicy: Default # Don't use cluster DNS.