{{/* Copyright 2018 AT&T Intellectual Property. All other rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */}} {{- $envAll := . }} --- apiVersion: extensions/v1beta1 kind: Deployment metadata: name: coredns labels: {{ .Values.service.name }}: enabled kubernetes.io/name: "CoreDNS" spec: replicas: {{ .Values.pod.replicas.coredns }} strategy: type: RollingUpdate rollingUpdate: maxUnavailable: 1 selector: matchLabels: {{ .Values.service.name }}: enabled template: metadata: labels: {{ tuple $envAll "kubernetes" "coredns" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} {{ .Values.service.name }}: enabled annotations: configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} spec: serviceAccountName: coredns tolerations: - key: "CriticalAddonsOnly" operator: "Exists" nodeSelector: {{ .Values.labels.coredns.node_selector_key }}: {{ .Values.labels.coredns.node_selector_value }} affinity: podAntiAffinity: preferredDuringSchedulingIgnoredDuringExecution: - weight: 100 podAffinityTerm: labelSelector: matchExpressions: - key: {{ .Values.service.name }} operator: In values: - enabled topologyKey: kubernetes.io/hostname containers: - name: coredns image: {{ .Values.images.tags.coredns | quote }} imagePullPolicy: {{ .Values.images.pull_policy | quote }} {{ tuple $envAll $envAll.Values.pod.resources.coredns | include "helm-toolkit.snippets.kubernetes_resources" | indent 8 }} args: [ "-conf", "/etc/coredns/Corefile" ] volumeMounts: - name: config-volume mountPath: /etc/coredns - name: scripts mountPath: /tmp/bin ports: - containerPort: 53 name: dns protocol: UDP - containerPort: 53 name: dns-tcp protocol: TCP readinessProbe: exec: command: - /tmp/bin/probe.sh initialDelaySeconds: 2 timeoutSeconds: 5 successThreshold: 1 livenessProbe: exec: command: - /tmp/bin/probe.sh initialDelaySeconds: 10 timeoutSeconds: 5 successThreshold: 1 failureThreshold: 3 dnsPolicy: Default volumes: - name: config-volume configMap: name: {{ .Values.service.name }}-etc items: - key: Corefile path: Corefile - name: scripts configMap: name: {{ .Values.service.name }}-bin defaultMode: 0555