Change kafka

This commit is contained in:
tompizmor
2019-07-22 13:50:05 +02:00
parent 6dc21f5d4a
commit 494405ff34
6 changed files with 211 additions and 118 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1 apiVersion: v1
name: kafka name: kafka
version: 4.0.2 version: 4.1.0
appVersion: 2.3.0 appVersion: 2.3.0
description: Apache Kafka is a distributed streaming platform. description: Apache Kafka is a distributed streaming platform.
keywords: keywords:
+130 -115
View File
@@ -45,121 +45,127 @@ The command removes all the Kubernetes components associated with the chart and
The following tables lists the configurable parameters of the Kafka chart and their default values. The following tables lists the configurable parameters of the Kafka chart and their default values.
| Parameter | Description | Default | | Parameter | Description | Default |
| --------------------------------------- | --------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ | | --------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------ |
| `global.imageRegistry` | Global Docker image registry | `nil` | | `global.imageRegistry` | Global Docker image registry | `nil` |
| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | | `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `image.registry` | Kafka image registry | `docker.io` | | `image.registry` | Kafka image registry | `docker.io` |
| `image.repository` | Kafka Image name | `bitnami/kafka` | | `image.repository` | Kafka Image name | `bitnami/kafka` |
| `image.tag` | Kafka Image tag | `{VERSION}` | | `image.tag` | Kafka Image tag | `{VERSION}` |
| `image.pullPolicy` | Kafka image pull policy | `IfNotPresent` | | `image.pullPolicy` | Kafka image pull policy | `IfNotPresent` |
| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | | `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `image.debug` | Specify if debug values should be set | `false` | | `image.debug` | Specify if debug values should be set | `false` |
| `nameOverride` | String to partially override kafka.fullname template with a string (will append the release name) | `nil` | | `nameOverride` | String to partially override kafka.fullname template with a string (will append the release name) | `nil` |
| `fullnameOverride` | String to fully override kafka.fullname template with a string | `nil` | | `fullnameOverride` | String to fully override kafka.fullname template with a string | `nil` |
| `updateStrategy` | Update strategy for the stateful set | `RollingUpdate` | | `volumePermissions.enabled` | Enable init container that changes volume permissions in the data directory (for cases where the default k8s `runAsUser` and `fsUser` values do not work) | `false` |
| `rollingUpdatePartition` | Partition update strategy | `nil` | | `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` |
| `podDisruptionBudget.maxUnavailable` | Max number of pods down simultaneously | `1` | | `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` |
| `replicaCount` | Number of Kafka nodes | `1` | | `volumePermissions.image.tag` | Init container volume-permissions image tag | `latest` |
| `config` | Configuration file for Kafka | `nil` | | `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `Always` |
| `allowPlaintextListener` | Allow to use the PLAINTEXT listener | `true` | | `volumePermissions.resources` | Init container resource requests/limit | `nil` |
| `listeners` | The address the socket server listens on. | `nil` | | `updateStrategy` | Update strategy for the stateful set | `RollingUpdate` |
| `advertisedListeners` | Hostname and port the broker will advertise to producers and consumers. | `nil` | | `rollingUpdatePartition` | Partition update strategy | `nil` |
| `listenerSecurityProtocolMap` | The protocol->listener mapping. | `nil` | | `podDisruptionBudget.maxUnavailable` | Max number of pods down simultaneously | `1` |
| `interBrokerListenerName` | The listener that the brokers should communicate on. | `nil` | | `replicaCount` | Number of Kafka nodes | `1` |
| `brokerId` | ID of the Kafka node | `-1` | | `config` | Configuration file for Kafka | `nil` |
| `deleteTopicEnable` | Switch to enable topic deletion or not. | `false` | | `allowPlaintextListener` | Allow to use the PLAINTEXT listener | `true` |
| `heapOpts` | Kafka's Java Heap size. | `-Xmx1024m -Xms1024m` | | `listeners` | The address the socket server listens on. | `nil` |
| `logFlushIntervalMessages` | The number of messages to accept before forcing a flush of data to disk. | `10000` | | `advertisedListeners` | Hostname and port the broker will advertise to producers and consumers. | `nil` |
| `logFlushIntervalMs` | The maximum amount of time a message can sit in a log before we force a flush. | `1000` | | `listenerSecurityProtocolMap` | The protocol->listener mapping. | `nil` |
| `logRetentionBytes` | A size-based retention policy for logs. | `_1073741824` | | `interBrokerListenerName` | The listener that the brokers should communicate on. | `nil` |
| `logRetentionCheckIntervalMs` | The interval at which log segments are checked to see if they can be deleted. | `300000` | | `brokerId` | ID of the Kafka node | `-1` |
| `logRetentionHours` | The minimum age of a log file to be eligible for deletion due to age. | `168` | | `deleteTopicEnable` | Switch to enable topic deletion or not. | `false` |
| `logSegmentBytes` | The maximum size of a log segment file. When this size is reached a new log segment will be created. | `_1073741824` | | `heapOpts` | Kafka's Java Heap size. | `-Xmx1024m -Xms1024m` |
| `logMessageFormatVersion` | Logging message format version. | `` | | `logFlushIntervalMessages` | The number of messages to accept before forcing a flush of data to disk. | `10000` |
| `logsDirs` | A comma separated list of directories under which to store log files. | `/opt/bitnami/kafka/data` | | `logFlushIntervalMs` | The maximum amount of time a message can sit in a log before we force a flush. | `1000` |
| `maxMessageBytes` | The largest record batch size allowed by Kafka. | `1000012` | | `logRetentionBytes` | A size-based retention policy for logs. | `_1073741824` |
| `defaultReplicationFactor` | Default replication factors for automatically created topics | `1` | | `logRetentionCheckIntervalMs` | The interval at which log segments are checked to see if they can be deleted. | `300000` |
| `offsetsTopicReplicationFactor` | The replication factor for the offsets topic | `1` | | `logRetentionHours` | The minimum age of a log file to be eligible for deletion due to age. | `168` |
| `transactionStateLogReplicationFactor ` | The replication factor for the transaction topic | `1` | | `logSegmentBytes` | The maximum size of a log segment file. When this size is reached a new log segment will be created. | `_1073741824` |
| `transactionStateLogMinIsr ` | Overridden min.insync.replicas config for the transaction topic | `1` | | `logMessageFormatVersion` | Logging message format version. | `` |
| `numIoThreads` | The number of threads doing disk I/O. | `8` | | `logsDirs` | A comma separated list of directories under which to store log files. | `/opt/bitnami/kafka/data` |
| `numNetworkThreads` | The number of threads handling network requests. | `3` | | `maxMessageBytes` | The largest record batch size allowed by Kafka. | `1000012` |
| `numPartitions` | The default number of log partitions per topic. | `1` | | `defaultReplicationFactor` | Default replication factors for automatically created topics | `1` |
| `numRecoveryThreadsPerDataDir` | The number of threads per data directory to be used for log recovery at startup and flushing at shutdown. | `1` | | `offsetsTopicReplicationFactor` | The replication factor for the offsets topic | `1` |
| `socketReceiveBufferBytes` | The receive buffer (SO_RCVBUF) used by the socket server. | `102400` | | `transactionStateLogReplicationFactor ` | The replication factor for the transaction topic | `1` |
| `socketRequestMaxBytes` | The maximum size of a request that the socket server will accept (protection against OOM). | `_104857600` | | `transactionStateLogMinIsr ` | Overridden min.insync.replicas config for the transaction topic | `1` |
| `socketSendBufferBytes` | The send buffer (SO_SNDBUF) used by the socket server. | `102400` | | `numIoThreads` | The number of threads doing disk I/O. | `8` |
| `zookeeperConnectionTimeoutMs` | Timeout in ms for connecting to Zookeeper. | `6000` | | `numNetworkThreads` | The number of threads handling network requests. | `3` |
| `extraEnvVars` | Extra environment variables to add to kafka pods | `nil` | | `numPartitions` | The default number of log partitions per topic. | `1` |
| `sslEndpointIdentificationAlgorithm` | The endpoint identification algorithm to validate server hostname using server certificate. | `https` | | `numRecoveryThreadsPerDataDir` | The number of threads per data directory to be used for log recovery at startup and flushing at shutdown. | `1` |
| `auth.enabled` | Switch to enable the kafka authentication. | `false` | | `socketReceiveBufferBytes` | The receive buffer (SO_RCVBUF) used by the socket server. | `102400` |
| `auth.existingSecret` | Name of the existing secret containing credentials for brokerUser, interBrokerUser and zookeeperUser. | `nil` | | `socketRequestMaxBytes` | The maximum size of a request that the socket server will accept (protection against OOM). | `_104857600` |
| `auth.certificatesSecret` | Name of the existing secret containing the certificate files that will be used by Kafka. | `nil` | | `socketSendBufferBytes` | The send buffer (SO_SNDBUF) used by the socket server. | `102400` |
| `auth.certificatesPassword` | Password for the above certificates if they are password protected. | `nil` | | `zookeeperConnectionTimeoutMs` | Timeout in ms for connecting to Zookeeper. | `6000` |
| `auth.brokerUser` | Kafka client user. | `user` | | `extraEnvVars` | Extra environment variables to add to kafka pods | `nil` |
| `auth.brokerPassword` | Kafka client password. | `nil` | | `sslEndpointIdentificationAlgorithm` | The endpoint identification algorithm to validate server hostname using server certificate. | `https` |
| `auth.interBrokerUser` | Kafka inter broker communication user | `admin` | | `auth.enabled` | Switch to enable the kafka authentication. | `false` |
| `auth.interBrokerPassword` | Kafka inter broker communication password. | `nil` | | `auth.existingSecret` | Name of the existing secret containing credentials for brokerUser, interBrokerUser and zookeeperUser. | `nil` |
| `auth.zookeeperUser` | Kafka Zookeeper user. | `nil` | | `auth.certificatesSecret` | Name of the existing secret containing the certificate files that will be used by Kafka. | `nil` |
| `auth.zookeeperPassword` | Kafka Zookeeper password. | `nil` | | `auth.certificatesPassword` | Password for the above certificates if they are password protected. | `nil` |
| `securityContext.enabled` | Enable security context | `true` | | `auth.brokerUser` | Kafka client user. | `user` |
| `securityContext.fsGroup` | Group ID for the container | `1001` | | `auth.brokerPassword` | Kafka client password. | `nil` |
| `securityContext.runAsUser` | User ID for the container | `1001` | | `auth.interBrokerUser` | Kafka inter broker communication user | `admin` |
| `clusterDomain` | Kubernetes cluster domain | `cluster.local` | | `auth.interBrokerPassword` | Kafka inter broker communication password. | `nil` |
| `service.type` | Kubernetes Service type | `ClusterIP` | | `auth.zookeeperUser` | Kafka Zookeeper user. | `nil` |
| `service.port` | Kafka port | `9092` | | `auth.zookeeperPassword` | Kafka Zookeeper password. | `nil` |
| `service.nodePort` | Kubernetes Service nodePort | `nil` | | `securityContext.enabled` | Enable security context | `true` |
| `service.loadBalancerIP` | loadBalancerIP for Kafka Service | `nil` | | `securityContext.fsGroup` | Group ID for the container | `1001` |
| `service.annotations` | Service annotations | `` | | `securityContext.runAsUser` | User ID for the container | `1001` |
| `persistence.enabled` | Enable Kafka persistence using PVC, note that Zookeeper perisstency is unaffected | `true` | | `clusterDomain` | Kubernetes cluster domain | `cluster.local` |
| `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template. | `nil` | | `service.type` | Kubernetes Service type | `ClusterIP` |
| `persistence.storageClass` | PVC Storage Class for Kafka volume | `nil` | | `service.port` | Kafka port | `9092` |
| `persistence.accessMode` | PVC Access Mode for Kafka volume | `ReadWriteOnce` | | `service.nodePort` | Kubernetes Service nodePort | `nil` |
| `persistence.size` | PVC Storage Request for Kafka volume | `8Gi` | | `service.loadBalancerIP` | loadBalancerIP for Kafka Service | `nil` |
| `persistence.annotations` | Annotations for the PVC | `{}` | | `service.annotations` | Service annotations | `` |
| `nodeSelector` | Node labels for pod assignment | `{}` | | `persistence.enabled` | Enable Kafka persistence using PVC, note that Zookeeper perisstency is unaffected | `true` |
| `tolerations` | Toleration labels for pod assignment | `[]` | | `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template. | `nil` |
| `affinity` | Map of node/pod affinities | `{}` | | `persistence.storageClass` | PVC Storage Class for Kafka volume | `nil` |
| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `250m` | | `persistence.accessMode` | PVC Access Mode for Kafka volume | `ReadWriteOnce` |
| `livenessProbe.enabled` | would you like a livessProbed to be enabled | `true` | | `persistence.size` | PVC Storage Request for Kafka volume | `8Gi` |
| `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 30 | | `persistence.annotations` | Annotations for the PVC | `{}` |
| `livenessProbe.periodSeconds` | How often to perform the probe | 10 | | `nodeSelector` | Node labels for pod assignment | `{}` |
| `livenessProbe.timeoutSeconds` | When the probe times out | 5 | | `tolerations` | Toleration labels for pod assignment | `[]` |
| `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | | `affinity` | Map of node/pod affinities | `{}` |
| `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | | `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `250m` |
| `readinessProbe.enabled` | would you like a readinessProbe to be enabled | `true` | | `livenessProbe.enabled` | would you like a livessProbed to be enabled | `true` |
| `readinessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 5 | | `livenessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 30 |
| `readinessProbe.periodSeconds` | How often to perform the probe | 10 | | `livenessProbe.periodSeconds` | How often to perform the probe | 10 |
| `readinessProbe.timeoutSeconds` | When the probe times out | 5 | | `livenessProbe.timeoutSeconds` | When the probe times out | 5 |
| `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 | | `livenessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 |
| `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 | | `livenessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 |
| `metrics.kafka.enabled` | Whether or not to create a separate Kafka exporter | `false` | | `readinessProbe.enabled` | would you like a readinessProbe to be enabled | `true` |
| `metrics.kafka.image.registry` | Kafka exporter image registry | `docker.io` | | `readinessProbe.initialDelaySeconds` | Delay before liveness probe is initiated | 5 |
| `metrics.kafka.image.repository` | Kafka exporter image name | `danielqsj/kafka-exporter` | | `readinessProbe.periodSeconds` | How often to perform the probe | 10 |
| `metrics.kafka.image.tag` | Kafka exporter image tag | `v1.0.1` | | `readinessProbe.timeoutSeconds` | When the probe times out | 5 |
| `metrics.kafka.image.pullPolicy` | Kafka exporter image pull policy | `IfNotPresent` | | `readinessProbe.failureThreshold` | Minimum consecutive failures for the probe to be considered failed after having succeeded. | 6 |
| `metrics.kafka.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | | `readinessProbe.successThreshold` | Minimum consecutive successes for the probe to be considered successful after having failed | 1 |
| `metrics.kafka.interval` | Interval that Prometheus scrapes Kafka metrics when using Prometheus Operator | `10s` | | `metrics.kafka.enabled` | Whether or not to create a separate Kafka exporter | `false` |
| `metrics.kafka.port` | Kafka Exporter Port which exposes metrics in Prometheus format for scraping | `9308` | | `metrics.kafka.image.registry` | Kafka exporter image registry | `docker.io` |
| `metrics.kafka.resources` | Allows setting resource limits for kafka-exporter pod | `{}` | | `metrics.kafka.image.repository` | Kafka exporter image name | `danielqsj/kafka-exporter` |
| `metrics.jmx.resources` | Allows setting resource limits for jmx sidecar container | `{}` | | `metrics.kafka.image.tag` | Kafka exporter image tag | `v1.0.1` |
| `metrics.jmx.enabled` | Whether or not to expose JMX metrics to Prometheus | `false` | | `metrics.kafka.image.pullPolicy` | Kafka exporter image pull policy | `IfNotPresent` |
| `metrics.jmx.image.registry` | JMX exporter image registry | `docker.io` | | `metrics.kafka.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `metrics.jmx.image.repository` | JMX exporter image name | `solsson/kafka-prometheus-jmx-exporter@sha256` | | `metrics.kafka.interval` | Interval that Prometheus scrapes Kafka metrics when using Prometheus Operator | `10s` |
| `metrics.jmx.image.tag` | JMX exporter image tag | `a23062396cd5af1acdf76512632c20ea6be76885dfc20cd9ff40fb23846557e8` | | `metrics.kafka.port` | Kafka Exporter Port which exposes metrics in Prometheus format for scraping | `9308` |
| `metrics.jmx.image.pullPolicy` | JMX exporter image pull policy | `IfNotPresent` | | `metrics.kafka.resources` | Allows setting resource limits for kafka-exporter pod | `{}` |
| `metrics.jmx.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) | | `metrics.jmx.resources` | Allows setting resource limits for jmx sidecar container | `{}` |
| `metrics.jmx.interval` | Interval that Prometheus scrapes JMX metrics when using Prometheus Operator | `10s` | | `metrics.jmx.enabled` | Whether or not to expose JMX metrics to Prometheus | `false` |
| `metrics.jmx.exporterPort` | JMX Exporter Port which exposes metrics in Prometheus format for scraping | `5556` | | `metrics.jmx.image.registry` | JMX exporter image registry | `docker.io` |
| `metrics.jmx.configMap.enabled` | Enable the default ConfigMap for JMX | `true` | | `metrics.jmx.image.repository` | JMX exporter image name | `solsson/kafka-prometheus-jmx-exporter@sha256` |
| `metrics.jmx.configMap.overrideConfig` | Allows config file to be generated by passing values to ConfigMap | `{}` | | `metrics.jmx.image.tag` | JMX exporter image tag | `a23062396cd5af1acdf76512632c20ea6be76885dfc20cd9ff40fb23846557e8` |
| `metrics.jmx.configMap.overrideName` | Allows setting the name of the ConfigMap to be used | `""` | | `metrics.jmx.image.pullPolicy` | JMX exporter image pull policy | `IfNotPresent` |
| `metrics.jmx.jmxPort` | The jmx port which JMX style metrics are exposed (note: these are not scrapeable by Prometheus) | `5555` | | `metrics.jmx.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
| `metrics.jmx.whitelistObjectNames` | Allows setting which JMX objects you want to expose to via JMX stats to JMX Exporter | (see `values.yaml`) | | `metrics.jmx.interval` | Interval that Prometheus scrapes JMX metrics when using Prometheus Operator | `10s` |
| `zookeeper.enabled` | Switch to enable or disable the Zookeeper helm chart | `true` | | `metrics.jmx.exporterPort` | JMX Exporter Port which exposes metrics in Prometheus format for scraping | `5556` |
| `zookeeper.persistence.enabled` | Enable Zookeeper persistence using PVC | `true` | | `metrics.jmx.configMap.enabled` | Enable the default ConfigMap for JMX | `true` |
| `externalZookeeper.servers` | Server or list of external Zookeeper servers to use. | `nil` | | `metrics.jmx.configMap.overrideConfig` | Allows config file to be generated by passing values to ConfigMap | `{}` |
| `metrics.jmx.configMap.overrideName` | Allows setting the name of the ConfigMap to be used | `""` |
| `metrics.jmx.jmxPort` | The jmx port which JMX style metrics are exposed (note: these are not scrapeable by Prometheus) | `5555` |
| `metrics.jmx.whitelistObjectNames` | Allows setting which JMX objects you want to expose to via JMX stats to JMX Exporter | (see `values.yaml`) |
| `zookeeper.enabled` | Switch to enable or disable the Zookeeper helm chart | `true` |
| `zookeeper.persistence.enabled` | Enable Zookeeper persistence using PVC | `true` |
| `externalZookeeper.servers` | Server or list of external Zookeeper servers to use. | `nil` |
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
@@ -301,6 +307,15 @@ The [Bitnami Kafka](https://github.com/bitnami/bitnami-docker-kafka) image store
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube.
See the [Configuration](#configuration) section to configure the PVC or to disable persistence. See the [Configuration](#configuration) section to configure the PVC or to disable persistence.
### Adjust permissions of persistent volume mountpoint
As the image run as non-root by default, it is necessary to adjust the ownership of the persistent volume so that the container can write data into it.
By default, the chart is configured to use Kubernetes Security Context to automatically change the ownership of the volume. However, this feature does not work in all Kubernetes distributions.
As an alternative, this chart supports using an initContainer to change the ownership of the volume before mounting it in the final destination.
You can enable this initContainer by setting `volumePermissions.enabled` to `true`.
## Upgrading ## Upgrading
### To 2.0.0 ### To 2.0.0
+31 -2
View File
@@ -128,7 +128,7 @@ imagePullSecrets:
{{- range .Values.global.imagePullSecrets }} {{- range .Values.global.imagePullSecrets }}
- name: {{ . }} - name: {{ . }}
{{- end }} {{- end }}
{{- else if or .Values.image.pullSecrets .Values.metrics.kafka.image.pullSecrets .Values.metrics.jmx.image.pullSecrets }} {{- else if or .Values.image.pullSecrets .Values.metrics.kafka.image.pullSecrets .Values.metrics.jmx.image.pullSecrets .Values.volumePermissions.image.pullSecrets }}
imagePullSecrets: imagePullSecrets:
{{- range .Values.image.pullSecrets }} {{- range .Values.image.pullSecrets }}
- name: {{ . }} - name: {{ . }}
@@ -139,8 +139,11 @@ imagePullSecrets:
{{- range .Values.metrics.jmx.image.pullSecrets }} {{- range .Values.metrics.jmx.image.pullSecrets }}
- name: {{ . }} - name: {{ . }}
{{- end }} {{- end }}
{{- range .Values.volumePermissions.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}} {{- end -}}
{{- else if or .Values.image.pullSecrets .Values.metrics.kafka.image.pullSecrets .Values.metrics.jmx.image.pullSecrets }} {{- else if or .Values.image.pullSecrets .Values.metrics.kafka.image.pullSecrets .Values.metrics.jmx.image.pullSecrets .Values.volumePermissions.image.pullSecrets }}
imagePullSecrets: imagePullSecrets:
{{- range .Values.image.pullSecrets }} {{- range .Values.image.pullSecrets }}
- name: {{ . }} - name: {{ . }}
@@ -151,5 +154,31 @@ imagePullSecrets:
{{- range .Values.metrics.jmx.image.pullSecrets }} {{- range .Values.metrics.jmx.image.pullSecrets }}
- name: {{ . }} - name: {{ . }}
{{- end }} {{- end }}
{{- range .Values.volumePermissions.image.pullSecrets }}
- name: {{ . }}
{{- end }}
{{- end -}}
{{- end -}}
{{/*
Return the proper image name (for the init container volume-permissions image)
*/}}
{{- define "kafka.volumePermissions.image" -}}
{{- $registryName := .Values.volumePermissions.image.registry -}}
{{- $repositoryName := .Values.volumePermissions.image.repository -}}
{{- $tag := .Values.volumePermissions.image.tag | toString -}}
{{/*
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
but Helm 2.9 and 2.10 doesn't support it, so we need to implement this if-else logic.
Also, we can't use a single if because lazy evaluation is not an option
*/}}
{{- if .Values.global }}
{{- if .Values.global.imageRegistry }}
{{- printf "%s/%s:%s" .Values.global.imageRegistry $repositoryName $tag -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}}
{{- else -}}
{{- printf "%s/%s:%s" $registryName $repositoryName $tag -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
+13
View File
@@ -58,6 +58,19 @@ spec:
affinity: affinity:
{{ toYaml .Values.affinity | indent 8 }} {{ toYaml .Values.affinity | indent 8 }}
{{- end }} {{- end }}
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
initContainers:
- name: volume-permissions
image: "{{ template "kafka.volumePermissions.image" . }}"
imagePullPolicy: {{ default "" .Values.volumePermissions.image.pullPolicy | quote }}
command: ["chown", "-R", "{{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }}", "/bitnami/kafka"]
securityContext:
runAsUser: 0
resources: {{ toYaml .Values.volumePermissions.resources | nindent 10 -}}
volumeMounts:
- name: data
mountPath: "/bitnami/kafka"
{{- end }}
containers: containers:
- name: kafka - name: kafka
image: "{{ template "kafka.image" . }}" image: "{{ template "kafka.image" . }}"
+18
View File
@@ -37,6 +37,24 @@ image:
## String to fully override kafka.fullname template ## String to fully override kafka.fullname template
# fullnameOverride: # fullnameOverride:
## Init containers parameters:
## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
##
volumePermissions:
enabled: false
image:
registry: docker.io
repository: bitnami/minideb
tag: latest
pullPolicy: Always
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
resources: {}
## StatefulSet controller supports automated updates. There are two valid update strategies: RollingUpdate and OnDelete ## StatefulSet controller supports automated updates. There are two valid update strategies: RollingUpdate and OnDelete
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets ## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets
## ##
+18
View File
@@ -37,6 +37,24 @@ image:
## String to fully override kafka.fullname template ## String to fully override kafka.fullname template
# fullnameOverride: # fullnameOverride:
## Init containers parameters:
## volumePermissions: Change the owner and group of the persistent volume mountpoint to runAsUser:fsGroup values from the securityContext section.
##
volumePermissions:
enabled: false
image:
registry: docker.io
repository: bitnami/minideb
tag: latest
pullPolicy: Always
## Optionally specify an array of imagePullSecrets.
## Secrets must be manually created in the namespace.
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/
##
# pullSecrets:
# - myRegistryKeySecretName
resources: {}
## StatefulSet controller supports automated updates. There are two valid update strategies: RollingUpdate and OnDelete ## StatefulSet controller supports automated updates. There are two valid update strategies: RollingUpdate and OnDelete
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets ## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets
## ##