From 10f440928c0bdf9f901888b79ecbc48db6843cc2 Mon Sep 17 00:00:00 2001 From: smcavallo Date: Tue, 18 Jun 2019 09:22:21 -0400 Subject: [PATCH] [incubator/kafka] allow setting statefulset serviceaccount (#14224) * allow custom serviceAccountName Signed-off-by: S.Cavallo * bump chart version Signed-off-by: S.Cavallo * fix whitespace Signed-off-by: S.Cavallo --- incubator/kafka/Chart.yaml | 2 +- incubator/kafka/README.md | 3 ++- incubator/kafka/templates/statefulset.yaml | 3 +++ incubator/kafka/values.yaml | 4 ++++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/incubator/kafka/Chart.yaml b/incubator/kafka/Chart.yaml index aeda85057b..4cb55d9bb3 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.15.6 +version: 0.15.7 appVersion: 5.0.1 keywords: - kafka diff --git a/incubator/kafka/README.md b/incubator/kafka/README.md index d257012e4a..d34da48e69 100644 --- a/incubator/kafka/README.md +++ b/incubator/kafka/README.md @@ -66,6 +66,7 @@ following configurable parameters: | `kafkaHeapOptions` | Kafka broker JVM heap options | `-Xmx1G-Xms1G` | | `logSubPath` | Subpath under `persistence.mountPath` where kafka logs will be placed. | `logs` | | `schedulerName` | Name of Kubernetes scheduler (other than the default) | `nil` | +| `serviceAccountName` | Name of Kubernetes serviceAccount. Useful when needing to pull images from custom repositories | `nil` | | `affinity` | Defines affinities and anti-affinities for pods as defined in: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity preferences | `{}` | | `tolerations` | List of node tolerations for the pods. https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ | `[]` | | `headless.annotations` | List of annotations for the headless service. https://kubernetes.io/docs/concepts/services-networking/service/#headless-services | `[]` | @@ -82,7 +83,7 @@ following configurable parameters: | `external.annotations` | Additional annotations for the external service. | `{}` | | `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 | `{}` | +| `podLabels` | Labels to be added to 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 | `{ 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 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 58febd9e0a..1cd69b30e5 100644 --- a/incubator/kafka/templates/statefulset.yaml +++ b/incubator/kafka/templates/statefulset.yaml @@ -37,6 +37,9 @@ spec: {{- if .Values.schedulerName }} schedulerName: "{{ .Values.schedulerName }}" {{- end }} +{{- if .Values.serviceAccountName }} + serviceAccountName: {{ .Values.serviceAccountName }} +{{- end }} {{- if .Values.tolerations }} tolerations: {{ toYaml .Values.tolerations | indent 8 }} diff --git a/incubator/kafka/values.yaml b/incubator/kafka/values.yaml index 0ec8c9f435..307a2461a1 100644 --- a/incubator/kafka/values.yaml +++ b/incubator/kafka/values.yaml @@ -62,6 +62,10 @@ logSubPath: "logs" ## # schedulerName: +## Use an alternate serviceAccount +## Useful when using images in custom repositories +# serviceAccountName: + ## Pod scheduling preferences (by default keep pods within a release on separate nodes). ## ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## By default we don't set affinity