From da24996734bdec73d5408efa0f6873f309120877 Mon Sep 17 00:00:00 2001 From: Sukrit Khera Date: Fri, 7 Sep 2018 09:14:20 -0700 Subject: [PATCH] Feature kafka pod annotations (#7597) * Add support for kafka pod annotations Signed-off-by: sukrit007 * Bump up kafka chart version Signed-off-by: sukrit007 --- incubator/kafka/Chart.yaml | 2 +- incubator/kafka/README.md | 1 + incubator/kafka/templates/statefulset.yaml | 5 ++++- incubator/kafka/values.yaml | 3 +++ 4 files changed, 9 insertions(+), 2 deletions(-) diff --git a/incubator/kafka/Chart.yaml b/incubator/kafka/Chart.yaml index e696e6052c..a5f8457cd2 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.9.3 +version: 0.9.4 appVersion: 4.1.2 keywords: - kafka diff --git a/incubator/kafka/README.md b/incubator/kafka/README.md index f1c223b71d..7a23849d3f 100644 --- a/incubator/kafka/README.md +++ b/incubator/kafka/README.md @@ -78,6 +78,7 @@ following configurable parameters: | `external.type` | Service Type. | `NodePort` | | `external.distinct` | Distinct DNS entries for each created A record. | `false` | | `external.annotations` | Additional annotations for the external service. | `{}` | +| `podAnnotations` | Annotation to be added to Kafka pods | `{}` | | `rbac.enabled` | Enable a service account and role for the init container to use in an RBAC enabled cluster | `false` | | `configurationOverrides` | `Kafka ` [configuration setting][brokerconfigs] overrides in the dictionary format | `{ offsets.topic.replication.factor: 3 }` | | `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 (in addition to environment variable) if required. Environment variable names are generated as: `_` (All upper case)| diff --git a/incubator/kafka/templates/statefulset.yaml b/incubator/kafka/templates/statefulset.yaml index f61a9d2500..0e6220683e 100644 --- a/incubator/kafka/templates/statefulset.yaml +++ b/incubator/kafka/templates/statefulset.yaml @@ -16,10 +16,13 @@ spec: replicas: {{ default 3 .Values.replicas }} template: metadata: -{{- if and .Values.prometheus.jmx.enabled (not .Values.prometheus.operator.enabled) }} annotations: +{{- if and .Values.prometheus.jmx.enabled (not .Values.prometheus.operator.enabled) }} prometheus.io/scrape: "true" prometheus.io/port: {{ .Values.prometheus.jmx.port | quote }} +{{- end }} +{{- if .Values.podAnnotations }} +{{ toYaml .Values.podAnnotations | indent 8 }} {{- end }} labels: app: {{ include "kafka.name" . }} diff --git a/incubator/kafka/values.yaml b/incubator/kafka/values.yaml index 4b90d6b59a..9db504f47d 100644 --- a/incubator/kafka/values.yaml +++ b/incubator/kafka/values.yaml @@ -150,6 +150,9 @@ external: imageTag: "0.4" imagePullPolicy: "IfNotPresent" +# Annotation to be added to Kafka pods +podAnnotations: {} + ## Configuration Overrides. Specify any Kafka settings you would like set on the StatefulSet ## here in map format, as defined in the official docs. ## ref: https://kafka.apache.org/documentation/#brokerconfigs