From 9f2772a9819e01fc34aefe652d1dbb33e7d647c6 Mon Sep 17 00:00:00 2001 From: Kealan Murphy Date: Fri, 13 Sep 2019 12:56:29 +0100 Subject: [PATCH] [incubator/kafka] Adding the ability to define a pod disruption budget for brokers (#15345) * feature: adding the ability to define a pod disruption budget to the kafka brokers Signed-off-by: Kealan Murphy * address PR comments Signed-off-by: Kealan Murphy * bump chart version Signed-off-by: Murphy, Kealan Signed-off-by: Marius Voila --- incubator/kafka/Chart.yaml | 2 +- incubator/kafka/README.md | 1 + .../kafka/templates/podisruptionbudget.yaml | 18 ++++++++++++++++++ incubator/kafka/values.yaml | 2 ++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 incubator/kafka/templates/podisruptionbudget.yaml diff --git a/incubator/kafka/Chart.yaml b/incubator/kafka/Chart.yaml index 761575f1182c..ca678f501637 100755 --- a/incubator/kafka/Chart.yaml +++ b/incubator/kafka/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 description: Apache Kafka is publish-subscribe messaging rethought as a distributed commit log. name: kafka -version: 0.17.0 +version: 0.17.1 appVersion: 5.0.1 keywords: - kafka diff --git a/incubator/kafka/README.md b/incubator/kafka/README.md index 304e2faae633..4c4d520314d8 100644 --- a/incubator/kafka/README.md +++ b/incubator/kafka/README.md @@ -84,6 +84,7 @@ following configurable parameters: | `external.loadBalancerIP` | Add Static IP to the type Load Balancer. Depends on the provider if enabled | `[]` | `podAnnotations` | Annotation to be added to Kafka pods | `{}` | | `podLabels` | Labels to be added to Kafka pods | `{}` | +| `podDisruptionBudget` | Define a Disruption Budget for the Kafka Pods | `{}` | | `envOverrides` | Add additional Environment Variables in the dictionary format | `{ zookeeper.sasl.enabled: "False" }` | | `configurationOverrides` | `Kafka ` [configuration setting][brokerconfigs] overrides in the dictionary format | `{ "confluent.support.metrics.enable": false }` | | `secrets` | Pass any secrets to the kafka pods. Each secret will be passed as an environment variable by default. The secret can also be mounted to a specific path if required. Environment variable names are generated as: `_` (All upper case) | `{}` | diff --git a/incubator/kafka/templates/podisruptionbudget.yaml b/incubator/kafka/templates/podisruptionbudget.yaml new file mode 100644 index 000000000000..d09fbf91cd33 --- /dev/null +++ b/incubator/kafka/templates/podisruptionbudget.yaml @@ -0,0 +1,18 @@ +{{- if .Values.podDisruptionBudget }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ include "kafka.fullname" . }} + labels: + app: {{ template "kafka.name" . }} + chart: {{ template "kafka.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + selector: + matchLabels: + app: {{ template "kafka.name" . }} + release: {{ .Release.Name }} +{{ toYaml .Values.podDisruptionBudget | indent 2 }} + +{{- end }} diff --git a/incubator/kafka/values.yaml b/incubator/kafka/values.yaml index 36281c68bc1c..af4ff516d90c 100644 --- a/incubator/kafka/values.yaml +++ b/incubator/kafka/values.yaml @@ -163,6 +163,8 @@ podLabels: {} # service: broker # team: developers +podDisruptionBudget: {} + # maxUnavailable: 1 # Limits how many Kafka pods may be unavailable due to voluntary disruptions. ## Configuration Overrides. Specify any Kafka settings you would like set on the StatefulSet ## here in map format, as defined in the official docs.