From 498c76ebec44720570d1c8adb6297163036879db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20R=C3=BCger?= Date: Wed, 26 Feb 2020 13:34:26 +0100 Subject: [PATCH] [stable/coredns] Allow to specify a PodDisruptionBudget (#20586) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * [stable/coredns] Allow to specify a PodDisruptionBudget Signed-off-by: Manuel Rüger * Update stable/coredns/Chart.yaml Co-Authored-By: Carlos Tadeu Panato Junior Signed-off-by: Manuel Rüger Co-authored-by: Carlos Tadeu Panato Junior --- stable/coredns/Chart.yaml | 2 +- stable/coredns/README.md | 1 + .../templates/poddisruptionbudget.yaml | 28 +++++++++++++++++++ stable/coredns/values.yaml | 3 ++ 4 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 stable/coredns/templates/poddisruptionbudget.yaml diff --git a/stable/coredns/Chart.yaml b/stable/coredns/Chart.yaml index 732b23e4a5..add42e7b08 100644 --- a/stable/coredns/Chart.yaml +++ b/stable/coredns/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: coredns -version: 1.9.3 +version: 1.10.0 appVersion: 1.6.7 description: CoreDNS is a DNS server that chains plugins and provides Kubernetes DNS Services keywords: diff --git a/stable/coredns/README.md b/stable/coredns/README.md index dc00ca26b5..b4fbbc91bd 100644 --- a/stable/coredns/README.md +++ b/stable/coredns/README.md @@ -75,6 +75,7 @@ The command removes all the Kubernetes components associated with the chart and | `zoneFiles` | Configure custom Zone files | [] | | `extraSecrets` | Optional array of secrets to mount inside the CoreDNS container | [] | | `customLabels` | Optional labels for Deployment(s), Pod, Service, ServiceMonitor objects | {} | +| `podDisruptionBudget` | Optional PodDisruptionBudget | {} | | `autoscaler.enabled` | Optionally enabled a cluster-proportional-autoscaler for CoreDNS | `false` | | `autoscaler.coresPerReplica` | Number of cores in the cluster per CoreDNS replica | `256` | | `autoscaler.nodesPerReplica` | Number of nodes in the cluster per CoreDNS replica | `16` | diff --git a/stable/coredns/templates/poddisruptionbudget.yaml b/stable/coredns/templates/poddisruptionbudget.yaml new file mode 100644 index 0000000000..8ade224f8c --- /dev/null +++ b/stable/coredns/templates/poddisruptionbudget.yaml @@ -0,0 +1,28 @@ +{{- if .Values.podDisruptionBudget -}} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ template "coredns.fullname" . }} + labels: + app.kubernetes.io/managed-by: {{ .Release.Service | quote }} + app.kubernetes.io/instance: {{ .Release.Name | quote }} + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}" + {{- if .Values.isClusterService }} + k8s-app: {{ .Chart.Name | quote }} + kubernetes.io/cluster-service: "true" + kubernetes.io/name: "CoreDNS" + {{- end }} + app.kubernetes.io/name: {{ template "coredns.name" . }} +{{- if .Values.customLabels }} +{{ toYaml .Values.customLabels | indent 4 }} +{{- end }} +spec: + selector: + matchLabels: + app.kubernetes.io/instance: {{ .Release.Name | quote }} + {{- if .Values.isClusterService }} + k8s-app: {{ .Chart.Name | quote }} + {{- end }} + app.kubernetes.io/name: {{ template "coredns.name" . }} +{{ toYaml .Values.podDisruptionBudget | indent 2 }} +{{- end }} diff --git a/stable/coredns/values.yaml b/stable/coredns/values.yaml index becf135646..d7e074d93c 100644 --- a/stable/coredns/values.yaml +++ b/stable/coredns/values.yaml @@ -128,6 +128,9 @@ nodeSelector: {} # effect: NoSchedule tolerations: [] +# https://kubernetes.io/docs/tasks/run-application/configure-pdb/#specifying-a-poddisruptionbudget +podDisruptionBudget: {} + # configure custom zone files as per https://coredns.io/2017/05/08/custom-dns-entries-for-kubernetes/ zoneFiles: [] # - filename: example.db