chore(cleanup): Removed depricated directory
This commit is contained in:
parent
d458f39fae
commit
990cd892c4
662 changed files with 11 additions and 114663 deletions
|
|
@ -1,23 +0,0 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
apiVersion: v2
|
||||
name: clickhouse
|
||||
description: A Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 1.16.0
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "clickhouse.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "clickhouse.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "clickhouse.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "clickhouse.labels" -}}
|
||||
helm.sh/chart: {{ include "clickhouse.chart" . }}
|
||||
{{ include "clickhouse.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "clickhouse.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "clickhouse.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "clickhouse.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "clickhouse.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: clickhouse
|
||||
labels:
|
||||
{{- include "clickhouse.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: {{ .Values.service.webPort }}
|
||||
targetPort: web
|
||||
protocol: TCP
|
||||
name: web
|
||||
- port: {{ .Values.service.dataPort }}
|
||||
targetPort: data
|
||||
protocol: TCP
|
||||
name: data
|
||||
selector:
|
||||
{{- include "clickhouse.selectorLabels" . | nindent 4 }}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "clickhouse.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "clickhouse.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "clickhouse.fullname" . }}
|
||||
labels:
|
||||
{{- include "clickhouse.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
serviceName: {{ include "clickhouse.fullname" . }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "clickhouse.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "clickhouse.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "clickhouse.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
env:
|
||||
{{- range $key, $value := .Values.env }}
|
||||
- name: "{{ $key }}"
|
||||
value: "{{ $value }}"
|
||||
{{- end }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: 9000
|
||||
name: web
|
||||
- containerPort: 8123
|
||||
name: data
|
||||
volumeMounts:
|
||||
- name: ch-volume
|
||||
mountPath: /var/lib/mydata
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: ch-volume
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.storageSize }}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
# Default values for clickhouse.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: yandex/clickhouse-server
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: "20.9"
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
env: {}
|
||||
|
||||
service:
|
||||
webPort: 9000
|
||||
dataPort: 8123
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
storageSize: 8G
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
annotations:
|
||||
category: Infrastructure
|
||||
apiVersion: v1
|
||||
appVersion: 2.6.0
|
||||
description: Apache Kafka is a distributed streaming platform.
|
||||
engine: gotpl
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/kafka
|
||||
icon: https://bitnami.com/assets/stacks/kafka/img/kafka-stack-110x117.png
|
||||
keywords:
|
||||
- kafka
|
||||
- zookeeper
|
||||
- streaming
|
||||
- producer
|
||||
- consumer
|
||||
maintainers:
|
||||
- email: containers@bitnami.com
|
||||
name: Bitnami
|
||||
name: kafka
|
||||
sources:
|
||||
- https://github.com/bitnami/bitnami-docker-kafka
|
||||
- https://kafka.apache.org/
|
||||
version: 11.8.6
|
||||
|
|
@ -1,737 +0,0 @@
|
|||
# Kafka
|
||||
|
||||
[Kafka](https://www.kafka.org/) is a distributed streaming platform used for building real-time data pipelines and streaming apps. It is horizontally scalable, fault-tolerant, wicked fast, and runs in production in thousands of companies.
|
||||
|
||||
## TL;DR
|
||||
|
||||
```console
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
helm install my-release bitnami/kafka
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart bootstraps a [Kafka](https://github.com/bitnami/bitnami-docker-kafka) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||
|
||||
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes 1.12+
|
||||
- Helm 2.12+ or Helm 3.0-beta3+
|
||||
- PV provisioner support in the underlying infrastructure
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```console
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
helm install my-release bitnami/kafka
|
||||
```
|
||||
|
||||
These commands deploy Kafka on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
|
||||
|
||||
> **Tip**: List all releases using `helm list`
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the `my-release` deployment:
|
||||
|
||||
```console
|
||||
helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Parameters
|
||||
|
||||
The following tables lists the configurable parameters of the Kafka chart and their default values per section/component:
|
||||
|
||||
### Global parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `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.storageClass` | Global storage class for dynamic provisioning | `nil` |
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `nameOverride` | String to partially override kafka.fullname | `nil` |
|
||||
| `fullnameOverride` | String to fully override kafka.fullname | `nil` |
|
||||
| `clusterDomain` | Default Kubernetes cluster domain | `cluster.local` |
|
||||
| `commonLabels` | Labels to add to all deployed objects | `{}` |
|
||||
| `commonAnnotations` | Annotations to add to all deployed objects | `{}` |
|
||||
| `extraDeploy` | Array of extra objects to deploy with the release | `nil` (evaluated as a template) |
|
||||
|
||||
### Kafka parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `image.registry` | Kafka image registry | `docker.io` |
|
||||
| `image.repository` | Kafka image name | `bitnami/kafka` |
|
||||
| `image.tag` | Kafka image tag | `{TAG_NAME}` |
|
||||
| `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.debug` | Set to true if you would like to see extra information on logs | `false` |
|
||||
| `config` | Configuration file for Kafka. Auto-generated based on other parameters when not specified | `nil` |
|
||||
| `existingConfigmap` | Name of existing ConfigMap with Kafka configuration | `nil` |
|
||||
| `log4j` | An optional log4j.properties file to overwrite the default of the Kafka brokers. | `nil` |
|
||||
| `existingLog4jConfigMap` | The name of an existing ConfigMap containing a log4j.properties file. | `nil` |
|
||||
| `heapOpts` | Kafka's Java Heap size | `-Xmx1024m -Xms1024m` |
|
||||
| `deleteTopicEnable` | Switch to enable topic deletion or not | `false` |
|
||||
| `autoCreateTopicsEnable` | Switch to enable auto creation of topics. Enabling auto creation of topics not recommended for production or similar environments | `false` |
|
||||
| `logFlushIntervalMessages` | The number of messages to accept before forcing a flush of data to disk | `10000` |
|
||||
| `logFlushIntervalMs` | The maximum amount of time a message can sit in a log before we force a flush | `1000` |
|
||||
| `logRetentionBytes` | A size-based retention policy for logs | `_1073741824` |
|
||||
| `logRetentionCheckIntervalMs` | The interval at which log segments are checked to see if they can be deleted | `300000` |
|
||||
| `logRetentionHours` | The minimum age of a log file to be eligible for deletion due to age | `168` |
|
||||
| `logSegmentBytes` | The maximum size of a log segment file. When this size is reached a new log segment will be created | `_1073741824` |
|
||||
| `logsDirs` | A comma separated list of directories under which to store log files | `/bitnami/kafka/data` |
|
||||
| `maxMessageBytes` | The largest record batch size allowed by Kafka | `1000012` |
|
||||
| `defaultReplicationFactor` | Default replication factors for automatically created topics | `1` |
|
||||
| `offsetsTopicReplicationFactor` | The replication factor for the offsets topic | `1` |
|
||||
| `transactionStateLogReplicationFactor` | The replication factor for the transaction topic | `1` |
|
||||
| `transactionStateLogMinIsr` | Overridden min.insync.replicas config for the transaction topic | `1` |
|
||||
| `numIoThreads` | The number of threads doing disk I/O | `8` |
|
||||
| `numNetworkThreads` | The number of threads handling network requests | `3` |
|
||||
| `numPartitions` | The default number of log partitions per topic | `1` |
|
||||
| `numRecoveryThreadsPerDataDir` | The number of threads per data directory to be used for log recovery at startup and flushing at shutdown | `1` |
|
||||
| `socketReceiveBufferBytes` | The receive buffer (SO_RCVBUF) used by the socket server | `102400` |
|
||||
| `socketRequestMaxBytes` | The maximum size of a request that the socket server will accept (protection against OOM) | `_104857600` |
|
||||
| `socketSendBufferBytes` | The send buffer (SO_SNDBUF) used by the socket server | `102400` |
|
||||
| `zookeeperConnectionTimeoutMs` | Timeout in ms for connecting to Zookeeper | `6000` |
|
||||
| `extraEnvVars` | Extra environment variables to add to kafka pods | `[]` |
|
||||
| `extraVolumes` | Extra volume(s) to add to Kafka statefulset | `[]` |
|
||||
| `extraVolumeMounts` | Extra volumeMount(s) to add to Kafka containers | `[]` |
|
||||
| `auth.clientProtocol` | Authentication protocol for communications with clients. Allowed protocols: `plaintext`, `tls`, `mtls`, `sasl` and `sasl_tls` | `plaintext` |
|
||||
| `auth.interBrokerProtocol` | Authentication protocol for inter-broker communications. Allowed protocols: `plaintext`, `tls`, `mtls`, `sasl` and `sasl_tls` | `plaintext` |
|
||||
| `auth.saslMechanisms` | SASL mechanisms when either `auth.interBrokerProtocol` or `auth.clientProtocol` are `sasl`. Allowed types: `plain`, `scram-sha-256`, `scram-sha-512` | `plain,scram-sha-256,scram-sha-512` |
|
||||
| `auth.saslInterBrokerMechanism` | SASL mechanism to use as inter broker protocol, it must be included at `auth.saslMechanisms` | `plain` |
|
||||
| `auth.jksSecret` | Name of the existing secret containing the truststore and one keystore per Kafka broker you have in the cluster | `nil` |
|
||||
| `auth.jksPassword` | Password to access the JKS files when they are password-protected | `nil` |
|
||||
| `auth.tlsEndpointIdentificationAlgorithm` | The endpoint identification algorithm to validate server hostname using server certificate | `https` |
|
||||
| `auth.jaas.interBrokerUser` | Kafka inter broker communication user for SASL authentication | `admin` |
|
||||
| `auth.jaas.interBrokerPassword` | Kafka inter broker communication password for SASL authentication | `nil` |
|
||||
| `auth.jaas.zookeeperUser` | Kafka Zookeeper user for SASL authentication | `nil` |
|
||||
| `auth.jaas.zookeeperPassword` | Kafka Zookeeper password for SASL authentication | `nil` |
|
||||
| `auth.jaas.existingSecret` | Name of the existing secret containing credentials for brokerUser, interBrokerUser and zookeeperUser | `nil` |
|
||||
| `auth.jaas.clientUsers` | List of Kafka client users to be created, separated by commas. This values will override `auth.jaas.clientUser` | `[]` |
|
||||
| `auth.jaas.clientPasswords` | List of passwords for `auth.jaas.clientUsers`. It is mandatory to provide the passwords when using `auth.jaas.clientUsers` | `[]` |
|
||||
| `listeners` | The address(es) the socket server listens on. Auto-calculated it's set to an empty array | `[]` |
|
||||
| `advertisedListeners` | The address(es) (hostname:port) the broker will advertise to producers and consumers. Auto-calculated it's set to an empty array | `[]` |
|
||||
| `listenerSecurityProtocolMap` | The protocol->listener mapping. Auto-calculated it's set to nil | `nil` |
|
||||
| `allowPlaintextListener` | Allow to use the PLAINTEXT listener | `true` |
|
||||
| `interBrokerListenerName` | The listener that the brokers should communicate on | `INTERNAL` |
|
||||
|
||||
### Statefulset parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `replicaCount` | Number of Kafka nodes | `1` |
|
||||
| `updateStrategy` | Update strategy for the stateful set | `RollingUpdate` |
|
||||
| `rollingUpdatePartition` | Partition update strategy | `nil` |
|
||||
| `podLabels` | Kafka pod labels | `{}` (evaluated as a template) |
|
||||
| `podAnnotations` | Kafka Pod annotations | `{}` (evaluated as a template) |
|
||||
| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `priorityClassName` | Name of the existing priority class to be used by kafka pods | `""` |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `podSecurityContext` | Kafka pods' Security Context | `{}` |
|
||||
| `containerSecurityContext` | Kafka containers' Security Context | `{}` |
|
||||
| `resources.limits` | The resources limits for Kafka containers | `{}` |
|
||||
| `resources.requests` | The requested resources for Kafka containers | `{}` |
|
||||
| `livenessProbe` | Liveness probe configuration for Kafka | `Check values.yaml file` |
|
||||
| `readinessProbe` | Readiness probe configuration for Kafka | `Check values.yaml file` |
|
||||
| `customLivenessProbe` | Custom Liveness probe configuration for Kafka | `{}` |
|
||||
| `customReadinessProbe` | Custom Readiness probe configuration for Kafka | `{}` |
|
||||
| `pdb.create` | Enable/disable a Pod Disruption Budget creation | `false` |
|
||||
| `pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `nil` |
|
||||
| `pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable | `1` |
|
||||
| `command` | Override kafka container command | `['/scripts/setup.sh']` (evaluated as a template) |
|
||||
| `args` | Override kafka container arguments | `[]` (evaluated as a template) |
|
||||
| `sidecars` | Attach additional sidecar containers to the Kafka pod | `{}` |
|
||||
|
||||
### Exposure parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `service.type` | Kubernetes Service type | `ClusterIP` |
|
||||
| `service.port` | Kafka port for client connections | `9092` |
|
||||
| `service.internalPort` | Kafka port for inter-broker connections | `9093` |
|
||||
| `service.externalPort` | Kafka port for external connections | `9094` |
|
||||
| `service.nodePorts.client` | Nodeport for client connections | `""` |
|
||||
| `service.nodePorts.external` | Nodeport for external connections | `""` |
|
||||
| `service.loadBalancerIP` | loadBalancerIP for Kafka Service | `nil` |
|
||||
| `service.loadBalancerSourceRanges` | Address(es) that are allowed when service is LoadBalancer | `[]` |
|
||||
| `service.annotations` | Service annotations | `{}`(evaluated as a template) |
|
||||
| `externalAccess.enabled` | Enable Kubernetes external cluster access to Kafka brokers | `false` |
|
||||
| `externalAccess.autoDiscovery.enabled` | Enable using an init container to auto-detect external IPs/ports by querying the K8s API | `false` |
|
||||
| `externalAccess.autoDiscovery.image.registry` | Init container auto-discovery image registry (kubectl) | `docker.io` |
|
||||
| `externalAccess.autoDiscovery.image.repository` | Init container auto-discovery image name (kubectl) | `bitnami/kubectl` |
|
||||
| `externalAccess.autoDiscovery.image.tag` | Init container auto-discovery image tag (kubectl) | `{TAG_NAME}` |
|
||||
| `externalAccess.autoDiscovery.image.pullPolicy` | Init container auto-discovery image pull policy (kubectl) | `Always` |
|
||||
| `externalAccess.autoDiscovery.resources.limits` | Init container auto-discovery resource limits | `{}` |
|
||||
| `externalAccess.autoDiscovery.resources.requests` | Init container auto-discovery resource requests | `{}` |
|
||||
| `externalAccess.service.type` | Kubernetes Service type for external access. It can be NodePort or LoadBalancer | `LoadBalancer` |
|
||||
| `externalAccess.service.port` | Kafka port used for external access when service type is LoadBalancer | `9094` |
|
||||
| `externalAccess.service.loadBalancerIPs` | Array of load balancer IPs for Kafka brokers | `[]` |
|
||||
| `externalAccess.service.loadBalancerSourceRanges` | Address(es) that are allowed when service is LoadBalancer | `[]` |
|
||||
| `externalAccess.service.domain` | Domain or external ip used to configure Kafka external listener when service type is NodePort | `nil` |
|
||||
| `externalAccess.service.nodePorts` | Array of node ports used to configure Kafka external listener when service type is NodePort | `[]` |
|
||||
| `externalAccess.service.annotations` | Service annotations for external access | `{}`(evaluated as a template) |
|
||||
|
||||
### Persistence parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `persistence.enabled` | Enable Kafka data persistence using PVC, note that Zookeeper persistence is unaffected | `true` |
|
||||
| `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template | `nil` |
|
||||
| `persistence.storageClass` | PVC Storage Class for Kafka data volume | `nil` |
|
||||
| `persistence.accessMode` | PVC Access Mode for Kafka data volume | `ReadWriteOnce` |
|
||||
| `persistence.size` | PVC Storage Request for Kafka data volume | `8Gi` |
|
||||
| `persistence.annotations` | Annotations for the PVC | `{}`(evaluated as a template) |
|
||||
|
||||
### RBAC parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `serviceAccount.create` | Enable creation of ServiceAccount for Kafka pods | `true` |
|
||||
| `serviceAccount.name` | Name of the created serviceAccount | Generated using the `kafka.fullname` template |
|
||||
| `rbac.create` | Weather to create & use RBAC resources or not | `false` |
|
||||
|
||||
### Volume Permissions parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `volumePermissions.enabled` | Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup` | `false` |
|
||||
| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` |
|
||||
| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` |
|
||||
| `volumePermissions.image.tag` | Init container volume-permissions image tag | `buster` |
|
||||
| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `Always` |
|
||||
| `volumePermissions.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `volumePermissions.resources.limits` | Init container volume-permissions resource limits | `{}` |
|
||||
| `volumePermissions.resources.requests` | Init container volume-permissions resource requests | `{}` |
|
||||
|
||||
### Metrics parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `metrics.kafka.enabled` | Whether or not to create a standalone Kafka exporter to expose Kafka metrics | `false` |
|
||||
| `metrics.kafka.image.registry` | Kafka exporter image registry | `docker.io` |
|
||||
| `metrics.kafka.image.repository` | Kafka exporter image name | `bitnami/kafka-exporter` |
|
||||
| `metrics.kafka.image.tag` | Kafka exporter image tag | `{TAG_NAME}` |
|
||||
| `metrics.kafka.image.pullPolicy` | Kafka exporter image pull policy | `IfNotPresent` |
|
||||
| `metrics.kafka.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `metrics.kafka.extraFlags` | Extra flags to be passed to Kafka exporter | `{}` |
|
||||
| `metrics.kafka.certificatesSecret` | Name of the existing secret containing the optional certificate and key files | `nil` |
|
||||
| `metrics.kafka.resources.limits` | Kafka Exporter container resource limits | `{}` |
|
||||
| `metrics.kafka.resources.requests` | Kafka Exporter container resource requests | `{}` |
|
||||
| `metrics.kafka.service.type` | Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) for Kafka Exporter | `ClusterIP` |
|
||||
| `metrics.kafka.service.port` | Kafka Exporter Prometheus port | `9308` |
|
||||
| `metrics.kafka.service.nodePort` | Kubernetes HTTP node port | `""` |
|
||||
| `metrics.kafka.service.annotations` | Annotations for Prometheus metrics service | `Check values.yaml file` |
|
||||
| `metrics.kafka.service.loadBalancerIP` | loadBalancerIP if service type is `LoadBalancer` | `nil` |
|
||||
| `metrics.kafka.service.clusterIP` | Static clusterIP or None for headless services | `nil` |
|
||||
| `metrics.jmx.enabled` | Whether or not to expose JMX metrics to Prometheus | `false` |
|
||||
| `metrics.jmx.image.registry` | JMX exporter image registry | `docker.io` |
|
||||
| `metrics.jmx.image.repository` | JMX exporter image name | `bitnami/jmx-exporter` |
|
||||
| `metrics.jmx.image.tag` | JMX exporter image tag | `{TAG_NAME}` |
|
||||
| `metrics.jmx.image.pullPolicy` | JMX exporter image pull policy | `IfNotPresent` |
|
||||
| `metrics.jmx.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `metrics.jmx.resources.limits` | JMX Exporter container resource limits | `{}` |
|
||||
| `metrics.jmx.resources.requests` | JMX Exporter container resource requests | `{}` |
|
||||
| `metrics.jmx.service.type` | Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) for JMX Exporter | `ClusterIP` |
|
||||
| `metrics.jmx.service.port` | JMX Exporter Prometheus port | `5556` |
|
||||
| `metrics.jmx.service.nodePort` | Kubernetes HTTP node port | `""` |
|
||||
| `metrics.jmx.service.annotations` | Annotations for Prometheus metrics service | `Check values.yaml file` |
|
||||
| `metrics.jmx.service.loadBalancerIP` | loadBalancerIP if service type is `LoadBalancer` | `nil` |
|
||||
| `metrics.jmx.service.clusterIP` | Static clusterIP or None for headless services | `nil` |
|
||||
| `metrics.jmx.whitelistObjectNames` | Allows setting which JMX objects you want to expose to via JMX stats to JMX Exporter | (see `values.yaml`) |
|
||||
| `metrics.jmx.config` | Configuration file for JMX exporter | (see `values.yaml`) |
|
||||
| `metrics.jmx.existingConfigmap` | Name of existing ConfigMap with JMX exporter configuration | `nil` |
|
||||
| `metrics.serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (requires `metrics.kafka.enabled` or `metrics.jmx.enabled` to be `true`) | `false` |
|
||||
| `metrics.serviceMonitor.namespace` | Namespace which Prometheus is running in | `monitoring` |
|
||||
| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped | `nil` |
|
||||
| `metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `nil` (Prometheus Operator default value) |
|
||||
| `metrics.serviceMonitor.selector` | ServiceMonitor selector labels | `nil` (Prometheus Operator default value) |
|
||||
|
||||
### Zookeeper chart parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `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 | `[]` |
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
```console
|
||||
helm install my-release \
|
||||
--set replicaCount=3 \
|
||||
bitnami/kafka
|
||||
```
|
||||
|
||||
The above command deploys Kafka with 3 brokers (replicas).
|
||||
|
||||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||
|
||||
```console
|
||||
helm install my-release -f values.yaml bitnami/kafka
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
## Configuration and installation details
|
||||
|
||||
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||
|
||||
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||
|
||||
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||
|
||||
### Production configuration and horizontal scaling
|
||||
|
||||
This chart includes a `values-production.yaml` file where you can find some parameters oriented to production configuration in comparison to the regular `values.yaml`. You can use this file instead of the default one.
|
||||
|
||||
- Number of Kafka nodes:
|
||||
|
||||
```diff
|
||||
- replicaCount: 1
|
||||
+ replicaCount: 3
|
||||
```
|
||||
|
||||
- Allow to use the PLAINTEXT listener:
|
||||
|
||||
```diff
|
||||
- allowPlaintextListener: true
|
||||
+ allowPlaintextListener: false
|
||||
```
|
||||
|
||||
- Default replication factors for automatically created topics:
|
||||
|
||||
```diff
|
||||
- defaultReplicationFactor: 1
|
||||
+ defaultReplicationFactor: 3
|
||||
```
|
||||
|
||||
- Allow auto creation of topics.
|
||||
|
||||
```diff
|
||||
- autoCreateTopicsEnable: true
|
||||
+ autoCreateTopicsEnable: false
|
||||
```
|
||||
|
||||
- The replication factor for the offsets topic:
|
||||
|
||||
```diff
|
||||
- offsetsTopicReplicationFactor: 1
|
||||
+ offsetsTopicReplicationFactor: 3
|
||||
```
|
||||
|
||||
- The replication factor for the transaction topic:
|
||||
|
||||
```diff
|
||||
- transactionStateLogReplicationFactor: 1
|
||||
+ transactionStateLogReplicationFactor: 3
|
||||
```
|
||||
|
||||
- Overridden min.insync.replicas config for the transaction topic:
|
||||
|
||||
```diff
|
||||
- transactionStateLogMinIsr: 1
|
||||
+ transactionStateLogMinIsr: 3
|
||||
```
|
||||
|
||||
- Switch to enable the Kafka SASAL authentication on client and inter-broker communications:
|
||||
|
||||
```diff
|
||||
- auth.clientProtocol: plaintext
|
||||
+ auth.clientProtocol: sasl
|
||||
- auth.interBrokerProtocol: plaintext
|
||||
+ auth.interBrokerProtocol: sasl
|
||||
```
|
||||
|
||||
- Enable Zookeeper authentication:
|
||||
|
||||
```diff
|
||||
+ auth.jaas.zookeeperUser: zookeeperUser
|
||||
+ auth.jaas.zookeeperPassword: zookeeperPassword
|
||||
- zookeeper.auth.enabled: false
|
||||
+ zookeeper.auth.enabled: true
|
||||
+ zookeeper.auth.clientUser: zookeeperUser
|
||||
+ zookeeper.auth.clientPassword: zookeeperPassword
|
||||
+ zookeeper.auth.serverUsers: zookeeperUser
|
||||
+ zookeeper.auth.serverPasswords: zookeeperPassword
|
||||
```
|
||||
|
||||
- Enable Pod Disruption Budget:
|
||||
|
||||
```diff
|
||||
- pdb.create: false
|
||||
+ pdb.create: true
|
||||
```
|
||||
|
||||
- Create a separate Kafka metrics exporter:
|
||||
|
||||
```diff
|
||||
- metrics.kafka.enabled: false
|
||||
+ metrics.kafka.enabled: true
|
||||
```
|
||||
|
||||
- Expose JMX metrics to Prometheus:
|
||||
|
||||
```diff
|
||||
- metrics.jmx.enabled: false
|
||||
+ metrics.jmx.enabled: true
|
||||
```
|
||||
|
||||
- Enable Zookeeper metrics:
|
||||
|
||||
```diff
|
||||
+ zookeeper.metrics.enabled: true
|
||||
```
|
||||
|
||||
To horizontally scale this chart once it has been deployed, you can upgrade the statefulset using a new value for the `replicaCount` parameter. Please note that, when enabling TLS encryption, you must update your JKS secret including the keystore for the new replicas.
|
||||
|
||||
### Setting custom parameters
|
||||
|
||||
Any environment variable beginning with `KAFKA_CFG_` will be mapped to its corresponding Kafka key. For example, use `KAFKA_CFG_BACKGROUND_THREADS` in order to set `background.threads`. In order to pass custom environment variables use the `extraEnvVars` property.
|
||||
|
||||
### Listeners configuration
|
||||
|
||||
This chart allows you to automatically configure Kafka with 3 listeners:
|
||||
|
||||
- One for inter-broker communications.
|
||||
- A second one for communications with clients within the K8s cluster.
|
||||
- (optional) a third listener for communications with clients outside the K8s cluster. Check [this section](#accessing-kafka-brokers-from-outside-the-clusters) for more information.
|
||||
|
||||
For more complex configurations, set the `listeners`, `advertisedListeners` and `listenerSecurityProtocolMap` parameters as needed.
|
||||
|
||||
### Enable security for Kafka and Zookeeper
|
||||
|
||||
You can configure different authentication protocols for each listener you configure in Kafka. For instance, you can use `sasl_tls` authentication for client communications, while using `tls` for inter-broker communications. This table shows the available protocols and the security they provide:
|
||||
|
||||
| Method | Authentication | Encryption via TLS |
|
||||
|-----------|-------------------------------|--------------------|
|
||||
| plaintext | None | No |
|
||||
| tls | None | Yes |
|
||||
| mtls | Yes (two-way authentication) | Yes |
|
||||
| sasl | Yes (via SASL) | No |
|
||||
| sasl_tls | Yes (via SASL) | Yes |
|
||||
|
||||
If you enabled SASL authentication on any listener, you can set the SASL credentials using the parameters below:
|
||||
|
||||
- `auth.jaas.clientUsers`/`auth.jaas.clientPasswords`: when enabling SASL authentication for communications with clients.
|
||||
- `auth.jaas.interBrokerUser`/`auth.jaas.interBrokerPassword`: when enabling SASL authentication for inter-broker communications.
|
||||
- `auth.jaas.zookeeperUser`/`auth.jaas.zookeeperPassword`: In the case that the Zookeeper chart is deployed with SASL authentication enabled.
|
||||
|
||||
In order to configure TLS authentication/encryption, you **must** create a secret containing the Java Key Stores (JKS) files: the truststore (`kafka.truststore.jks`) and one keystore (`kafka.keystore.jks`) per Kafka broker you have in the cluster. Then, you need pass the secret name with the `--auth.jksSecret` parameter when deploying the chart.
|
||||
|
||||
> **Note**: If the JKS files are password protected (recommended), you will need to provide the password to get access to the keystores. To do so, use the `auth.jksPassword` parameter to provide your password.
|
||||
|
||||
For instance, to configure TLS authentication on a Kafka cluster with 2 Kafka brokers use the command below to create the secret:
|
||||
|
||||
```console
|
||||
kubectl create secret generic kafka-jks --from-file=./kafka.truststore.jks --from-file=./kafka-0.keystore.jks --from-file=./kafka-1.keystore.jks
|
||||
```
|
||||
|
||||
> **Note**: the command above assumes you already created the trustore and keystores files. This [script](https://raw.githubusercontent.com/confluentinc/confluent-platform-security-tools/master/kafka-generate-ssl.sh) can help you with the JKS files generation.
|
||||
|
||||
As an alternative to manually create the secret before installing the chart, you can put your JKS files inside the chart folder `files/jks`, an a secret including them will be generated. Please note this alternative requires to have the chart downloaded locally, so you will have to clone this repository or fetch the chart before installing it.
|
||||
|
||||
You can deploy the chart with authentication using the following parameters:
|
||||
|
||||
```console
|
||||
replicaCount=2
|
||||
auth.clientProtocol=sasl
|
||||
auth.interBrokerProtocol=tls
|
||||
auth.certificatesSecret=kafka-jks
|
||||
auth.certificatesPassword=jksPassword
|
||||
auth.jaas.clientUsers[0]=brokerUser
|
||||
auth.jaas.clientPassword[0]=brokerPassword
|
||||
auth.jaas.zookeeperUser=zookeeperUser
|
||||
auth.jaas.zookeeperPassword=zookeeperPassword
|
||||
zookeeper.auth.enabled=true
|
||||
zookeeper.auth.serverUsers=zookeeperUser
|
||||
zookeeper.auth.serverPasswords=zookeeperPassword
|
||||
zookeeper.auth.clientUser=zookeeperUser
|
||||
zookeeper.auth.clientPassword=zookeeperPassword
|
||||
```
|
||||
|
||||
If you also enable exposing metrics using the Kafka expoter, and you are using `sasl_tls`, `tls`, or `mtls` authentication protocols, you need to mount the CA certificated used to sign the brokers certificates in the exporter so it can validate the Kafka brokers. To do so, create a secret containing the CA, and set the `metrics.certificatesSecret` parameter. As an alternative, you can skip TLS validation using extra flags:
|
||||
|
||||
```console
|
||||
metrics.kafka.extraFlags={tls.insecure-skip-tls-verify: ""}
|
||||
```
|
||||
|
||||
### Accessing Kafka brokers from outside the cluster
|
||||
|
||||
In order to access Kafka Brokers from outside the cluster, an additional listener and advertised listener must be configured. Additionally, a specific service per kafka pod will be created.
|
||||
|
||||
There are two ways of configuring external access. Using LoadBalancer services or using NodePort services.
|
||||
|
||||
#### Using LoadBalancer services
|
||||
|
||||
You have two alternatives to use LoadBalancer services:
|
||||
|
||||
- Option A) Use random load balancer IPs using an **initContainer** that waits for the IPs to be ready and discover them automatically.
|
||||
|
||||
```console
|
||||
externalAccess.enabled=true
|
||||
externalAccess.service.type=LoadBalancer
|
||||
externalAccess.service.port=9094
|
||||
externalAccess.autoDiscovery.enabled=true
|
||||
serviceAccount.create=true
|
||||
rbac.create=true
|
||||
```
|
||||
|
||||
Note: This option requires creating RBAC rules on clusters where RBAC policies are enabled.
|
||||
|
||||
- Option B) Manually specify the load balancer IPs:
|
||||
|
||||
```console
|
||||
externalAccess.enabled=true
|
||||
externalAccess.service.type=LoadBalancer
|
||||
externalAccess.service.port=9094
|
||||
externalAccess.service.loadBalancerIPs[0]='external-ip-1'
|
||||
externalAccess.service.loadBalancerIPs[1]='external-ip-2'}
|
||||
```
|
||||
|
||||
Note: You need to know in advance the load balancer IPs so each Kafka broker advertised listener is configured with it.
|
||||
|
||||
#### Using NodePort services
|
||||
|
||||
You have two alternatives to use NodePort services:
|
||||
|
||||
- Option A) Use random node ports using an **initContainer** that discover them automatically.
|
||||
|
||||
```console
|
||||
externalAccess.enabled=true
|
||||
externalAccess.service.type=NodePort
|
||||
externalAccess.autoDiscovery.enabled=true
|
||||
serviceAccount.create=true
|
||||
rbac.create=true
|
||||
```
|
||||
|
||||
Note: This option requires creating RBAC rules on clusters where RBAC policies are enabled.
|
||||
|
||||
- Option B) Manually specify the node ports:
|
||||
|
||||
```console
|
||||
externalAccess.enabled=true
|
||||
externalAccess.service.type=NodePort
|
||||
externalAccess.serivce.nodePorts[0]='node-port-1'
|
||||
externalAccess.serivce.nodePorts[1]='node-port-2'
|
||||
```
|
||||
|
||||
Note: You need to know in advance the node ports that will be exposed so each Kafka broker advertised listener is configured with it.
|
||||
|
||||
The pod will try to get the external ip of the node using `curl -s https://ipinfo.io/ip` unless `externalAccess.service.domain` is provided.
|
||||
|
||||
Following the aforementioned steps will also allow to connect the brokers from the outside using the cluster's default service (when `service.type` is `LoadBalancer` or `NodePort`). Use the property `service.externalPort` to specify the port used for external connections.
|
||||
|
||||
### Sidecars
|
||||
|
||||
If you have a need for additional containers to run within the same pod as Kafka (e.g. an additional metrics or logging exporter), you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec.
|
||||
|
||||
```yaml
|
||||
sidecars:
|
||||
- name: your-image-name
|
||||
image: your-image
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: portname
|
||||
containerPort: 1234
|
||||
```
|
||||
|
||||
### Deploying extra resources
|
||||
|
||||
There are cases where you may want to deploy extra objects, such as Kafka Connect. For covering this case, the chart allows adding the full specification of other objects using the `extraDeploy` parameter. The following example would create a deployment including a Kafka Connect deployment so you can connect Kafka with MongoDB:
|
||||
|
||||
```yaml
|
||||
## Extra objects to deploy (value evaluated as a template)
|
||||
##
|
||||
extraDeploy: |-
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "kafka.fullname" . }}-connect
|
||||
labels: {{- include "kafka.labels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: connector
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: {{- include "kafka.matchLabels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: connector
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "kafka.labels" . | nindent 10 }}
|
||||
app.kubernetes.io/component: connector
|
||||
spec:
|
||||
containers:
|
||||
- name: connect
|
||||
image: KAFKA-CONNECT-IMAGE
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: connector
|
||||
containerPort: 8083
|
||||
volumeMounts:
|
||||
- name: configuration
|
||||
mountPath: /opt/bitnami/kafka/config
|
||||
volumes:
|
||||
- name: configuration
|
||||
configMap:
|
||||
name: {{ include "kafka.fullname" . }}-connect
|
||||
- apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "kafka.fullname" . }}-connect
|
||||
labels: {{- include "kafka.labels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: connector
|
||||
data:
|
||||
connect-standalone.properties: |-
|
||||
bootstrap.servers = {{ include "kafka.fullname" . }}-0.{{ include "kafka.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.service.port }}
|
||||
...
|
||||
mongodb.properties: |-
|
||||
connection.uri=mongodb://root:password@mongodb-hostname:27017
|
||||
...
|
||||
- apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "kafka.fullname" . }}-connect
|
||||
labels: {{- include "kafka.labels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: connector
|
||||
spec:
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8083
|
||||
targetPort: connector
|
||||
selector: {{- include "kafka.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: connector
|
||||
```
|
||||
|
||||
You can create the Kafka Connect image using the Dockerfile below:
|
||||
|
||||
```Dockerfile
|
||||
FROM bitnami/kafka:latest
|
||||
# Download MongoDB Connector for Apache Kafka https://www.confluent.io/hub/mongodb/kafka-connect-mongodb
|
||||
RUN mkdir -p /opt/bitnami/kafka/plugins && \
|
||||
cd /opt/bitnami/kafka/plugins && \
|
||||
curl --remote-name --location --silent https://search.maven.org/remotecontent?filepath=org/mongodb/kafka/mongo-kafka-connect/1.2.0/mongo-kafka-connect-1.2.0-all.jar
|
||||
CMD /opt/bitnami/kafka/bin/connect-standalone.sh /opt/bitnami/kafka/config/connect-standalone.properties /opt/bitnami/kafka/config/mongo.properties
|
||||
```
|
||||
|
||||
## Persistence
|
||||
|
||||
The [Bitnami Kafka](https://github.com/bitnami/bitnami-docker-kafka) image stores the Kafka data at the `/bitnami/kafka` path of the container.
|
||||
|
||||
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. See the [Parameters](#persistence-parameters) 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
|
||||
|
||||
### To 11.8.0
|
||||
|
||||
External access to brokers can now be archived through the cluster's Kafka service.
|
||||
|
||||
- `service.nodePort` -> deprecated in favor of `service.nodePorts.client` and `service.nodePorts.external`
|
||||
|
||||
### To 11.7.0
|
||||
|
||||
The way to configure the users and passwords changed. Now it is allowed to create multiple users during the installation by providing the list of users and passwords.
|
||||
|
||||
- `auth.jaas.clientUser` (string) -> deprecated in favor of `auth.jaas.clientUsers` (array).
|
||||
- `auth.jaas.clientPassword` (string) -> deprecated in favor of `auth.jaas.clientPasswords` (array).
|
||||
|
||||
### To 11.0.0
|
||||
|
||||
The way to configure listeners and authentication on Kafka is totally refactored allowing users to configure different authentication protocols on different listeners. Please check the sections [Listeners Configuration](listeners-configuration) and [Listeners Configuration](enable-kafka-for-kafka-and-zookeeper) for more information.
|
||||
|
||||
Backwards compatibility is not guaranteed you adapt your values.yaml to the new format. Here you can find some parameters that were renamed or disappeared in favor of new ones on this major version:
|
||||
|
||||
- `auth.enabled` -> deprecated in favor of `auth.clientProtocol` and `auth.interBrokerProtocol` parameters.
|
||||
- `auth.ssl` -> deprecated in favor of `auth.clientProtocol` and `auth.interBrokerProtocol` parameters.
|
||||
- `auth.certificatesSecret` -> renamed to `auth.jksSecret`.
|
||||
- `auth.certificatesPassword` -> renamed to `auth.jksPassword`.
|
||||
- `sslEndpointIdentificationAlgorithm` -> renamedo to `auth.tlsEndpointIdentificationAlgorithm`.
|
||||
- `auth.interBrokerUser` -> renamed to `auth.jaas.interBrokerUser`
|
||||
- `auth.interBrokerPassword` -> renamed to `auth.jaas.interBrokerPassword`
|
||||
- `auth.zookeeperUser` -> renamed to `auth.jaas.zookeeperUser`
|
||||
- `auth.zookeeperPassword` -> renamed to `auth.jaas.zookeeperPassword`
|
||||
- `auth.existingSecret` -> renamed to `auth.jaas.existingSecret`
|
||||
- `service.sslPort` -> deprecated in favor of `service.internalPort`
|
||||
- `service.nodePorts.kafka` and `service.nodePorts.ssl` -> deprecated in favor of `service.nodePort`
|
||||
- `metrics.kafka.extraFlag` -> new parameter
|
||||
- `metrics.kafka.certificatesSecret` -> new parameter
|
||||
|
||||
### To 10.0.0
|
||||
|
||||
If you are setting the `config` or `log4j` parameter, backwards compatibility is not guaranteed, because the `KAFKA_MOUNTED_CONFDIR` has moved from `/opt/bitnami/kafka/conf` to `/bitnami/kafka/config`. In order to continue using these parameters, you must also upgrade your image to `docker.io/bitnami/kafka:2.4.1-debian-10-r38` or later.
|
||||
|
||||
### To 9.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed you adapt your values.yaml to the new format. Here you can find some parameters that were renamed on this major version:
|
||||
|
||||
```diff
|
||||
- securityContext.enabled
|
||||
- securityContext.fsGroup
|
||||
- securityContext.fsGroup
|
||||
+ podSecurityContext
|
||||
- externalAccess.service.loadBalancerIP
|
||||
+ externalAccess.service.loadBalancerIPs
|
||||
- externalAccess.service.nodePort
|
||||
+ externalAccess.service.nodePorts
|
||||
- metrics.jmx.configMap.enabled
|
||||
- metrics.jmx.configMap.overrideConfig
|
||||
+ metrics.jmx.config
|
||||
- metrics.jmx.configMap.overrideName
|
||||
+ metrics.jmx.existingConfigmap
|
||||
```
|
||||
|
||||
Ports names were prefixed with the protocol to comply with Istio (see https://istio.io/docs/ops/deployment/requirements/).
|
||||
|
||||
### To 8.0.0
|
||||
|
||||
There is not backwards compatibility since the brokerID changes to the POD_NAME. For more information see [this PR](https://github.com/bitnami/charts/pull/2028).
|
||||
|
||||
### To 7.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed when Kafka metrics are enabled, unless you modify the labels used on the exporter deployments.
|
||||
Use the workaround below to upgrade from versions previous to 7.0.0. The following example assumes that the release name is kafka:
|
||||
|
||||
```console
|
||||
helm upgrade kafka bitnami/kafka --version 6.1.8 --set metrics.kafka.enabled=false
|
||||
helm upgrade kafka bitnami/kafka --version 7.0.0 --set metrics.kafka.enabled=true
|
||||
```
|
||||
|
||||
### To 2.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||
Use the workaround below to upgrade from versions previous to 2.0.0. The following example assumes that the release name is kafka:
|
||||
|
||||
```console
|
||||
kubectl delete statefulset kafka-kafka --cascade=false
|
||||
kubectl delete statefulset kafka-zookeeper --cascade=false
|
||||
```
|
||||
|
||||
### To 1.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||
Use the workaround below to upgrade from versions previous to 1.0.0. The following example assumes that the release name is kafka:
|
||||
|
||||
```console
|
||||
kubectl delete statefulset kafka-kafka --cascade=false
|
||||
kubectl delete statefulset kafka-zookeeper --cascade=false
|
||||
```
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
annotations:
|
||||
category: Infrastructure
|
||||
apiVersion: v1
|
||||
appVersion: 3.6.2
|
||||
description: A centralized service for maintaining configuration information, naming,
|
||||
providing distributed synchronization, and providing group services for distributed
|
||||
applications.
|
||||
engine: gotpl
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/zookeeper
|
||||
icon: https://bitnami.com/assets/stacks/zookeeper/img/zookeeper-stack-110x117.png
|
||||
keywords:
|
||||
- zookeeper
|
||||
maintainers:
|
||||
- email: containers@bitnami.com
|
||||
name: Bitnami
|
||||
name: zookeeper
|
||||
sources:
|
||||
- https://github.com/bitnami/bitnami-docker-zookeeper
|
||||
- https://zookeeper.apache.org/
|
||||
version: 5.21.9
|
||||
|
|
@ -1,297 +0,0 @@
|
|||
# ZooKeeper
|
||||
|
||||
[ZooKeeper](https://zookeeper.apache.org/) is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. All of these kinds of services are used in some form or other by distributed applications.
|
||||
|
||||
## TL;DR
|
||||
|
||||
```console
|
||||
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
$ helm install my-release bitnami/zookeeper
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart bootstraps a [ZooKeeper](https://github.com/bitnami/bitnami-docker-zookeeper) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||
|
||||
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes 1.12+
|
||||
- Helm 2.12+ or Helm 3.0-beta3+
|
||||
- PV provisioner support in the underlying infrastructure
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```console
|
||||
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
$ helm install my-release bitnami/zookeeper
|
||||
```
|
||||
|
||||
These commands deploy ZooKeeper on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
|
||||
|
||||
> **Tip**: List all releases using `helm list`
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the `my-release` deployment:
|
||||
|
||||
```console
|
||||
$ helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Parameters
|
||||
|
||||
The following tables lists the configurable parameters of the ZooKeeper chart and their default values per section/component:
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `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.storageClass` | Global storage class for dynamic provisioning | `nil` |
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `nameOverride` | String to partially override zookeeper.fullname | `nil` |
|
||||
| `fullnameOverride` | String to fully override zookeeper.fullname | `nil` |
|
||||
| `clusterDomain` | Default Kubernetes cluster domain | `cluster.local` |
|
||||
| `commonLabels` | Labels to add to all deployed objects | `{}` |
|
||||
| `commonAnnotations` | Annotations to add to all deployed objects | `{}` |
|
||||
| `schedulerName` | Kubernetes pod scheduler registry | `nil` (use the default-scheduler) |
|
||||
|
||||
### Zookeeper chart parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `image.registry` | ZooKeeper image registry | `docker.io` |
|
||||
| `image.repository` | ZooKeeper Image name | `bitnami/zookeeper` |
|
||||
| `image.tag` | ZooKeeper Image tag | `{TAG_NAME}` |
|
||||
| `image.pullPolicy` | ZooKeeper image pull policy | `IfNotPresent` |
|
||||
| `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` |
|
||||
| `tickTime` | Basic time unit in milliseconds used by ZooKeeper for heartbeats | `2000` |
|
||||
| `initLimit` | Time the ZooKeeper servers in quorum have to connect to a leader | `10` |
|
||||
| `syncLimit` | How far out of date a server can be from a leader | `5` |
|
||||
| `maxClientCnxns` | Number of concurrent connections that a single client may make to a single member | `60` |
|
||||
| `maxSessionTimeout` | Maximum session timeout in milliseconds that the server will allow the client to negotiate. | `40000` |
|
||||
| `autopurge.snapRetainCount` | Number of retains snapshots for autopurge | `3` |
|
||||
| `autopurge.purgeInterval` | The time interval in hours for which the purge task has to be triggered | `0` |
|
||||
| `fourlwCommandsWhitelist` | A list of comma separated Four Letter Words commands to use | `srvr, mntr` |
|
||||
| `listenOnAllIPs` | Allow Zookeeper to listen for connections from its peers on all available IP addresses. | `false` |
|
||||
| `allowAnonymousLogin` | Allow to accept connections from unauthenticated users | `yes` |
|
||||
| `auth.existingSecret` | Use existing secret (ignores previous password) | `nil` |
|
||||
| `auth.enabled` | Enable ZooKeeper auth | `false` |
|
||||
| `auth.clientUser` | User that will use ZooKeeper clients to auth | `nil` |
|
||||
| `auth.clientPassword` | Password that will use ZooKeeper clients to auth | `nil` |
|
||||
| `auth.serverUsers` | List of user to be created | `nil` |
|
||||
| `auth.serverPasswords` | List of passwords to assign to users when created | `nil` |
|
||||
| `heapSize` | Size in MB for the Java Heap options (Xmx and XMs) | `[]` |
|
||||
| `logLevel` | Log level of ZooKeeper server | `ERROR` |
|
||||
| `jvmFlags` | Default JVMFLAGS for the ZooKeeper process | `nil` |
|
||||
| `config` | Configure ZooKeeper with a custom zoo.conf file | `nil` |
|
||||
| `dataLogDir` | Data log directory | `""` |
|
||||
|
||||
### Statefulset parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `replicaCount` | Number of ZooKeeper nodes | `1` |
|
||||
| `updateStrategy` | Update strategy for the statefulset | `RollingUpdate` |
|
||||
| `rollingUpdatePartition` | Partition update strategy | `nil` |
|
||||
| `podManagementPolicy` | Pod management policy | `Parallel` |
|
||||
| `podLabels` | ZooKeeper pod labels | `{}` (evaluated as a template) |
|
||||
| `podAnnotations` | ZooKeeper Pod annotations | `{}` (evaluated as a template) |
|
||||
| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `priorityClassName` | Name of the existing priority class to be used by ZooKeeper pods | `""` |
|
||||
| `securityContext.enabled` | Enable security context (ZooKeeper master pod) | `true` |
|
||||
| `securityContext.fsGroup` | Group ID for the container (ZooKeeper master pod) | `1001` |
|
||||
| `securityContext.runAsUser` | User ID for the container (ZooKeeper master pod) | `1001` |
|
||||
| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `250m` |
|
||||
| `livenessProbe` | Liveness probe configuration for ZooKeeper | Check `values.yaml` file |
|
||||
| `readinessProbe` | Readiness probe configuration for ZooKeeper | Check `values.yaml` file |
|
||||
| `extraVolumes` | Extra volumes | `nil` |
|
||||
| `extraVolumeMounts` | Mount extra volume(s) | `nil` |
|
||||
| `podDisruptionBudget.maxUnavailable` | Max number of pods down simultaneously | `1` |
|
||||
|
||||
### Exposure parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `service.type` | Kubernetes Service type | `ClusterIP` |
|
||||
| `service.port` | ZooKeeper port | `2181` |
|
||||
| `service.followerPort` | ZooKeeper follower port | `2888` |
|
||||
| `service.electionPort` | ZooKeeper election port | `3888` |
|
||||
| `service.publishNotReadyAddresses` | If the ZooKeeper headless service should publish DNS records for not ready pods | `true` |
|
||||
| `serviceAccount.create` | Enable creation of ServiceAccount for zookeeper pod | `false` |
|
||||
| `serviceAccount.name` | The name of the service account to use. If not set and `create` is `true`, a name is generated | Generated using the `zookeeper.fullname` template |
|
||||
| `service.tls.client_enable` | Enable tls for client connections | `false` |
|
||||
| `service.tls.quorum_enable` | Enable tls for quorum protocol | `false` |
|
||||
| `service.tls.disable_base_client_port` | Remove client port from service definitions. | `false` |
|
||||
| `service.tls.client_port` | Service port for tls client connections | `3181` |
|
||||
| `service.tls.client_keystore_path` | KeyStore file path. Refer to extraVolumes and extraVolumeMounts for mounting files into the pods | `/tls_key_store/key_store_file` |
|
||||
| `service.tls.client_keystore_password` | KeyStore password. You can use environment variables. | `nil` |
|
||||
| `service.tls.client_truststore_path` | TrustStore file path. Refer to extraVolumes and extraVolumeMounts for mounting files into the pods | `/tls_trust_store/trust_store_file` |
|
||||
| `service.tls.client_truststore_password` | TrustStore password. You can use environment variables. | `nil` |
|
||||
| `service.tls.quorum_keystore_path` | KeyStore file path. Refer to extraVolumes and extraVolumeMounts for mounting files into the pods | `/tls_key_store/key_store_file` |
|
||||
| `service.tls.quorum_keystore_password` | KeyStore password. You can use environment variables. | `nil` |
|
||||
| `service.tls.quorum_truststore_path` | TrustStore file path. Refer to extraVolumes and extraVolumeMounts for mounting files into the pods | `/tls_trust_store/trust_store_file` |
|
||||
| `service.tls.quorum_truststore_password` | TrustStore password. You can use environment variables. | `nil` |
|
||||
| `service.annotations` | Annotations for the Service | `{}` |
|
||||
| `service.headless.annotations` | Annotations for the Headless Service | `{}` |
|
||||
| `networkPolicy.enabled` | Enable NetworkPolicy | `false` |
|
||||
| `networkPolicy.allowExternal` | Don't require client label for connections | `true` |
|
||||
|
||||
### Persistence parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `persistence.enabled` | Enable Zookeeper data persistence using PVC | `true` |
|
||||
| `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim` | `nil` (evaluated as a template) |
|
||||
| `persistence.storageClass` | PVC Storage Class for ZooKeeper data volume | `nil` |
|
||||
| `persistence.accessMode` | PVC Access Mode for ZooKeeper data volume | `ReadWriteOnce` |
|
||||
| `persistence.size` | PVC Storage Request for ZooKeeper data volume | `8Gi` |
|
||||
| `persistence.annotations` | Annotations for the PVC | `{}` (evaluated as a template) |
|
||||
| `persistence.dataLogDir.size` | PVC Storage Request for ZooKeeper's Data log directory | `8Gi` |
|
||||
| `persistence.dataLogDir.existingClaim` | Provide an existing `PersistentVolumeClaim` for Zookeeper's Data log directory | `nil` (evaluated as a template) |
|
||||
|
||||
### Volume Permissions parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `volumePermissions.enabled` | Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup` | `false` |
|
||||
| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` |
|
||||
| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` |
|
||||
| `volumePermissions.image.tag` | Init container volume-permissions image tag | `buster` |
|
||||
| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `Always` |
|
||||
| `volumePermissions.resources` | Init container resource requests/limit | `nil` |
|
||||
|
||||
### Metrics parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|-------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
|
||||
| `metrics.enabled` | Enable prometheus to access zookeeper metrics endpoint | `false` |
|
||||
| `metrics.containerPort` | Port where a Jetty server will expose Prometheus metrics | `9141` |
|
||||
| `metrics.service.type` | Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) for Jetty server exposing Prometheus metrics | `ClusterIP` |
|
||||
| `metrics.service.port` | Prometheus metrics service port | `9141` |
|
||||
| `metrics.service.annotations` | Service annotations for Prometheus to auto-discover the metrics endpoint | `{prometheus.io/scrape: "true", prometheus.io/port: "9141"}` |
|
||||
| `metrics.serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) | `false` |
|
||||
| `metrics.serviceMonitor.namespace` | Namespace for the ServiceMonitor Resource | The Release Namespace |
|
||||
| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped. | `nil` (Prometheus Operator default value) |
|
||||
| `metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `nil` (Prometheus Operator default value) |
|
||||
| `metrics.serviceMonitor.selector` | Prometheus instance selector labels | `nil` |
|
||||
| `metrics.prometheusRule.enabled` | if `true`, creates a Prometheus Operator PrometheusRule (also requires `metrics.enabled` to be `true` and `metrics.prometheusRule.rules`) | `false` |
|
||||
| `metrics.prometheusRule.namespace` | Namespace for the PrometheusRule Resource | The Release Namespace |
|
||||
| `metrics.prometheusRule.selector` | Prometheus instance selector labels | `nil` |
|
||||
| `metrics.prometheusRule.rules` | Prometheus Rule definitions (see values.yaml for examples) | `[]` |
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
```console
|
||||
$ helm install my-release \
|
||||
--set auth.clientUser=newUser \
|
||||
bitnami/zookeeper
|
||||
```
|
||||
|
||||
The above command sets the ZooKeeper user to `newUser`.
|
||||
|
||||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||
|
||||
```console
|
||||
$ helm install my-release -f values.yaml bitnami/zookeeper
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
## Configuration and installation details
|
||||
|
||||
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||
|
||||
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||
|
||||
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||
|
||||
### Production configuration
|
||||
|
||||
This chart includes a `values-production.yaml` file where you can find some parameters oriented to production configuration in comparison to the regular `values.yaml`. You can use this file instead of the default one.
|
||||
|
||||
- Number of ZooKeeper nodes:
|
||||
|
||||
```diff
|
||||
- replicaCount: 1
|
||||
+ replicaCount: 3
|
||||
```
|
||||
|
||||
- Enable prometheus metrics:
|
||||
|
||||
```diff
|
||||
- metrics.enabled: false
|
||||
+ metrics.enabled: true
|
||||
```
|
||||
|
||||
### Log level
|
||||
|
||||
You can configure the ZooKeeper log level using the `ZOO_LOG_LEVEL` environment variable. By default, it is set to `ERROR` because of each readiness probe produce an `INFO` message on connection and a `WARN` message on disconnection.
|
||||
|
||||
## Persistence
|
||||
|
||||
The [Bitnami ZooKeeper](https://github.com/bitnami/bitnami-docker-zookeeper) image stores the ZooKeeper data and configurations at the `/bitnami/zookeeper` path of the container.
|
||||
|
||||
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube.
|
||||
See the [Parameters](#parameters) 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`.
|
||||
|
||||
### Data Log Directory
|
||||
|
||||
You can use a dedicated device for logs (instead of using the data directory) to help avoiding competition between logging and snapshots. To do so, set the `dataLogDir` parameter with the path to be used for writing transaction logs. Alternatively, set this parameter with an empty string an it result in the log being written to the data directory (Zookeeper's default behavior).
|
||||
|
||||
When using a dedicated device for logs, you can use a PVC to persist the logs. To do so, set `persistence.enabled` to `true`. See the [Persistence Parameters](#persistence-parameters) section for more information.
|
||||
|
||||
## Upgrading
|
||||
|
||||
### To 5.21.0
|
||||
|
||||
A couple of parameters related to Zookeeper metrics were renamed or disappeared in favor of new ones:
|
||||
|
||||
- `metrics.port` is renamed to `metrics.containerPort`.
|
||||
- `metrics.annotations` is deprecated in favor of `metrics.service.annotations`.
|
||||
|
||||
### To 3.0.0
|
||||
|
||||
This new version of the chart includes the new ZooKeeper major version 3.5.5. Note that to perform an automatic upgrade
|
||||
of the application, each node will need to have at least one snapshot file created in the data directory. If not, the
|
||||
new version of the application won't be able to start the service. Please refer to [ZOOKEEPER-3056](https://issues.apache.org/jira/browse/ZOOKEEPER-3056)
|
||||
in order to find ways to workaround this issue in case you are facing it.
|
||||
|
||||
### To 2.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's statefulsets.
|
||||
Use the workaround below to upgrade from versions previous to 2.0.0. The following example assumes that the release name is `zookeeper`:
|
||||
|
||||
```console
|
||||
$ kubectl delete statefulset zookeeper-zookeeper --cascade=false
|
||||
```
|
||||
|
||||
### To 1.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||
Use the workaround below to upgrade from versions previous to 1.0.0. The following example assumes that the release name is zookeeper:
|
||||
|
||||
```console
|
||||
$ kubectl delete statefulset zookeeper-zookeeper --cascade=false
|
||||
```
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
{{- if contains .Values.service.type "LoadBalancer" }}
|
||||
{{- if not .Values.auth.clientPassword }}
|
||||
-------------------------------------------------------------------------------
|
||||
WARNING
|
||||
|
||||
By specifying "serviceType=LoadBalancer" and not specifying "auth.enabled=true"
|
||||
you have most likely exposed the ZooKeeper service externally without any
|
||||
authentication mechanism.
|
||||
|
||||
For security reasons, we strongly suggest that you switch to "ClusterIP" or
|
||||
"NodePort". As alternative, you can also specify a valid password on the
|
||||
"auth.clientPassword" parameter.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
** Please be patient while the chart is being deployed **
|
||||
|
||||
ZooKeeper can be accessed via port 2181 on the following DNS name from within your cluster:
|
||||
|
||||
{{ template "zookeeper.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
|
||||
|
||||
To connect to your ZooKeeper server run the following commands:
|
||||
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "zookeeper.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=zookeeper" -o jsonpath="{.items[0].metadata.name}")
|
||||
kubectl exec -it $POD_NAME -- zkCli.sh
|
||||
|
||||
To connect to your ZooKeeper server from outside the cluster execute the following commands:
|
||||
|
||||
{{- if contains "NodePort" .Values.service.type }}
|
||||
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "zookeeper.fullname" . }})
|
||||
zkCli.sh $NODE_IP:$NODE_PORT
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "zookeeper.fullname" . }}'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "zookeeper.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
zkCli.sh $SERVICE_IP:2181
|
||||
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "zookeeper.fullname" . }} 2181:2181 &
|
||||
zkCli.sh 127.0.0.1:2181
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
|
||||
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
|
||||
{{- end }}
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "zookeeper.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "zookeeper.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "zookeeper.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "zookeeper.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "zookeeper.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Zookeeper image name
|
||||
*/}}
|
||||
{{- define "zookeeper.image" -}}
|
||||
{{- $registryName := .Values.image.registry -}}
|
||||
{{- $repositoryName := .Values.image.repository -}}
|
||||
{{- $tag := .Values.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "zookeeper.imagePullSecrets" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Also, we can not use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- else if or .Values.image.pullSecrets .Values.volumePermissions.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumePermissions.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- else if or .Values.image.pullSecrets .Values.volumePermissions.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumePermissions.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "zookeeper.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "zookeeper.name" . }}
|
||||
helm.sh/chart: {{ include "zookeeper.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Renders a value that contains template.
|
||||
Usage:
|
||||
{{ include "zookeeper.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||
*/}}
|
||||
{{- define "zookeeper.tplValue" -}}
|
||||
{{- if typeIs "string" .value }}
|
||||
{{- tpl .value .context }}
|
||||
{{- else }}
|
||||
{{- tpl (.value | toYaml) .context }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||
*/}}
|
||||
{{- define "zookeeper.matchLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "zookeeper.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return ZooKeeper Client Password
|
||||
*/}}
|
||||
{{- define "zookeeper.clientPassword" -}}
|
||||
{{- if .Values.auth.clientPassword -}}
|
||||
{{- .Values.auth.clientPassword -}}
|
||||
{{- else -}}
|
||||
{{- randAlphaNum 10 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return ZooKeeper Servers Passwords
|
||||
*/}}
|
||||
{{- define "zookeeper.serverPasswords" -}}
|
||||
{{- if .Values.auth.serverPasswords -}}
|
||||
{{- .Values.auth.serverPasswords -}}
|
||||
{{- else -}}
|
||||
{{- randAlphaNum 10 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the init container volume-permissions image)
|
||||
*/}}
|
||||
{{- define "zookeeper.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "zookeeper.storageClass" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
{{- if .Values.config }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
zoo.cfg: |-
|
||||
{{ .Values.config | indent 4 }}
|
||||
{{- end -}}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
{{- if .Values.metrics.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}-metrics
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.metrics.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.metrics.service.annotations }}
|
||||
{{ include "zookeeper.tplValue" ( dict "value" .Values.metrics.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.metrics.service.type }}
|
||||
ports:
|
||||
- name: tcp-metrics
|
||||
port: {{ .Values.metrics.service.port }}
|
||||
targetPort: metrics
|
||||
selector: {{- include "zookeeper.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- end }}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
{{- if .Values.networkPolicy.enabled }}
|
||||
kind: NetworkPolicy
|
||||
apiVersion: networking.k8s.io/v1
|
||||
metadata:
|
||||
name: {{ include "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 6 }}
|
||||
ingress:
|
||||
# Allow inbound connections to zookeeper
|
||||
- ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
from:
|
||||
{{- if not .Values.networkPolicy.allowExternal }}
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
{{ include "zookeeper.fullname" . }}-client: "true"
|
||||
- podSelector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 14 }}
|
||||
{{- else }}
|
||||
- podSelector:
|
||||
matchLabels: {}
|
||||
{{- end }}
|
||||
# Internal ports
|
||||
- ports: &intranodes_ports
|
||||
- port: {{ .Values.service.followerPort }}
|
||||
- port: {{ .Values.service.electionPort }}
|
||||
from:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 14 }}
|
||||
egress:
|
||||
- ports: *intranodes_ports
|
||||
# Allow outbound connections from zookeeper nodes
|
||||
|
||||
{{- end }}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- if gt $replicaCount 1 }}
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- toYaml .Values.podDisruptionBudget | nindent 2 }}
|
||||
{{- end }}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled .Values.metrics.prometheusRule.rules }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: {{ include "zookeeper.fullname" . }}
|
||||
{{- if .Values.metrics.prometheusRule.namespace }}
|
||||
namespace: {{ .Values.metrics.prometheusRule.namespace }}
|
||||
{{- else }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- range $key, $value := .Values.metrics.prometheusRule.selector }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
groups:
|
||||
- name: {{ include "zookeeper.fullname" . }}
|
||||
rules: {{- toYaml .Values.metrics.prometheusRule.rules | nindent 6 }}
|
||||
{{- end }}
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
client-password: {{ include "zookeeper.clientPassword" . | b64enc | quote }}
|
||||
server-password: {{ include "zookeeper.serverPasswords" . | b64enc | quote }}
|
||||
{{- end }}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
{{- if .Values.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "zookeeper.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
role: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||
{{- else }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- range $key, $value := .Values.metrics.serviceMonitor.selector }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
endpoints:
|
||||
- port: tcp-metrics
|
||||
path: "/metrics"
|
||||
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
|
|
@ -1,334 +0,0 @@
|
|||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
role: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
serviceName: {{ template "zookeeper.fullname" . }}-headless
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
podManagementPolicy: {{ .Values.podManagementPolicy }}
|
||||
updateStrategy:
|
||||
type: {{ .Values.updateStrategy }}
|
||||
{{- if (eq "Recreate" .Values.updateStrategy) }}
|
||||
rollingUpdate: null
|
||||
{{- else if .Values.rollingUpdatePartition }}
|
||||
rollingUpdate:
|
||||
partition: {{ .Values.rollingUpdatePartition }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
template:
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.podLabels }}
|
||||
{{- include "zookeeper.tplValue" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.schedulerName }}
|
||||
schedulerName: {{ .Values.schedulerName }}
|
||||
{{- end }}
|
||||
{{- include "zookeeper.imagePullSecrets" . | nindent 6 }}
|
||||
serviceAccountName: {{ template "zookeeper.serviceAccountName" . }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "zookeeper.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "zookeeper.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "zookeeper.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: {{ .Values.priorityClassName }}
|
||||
{{- end }}
|
||||
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
||||
initContainers:
|
||||
- name: volume-permissions
|
||||
image: {{ template "zookeeper.volumePermissions.image" . }}
|
||||
imagePullPolicy: {{ default "" .Values.volumePermissions.image.pullPolicy | quote }}
|
||||
command:
|
||||
- chown
|
||||
args:
|
||||
- -R
|
||||
- {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }}
|
||||
- /bitnami/zookeeper
|
||||
{{- if .Values.dataLogDir }}
|
||||
- {{ .Values.dataLogDir }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
{{- if .Values.volumePermissions.resources }}
|
||||
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/zookeeper
|
||||
{{- if .Values.dataLogDir }}
|
||||
- name: data-log
|
||||
mountPath: {{ .Values.dataLogDir }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: zookeeper
|
||||
image: {{ template "zookeeper.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||
{{- end }}
|
||||
command:
|
||||
- bash
|
||||
- -ec
|
||||
- |
|
||||
# Execute entrypoint as usual after obtaining ZOO_SERVER_ID based on POD hostname
|
||||
HOSTNAME=`hostname -s`
|
||||
if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
|
||||
ORD=${BASH_REMATCH[2]}
|
||||
export ZOO_SERVER_ID=$((ORD+1))
|
||||
else
|
||||
echo "Failed to get index from hostname $HOST"
|
||||
exit 1
|
||||
fi
|
||||
exec /entrypoint.sh /run.sh
|
||||
{{- if .Values.resources }}
|
||||
resources: {{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: ZOO_DATA_LOG_DIR
|
||||
value: {{ .Values.dataLogDir | quote }}
|
||||
- name: ZOO_PORT_NUMBER
|
||||
value: {{ .Values.service.port | quote }}
|
||||
- name: ZOO_TICK_TIME
|
||||
value: {{ .Values.tickTime | quote }}
|
||||
- name: ZOO_INIT_LIMIT
|
||||
value: {{ .Values.initLimit | quote }}
|
||||
- name: ZOO_SYNC_LIMIT
|
||||
value: {{ .Values.syncLimit | quote }}
|
||||
- name: ZOO_MAX_CLIENT_CNXNS
|
||||
value: {{ .Values.maxClientCnxns | quote }}
|
||||
- name: ZOO_4LW_COMMANDS_WHITELIST
|
||||
value: {{ .Values.fourlwCommandsWhitelist | quote }}
|
||||
- name: ZOO_LISTEN_ALLIPS_ENABLED
|
||||
value: {{ ternary "yes" "no" .Values.listenOnAllIPs | quote }}
|
||||
- name: ZOO_AUTOPURGE_INTERVAL
|
||||
value: {{ .Values.autopurge.purgeInterval | quote }}
|
||||
- name: ZOO_AUTOPURGE_RETAIN_COUNT
|
||||
value: {{ .Values.autopurge.snapRetainCount | quote }}
|
||||
- name: ZOO_MAX_SESSION_TIMEOUT
|
||||
value: {{ .Values.maxSessionTimeout | quote }}
|
||||
- name: ZOO_SERVERS
|
||||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- $followerPort := int .Values.service.followerPort }}
|
||||
{{- $electionPort := int .Values.service.electionPort }}
|
||||
{{- $releaseNamespace := .Release.Namespace }}
|
||||
{{- $zookeeperFullname := include "zookeeper.fullname" . }}
|
||||
{{- $zookeeperHeadlessServiceName := printf "%s-%s" $zookeeperFullname "headless" | trunc 63 }}
|
||||
{{- $clusterDomain := .Values.clusterDomain }}
|
||||
value: {{ range $i, $e := until $replicaCount }}{{ $zookeeperFullname }}-{{ $e }}.{{ $zookeeperHeadlessServiceName }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ $followerPort }}:{{ $electionPort }} {{ end }}
|
||||
- name: ZOO_ENABLE_AUTH
|
||||
value: {{ ternary "yes" "no" .Values.auth.enabled | quote }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
- name: ZOO_CLIENT_USER
|
||||
value: {{ .Values.auth.clientUser | quote }}
|
||||
- name: ZOO_CLIENT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ if .Values.auth.existingSecret }}{{ .Values.auth.existingSecret }}{{ else }}{{ template "zookeeper.fullname" . }}{{ end }}
|
||||
key: client-password
|
||||
- name: ZOO_SERVER_USERS
|
||||
value: {{ .Values.auth.serverUsers | quote }}
|
||||
- name: ZOO_SERVER_PASSWORDS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ if .Values.auth.existingSecret }}{{ .Values.auth.existingSecret }}{{ else }}{{ template "zookeeper.fullname" . }}{{ end }}
|
||||
key: server-password
|
||||
{{- end }}
|
||||
- name: ZOO_HEAP_SIZE
|
||||
value: {{ .Values.heapSize | quote }}
|
||||
- name: ZOO_LOG_LEVEL
|
||||
value: {{ .Values.logLevel | quote }}
|
||||
- name: ALLOW_ANONYMOUS_LOGIN
|
||||
value: {{ ternary "yes" "no" .Values.allowAnonymousLogin | quote }}
|
||||
{{- if .Values.jvmFlags }}
|
||||
- name: JVMFLAGS
|
||||
value: {{ .Values.jvmFlags | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: ZOO_ENABLE_PROMETHEUS_METRICS
|
||||
value: "yes"
|
||||
- name: ZOO_PROMETHEUS_METRICS_PORT_NUMBER
|
||||
value: {{ .Values.metrics.containerPort | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.tls.client_enable }}
|
||||
- name: ZOO_TLS_CLIENT_ENABLE
|
||||
value: {{ .Values.service.tls.client_enable | quote }}
|
||||
- name: ZOO_TLS_CLIENT_KEYSTORE_FILE
|
||||
value: {{ .Values.service.tls.client_keystore_path | quote }}
|
||||
- name: ZOO_TLS_CLIENT_KEYSTORE_PASSWORD
|
||||
value: {{ .Values.service.tls.client_keystore_password | quote }}
|
||||
- name: ZOO_TLS_CLIENT_TRUSTSTORE_FILE
|
||||
value: {{ .Values.service.tls.client_truststore_path | quote }}
|
||||
- name: ZOO_TLS_CLIENT_TRUSTSTORE_PASSWORD
|
||||
value: {{ .Values.service.tls.client_truststore_password | quote }}
|
||||
{{ end }}
|
||||
{{- if .Values.service.tls.quorum_enable }}
|
||||
- name: ZOO_TLS_QUORUM_ENABLE
|
||||
value: {{ .Values.service.tls.quorum_enable | quote }}
|
||||
- name: ZOO_TLS_QUORUM_KEYSTORE_FILE
|
||||
value: {{ .Values.service.tls.quorum_keystore_path | quote }}
|
||||
- name: ZOO_TLS_QUORUM_KEYSTORE_PASSWORD
|
||||
value: {{ .Values.service.tls.quorum_keystore_password | quote }}
|
||||
- name: ZOO_TLS_QUORUM_TRUSTSTORE_FILE
|
||||
value: {{ .Values.service.tls.quorum_truststore_path | quote }}
|
||||
- name: ZOO_TLS_QUORUM_TRUSTSTORE_PASSWORD
|
||||
value: {{ .Values.service.tls.quorum_truststore_password | quote }}
|
||||
{{ end }}
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.name
|
||||
{{- if .Values.extraEnvVars }}
|
||||
{{- toYaml .Values.extraEnvVars | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
{{ if not .Values.service.tls.disable_base_client_port }}
|
||||
- name: client
|
||||
containerPort: {{ .Values.service.port }}
|
||||
{{ end }}
|
||||
{{ if .Values.service.tls.client_enable }}
|
||||
- name: client-tls
|
||||
containerPort: {{ .Values.service.tls.client_port }}
|
||||
{{ end }}
|
||||
- name: follower
|
||||
containerPort: {{ .Values.service.followerPort }}
|
||||
- name: election
|
||||
containerPort: {{ .Values.service.electionPort }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.metrics.containerPort }}
|
||||
{{- end }}
|
||||
{{- if .Values.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
exec:
|
||||
{{- if not .Values.service.tls.disable_base_client_port }}
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout {{ .Values.livenessProbe.probeCommandTimeout }} nc -w {{ .Values.livenessProbe.probeCommandTimeout }} localhost {{ .Values.service.port }} | grep imok']
|
||||
{{- else }}
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout {{ .Values.livenessProbe.probeCommandTimeout }} openssl s_client -quiet -crlf -connect localhost:{{ .Values.service.tls.client_port }} | grep imok']
|
||||
{{- end }}
|
||||
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
exec:
|
||||
{{- if not .Values.service.tls.disable_base_client_port }}
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout {{ .Values.readinessProbe.probeCommandTimeout }} nc -w {{ .Values.readinessProbe.probeCommandTimeout }} localhost {{ .Values.service.port }} | grep imok']
|
||||
{{- else }}
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout {{ .Values.readinessProbe.probeCommandTimeout }} openssl s_client -quiet -crlf -connect localhost:{{ .Values.service.tls.client_port }} | grep imok']
|
||||
{{- end }}
|
||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/zookeeper
|
||||
{{- if .Values.dataLogDir }}
|
||||
- name: data-log
|
||||
mountPath: {{ .Values.dataLogDir }}
|
||||
{{- end }}
|
||||
{{- if .Values.config }}
|
||||
- name: config
|
||||
mountPath: /opt/bitnami/zookeeper/conf/zoo.cfg
|
||||
subPath: zoo.cfg
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumeMounts }}
|
||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if .Values.config }}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
{{- end }}
|
||||
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ printf "%s" (tpl .Values.persistence.existingClaim .) }}
|
||||
{{- else if not .Values.persistence.enabled }}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if and .Values.persistence.enabled .Values.persistence.dataLogDir.existingClaim }}
|
||||
- name: data-log
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ printf "%s" (tpl .Values.persistence.dataLogDir.existingClaim .) }}
|
||||
{{- else if and ( not .Values.persistence.enabled ) .Values.dataLogDir }}
|
||||
- name: data-log
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.persistence.enabled (not (and .Values.persistence.existingClaim .Values.persistence.dataLogDir.existingClaim) )}}
|
||||
volumeClaimTemplates:
|
||||
{{- if not .Values.persistence.existingClaim }}
|
||||
- metadata:
|
||||
name: data
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.persistence.annotations }}
|
||||
{{ $key }}: {{ $value }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{- include "zookeeper.storageClass" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (not .Values.persistence.dataLogDir.existingClaim) .Values.dataLogDir }}
|
||||
- metadata:
|
||||
name: data-log
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.persistence.annotations }}
|
||||
{{ $key }}: {{ $value }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.dataLogDir.size | quote }}
|
||||
{{- include "zookeeper.storageClass" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}-headless
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.commonAnnotations .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- if .Values.service.headless.annotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.service.headless.annotations "context" $ ) | nindent 4 }}\
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
publishNotReadyAddresses: {{ .Values.service.publishNotReadyAddresses }}
|
||||
ports:
|
||||
{{ if not .Values.service.tls.disable_base_client_port }}
|
||||
- name: tcp-client
|
||||
port: 2181
|
||||
targetPort: client
|
||||
{{ end }}
|
||||
{{ if .Values.service.tls.client_enable }}
|
||||
- name: tcp-client-tls
|
||||
port: {{ .Values.service.tls.client_port }}
|
||||
targetPort: client-tls
|
||||
{{ end }}
|
||||
- name: follower
|
||||
port: 2888
|
||||
targetPort: follower
|
||||
- name: tcp-election
|
||||
port: 3888
|
||||
targetPort: election
|
||||
selector: {{- include "zookeeper.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.commonAnnotations .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- if .Values.service.annotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}\
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
{{ if not .Values.service.tls.disable_base_client_port }}
|
||||
- name: tcp-client
|
||||
port: 2181
|
||||
targetPort: client
|
||||
{{ end }}
|
||||
{{ if .Values.service.tls.client_enable }}
|
||||
- name: tcp-client-tls
|
||||
port: {{ .Values.service.tls.client_port }}
|
||||
targetPort: client-tls
|
||||
{{ end }}
|
||||
- name: follower
|
||||
port: 2888
|
||||
targetPort: follower
|
||||
- name: tcp-election
|
||||
port: 3888
|
||||
targetPort: election
|
||||
selector: {{- include "zookeeper.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
|
|
@ -1,430 +0,0 @@
|
|||
## Global Docker image parameters
|
||||
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
|
||||
##
|
||||
# global:
|
||||
# imageRegistry: myRegistryName
|
||||
# imagePullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
# storageClass: myStorageClass
|
||||
|
||||
## Bitnami Zookeeper image version
|
||||
## ref: https://hub.docker.com/r/bitnami/zookeeper/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/zookeeper
|
||||
tag: 3.6.2-debian-10-r10
|
||||
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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
|
||||
## Set to true if you would like to see extra information on logs
|
||||
## It turns BASH and NAMI debugging in minideb
|
||||
## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging
|
||||
##
|
||||
debug: false
|
||||
|
||||
## String to partially override zookeeper.fullname template (will maintain the release name)
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override zookeeper.fullname template
|
||||
# fullnameOverride:
|
||||
|
||||
## Kubernetes Cluster Domain
|
||||
##
|
||||
clusterDomain: cluster.local
|
||||
|
||||
## Add labels to all the deployed resources
|
||||
##
|
||||
commonLabels: {}
|
||||
|
||||
## Add annotations to all the deployed resources
|
||||
##
|
||||
commonAnnotations: {}
|
||||
|
||||
## 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: buster
|
||||
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: {}
|
||||
|
||||
## extraVolumes and extraVolumeMounts allows you to mount other volumes
|
||||
## Example Use Cases:
|
||||
## mount certificates to enable tls
|
||||
# extraVolumes:
|
||||
# - name: zookeeper-keystore
|
||||
# secret:
|
||||
# defaultMode: 288
|
||||
# secretName: zookeeper-keystore
|
||||
# - name: zookeeper-trustsore
|
||||
# secret:
|
||||
# defaultMode: 288
|
||||
# secretName: zookeeper-truststore
|
||||
# extraVolumeMounts:
|
||||
# - name: zookeeper-keystore
|
||||
# mountPath: /certs/keystore
|
||||
# readOnly: true
|
||||
# - name: zookeeper-truststore
|
||||
# mountPath: /certs/truststore
|
||||
# readOnly: true
|
||||
|
||||
|
||||
## 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
|
||||
##
|
||||
updateStrategy: RollingUpdate
|
||||
|
||||
## Limits the number of pods of the replicated application that are down simultaneously from voluntary disruptions
|
||||
## The PDB will only be created if replicaCount is greater than 1
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions
|
||||
##
|
||||
podDisruptionBudget:
|
||||
maxUnavailable: 1
|
||||
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
##
|
||||
# rollingUpdatePartition:
|
||||
|
||||
## StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel
|
||||
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy
|
||||
##
|
||||
podManagementPolicy: Parallel
|
||||
|
||||
## Number of ZooKeeper nodes
|
||||
##
|
||||
replicaCount: 3
|
||||
|
||||
## Basic time unit in milliseconds used by ZooKeeper for heartbeats
|
||||
##
|
||||
tickTime: 2000
|
||||
|
||||
## ZooKeeper uses to limit the length of time the ZooKeeper servers in quorum have to connect to a leader
|
||||
##
|
||||
initLimit: 10
|
||||
|
||||
## How far out of date a server can be from a leader
|
||||
##
|
||||
syncLimit: 5
|
||||
|
||||
## Limits the number of concurrent connections that a single client may make to a single member of the ZooKeeper ensemble
|
||||
##
|
||||
maxClientCnxns: 60
|
||||
|
||||
## Maximum session timeout in milliseconds that the server will allow the client to negotiate. Defaults to 20 times the tickTime.
|
||||
##
|
||||
maxSessionTimeout: 40000
|
||||
|
||||
## A list of comma separated Four Letter Words commands to use
|
||||
##
|
||||
fourlwCommandsWhitelist: srvr, mntr, ruok
|
||||
|
||||
## Allow zookeeper to listen for peers on all IPs
|
||||
##
|
||||
listenOnAllIPs: false
|
||||
|
||||
## Allow to accept connections from unauthenticated users
|
||||
##
|
||||
allowAnonymousLogin: true
|
||||
|
||||
autopurge:
|
||||
## Retains the snapRetainCount most recent snapshots and the corresponding transaction logs and deletes the rest
|
||||
##
|
||||
snapRetainCount: 3
|
||||
## The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging.
|
||||
##
|
||||
purgeInterval: 0
|
||||
|
||||
auth:
|
||||
## Use existing secret (ignores previous password)
|
||||
##
|
||||
# existingSecret:
|
||||
## Enable Zookeeper auth. It uses SASL/Digest-MD5
|
||||
##
|
||||
enabled: false
|
||||
## User that will use Zookeeper clients to auth
|
||||
##
|
||||
clientUser:
|
||||
## Password that will use Zookeeper clients to auth
|
||||
##
|
||||
clientPassword:
|
||||
## Comma, semicolon or whitespace separated list of user to be created. Specify them as a string, for example: "user1,user2,admin"
|
||||
##
|
||||
serverUsers:
|
||||
## Comma, semicolon or whitespace separated list of passwords to assign to users when created. Specify them as a string, for example: "pass4user1, pass4user2, pass4admin"
|
||||
##
|
||||
serverPasswords:
|
||||
|
||||
## Size in MB for the Java Heap options (Xmx and XMs). This env var is ignored if Xmx an Xms are configured via JVMFLAGS
|
||||
##
|
||||
heapSize: 1024
|
||||
|
||||
## Log level for the Zookeeper server. ERROR by default. Have in mind if you set it to INFO or WARN the ReadinessProve will produce a lot of logs.
|
||||
##
|
||||
logLevel: ERROR
|
||||
|
||||
## Data log directory. Specifying this option will direct zookeeper to write the transaction log to the dataLogDir rather than the dataDir.
|
||||
## This allows a dedicated log device to be used, and helps avoid competition between logging and snaphots.
|
||||
## Example:
|
||||
## dataLogDir: /bitnami/zookeeper/dataLog
|
||||
##
|
||||
dataLogDir: ""
|
||||
|
||||
## Default JVMFLAGS for the ZooKeeper process
|
||||
##
|
||||
# jvmFlags:
|
||||
|
||||
## Configure ZooKeeper with a custom zoo.cfg file
|
||||
##
|
||||
# config:
|
||||
|
||||
## Kubernetes configuration
|
||||
## For minikube, set this to NodePort, elsewhere use LoadBalancer
|
||||
##
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 2181
|
||||
followerPort: 2888
|
||||
electionPort: 3888
|
||||
publishNotReadyAddresses: true
|
||||
tls:
|
||||
client_enable: true
|
||||
quorum_enable: true
|
||||
disable_base_client_port: true
|
||||
|
||||
client_port: 3181
|
||||
|
||||
client_keystore_path: /tls_key_store/key_store_file
|
||||
client_keystore_password: ""
|
||||
client_truststore_path: /tls_trust_store/trust_store_file
|
||||
client_truststore_password: ""
|
||||
|
||||
quorum_keystore_path: /tls_key_store/key_store_file
|
||||
quorum_keystore_password: ""
|
||||
quorum_truststore_path: /tls_trust_store/trust_store_file
|
||||
quorum_truststore_password: ""
|
||||
annotations: {}
|
||||
headless:
|
||||
annotations: {}
|
||||
|
||||
## Service account for Zookeeper to use.
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||
##
|
||||
serviceAccount:
|
||||
## Specifies whether a ServiceAccount should be created
|
||||
##
|
||||
create: false
|
||||
## The name of the ServiceAccount to use.
|
||||
## If not set and create is true, a name is generated using the zookeeper.fullname template
|
||||
# name:
|
||||
|
||||
## Zookeeper Pod Security Context
|
||||
securityContext:
|
||||
enabled: true
|
||||
fsGroup: 1001
|
||||
runAsUser: 1001
|
||||
|
||||
## Zookeeper data Persistent Volume Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||
## GKE, AWS & OpenStack)
|
||||
##
|
||||
persistence:
|
||||
enabled: true
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
|
||||
# storageClass: "-"
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
size: 8Gi
|
||||
annotations: {}
|
||||
dataLogDir:
|
||||
size: 8Gi
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
|
||||
## Node labels for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
## Labels
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
podLabels: {}
|
||||
|
||||
## Annotations
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
podAnnotations: {}
|
||||
|
||||
## Name of the priority class to be used by zookeeper pods, priority class needs to be created beforehand
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
priorityClassName: ""
|
||||
|
||||
## Affinity for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Scheduler name
|
||||
## https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||
##
|
||||
# schedulerName: stork
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 250m
|
||||
|
||||
## Configure extra options for liveness and readiness probes
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
|
||||
##
|
||||
livenessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
probeCommandTimeout: 2
|
||||
|
||||
readinessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
probeCommandTimeout: 2
|
||||
|
||||
## Network policies
|
||||
## Ref: https://kubernetes.io/docs/concepts/services-networking/network-policies/
|
||||
##
|
||||
networkPolicy:
|
||||
## Specifies whether a NetworkPolicy should be created
|
||||
##
|
||||
enabled: true
|
||||
|
||||
## The Policy model to apply. When set to false, only pods with the correct
|
||||
## client label will have network access to the port Redis is listening
|
||||
## on. When true, zookeeper accept connections from any source
|
||||
## (with the correct destination port).
|
||||
##
|
||||
allowExternal: true
|
||||
|
||||
## Zookeeper Prometheus Exporter configuration
|
||||
##
|
||||
metrics:
|
||||
enabled: false
|
||||
|
||||
## Zookeeper Prometheus Exporter container port
|
||||
##
|
||||
containerPort: 9141
|
||||
|
||||
## Service configuration
|
||||
##
|
||||
service:
|
||||
## Zookeeper Prometheus Exporter service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## Zookeeper Prometheus Exporter service port
|
||||
##
|
||||
port: 9141
|
||||
## Annotations for the Zookeeper Prometheus Exporter metrics service
|
||||
##
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "{{ .Values.metrics.service.port }}"
|
||||
prometheus.io/path: "/metrics"
|
||||
|
||||
## Prometheus Operator ServiceMonitor configuration
|
||||
##
|
||||
serviceMonitor:
|
||||
enabled: false
|
||||
## Namespace for the ServiceMonitor Resource (defaults to the Release Namespace)
|
||||
##
|
||||
namespace:
|
||||
|
||||
## Interval at which metrics should be scraped.
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# interval: 10s
|
||||
|
||||
## Timeout after which the scrape is ended
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# scrapeTimeout: 10s
|
||||
|
||||
## ServiceMonitor selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
## Prometheus Operator PrometheusRule configuration
|
||||
##
|
||||
prometheusRule:
|
||||
enabled: false
|
||||
## Namespace for the PrometheusRule Resource (defaults to the Release Namespace)
|
||||
##
|
||||
namespace:
|
||||
|
||||
## PrometheusRule selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
## Some example rules.
|
||||
rules: []
|
||||
# - alert: ZookeeperSyncedFollowers
|
||||
# annotations:
|
||||
# message: The number of synced followers for the leader node in Zookeeper deployment my-release is less than 2. This usually means that some of the Zookeeper nodes aren't communicating properly. If it doesn't resolve itself you can try killing the pods (one by one).
|
||||
# expr: max(synced_followers{service="my-release-metrics"}) < 2
|
||||
# for: 5m
|
||||
# labels:
|
||||
# severity: critical
|
||||
# - alert: ZookeeperOutstandingRequests
|
||||
# annotations:
|
||||
# message: The number of outstanding requests for Zookeeper pod {{ $labels.pod }} is greater than 10. This can indicate a performance issue with the Pod or cluster a whole.
|
||||
# expr: outstanding_requests{service="my-release-metrics"} > 10
|
||||
# for: 5m
|
||||
# labels:
|
||||
# severity: critical
|
||||
|
|
@ -1,430 +0,0 @@
|
|||
## Global Docker image parameters
|
||||
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
|
||||
##
|
||||
# global:
|
||||
# imageRegistry: myRegistryName
|
||||
# imagePullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
# storageClass: myStorageClass
|
||||
|
||||
## Bitnami Zookeeper image version
|
||||
## ref: https://hub.docker.com/r/bitnami/zookeeper/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/zookeeper
|
||||
tag: 3.6.2-debian-10-r10
|
||||
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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
|
||||
## Set to true if you would like to see extra information on logs
|
||||
## It turns BASH and NAMI debugging in minideb
|
||||
## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging
|
||||
##
|
||||
debug: false
|
||||
|
||||
## String to partially override zookeeper.fullname template (will maintain the release name)
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override zookeeper.fullname template
|
||||
# fullnameOverride:
|
||||
|
||||
## Kubernetes Cluster Domain
|
||||
##
|
||||
clusterDomain: cluster.local
|
||||
|
||||
## Add labels to all the deployed resources
|
||||
##
|
||||
commonLabels: {}
|
||||
|
||||
## Add annotations to all the deployed resources
|
||||
##
|
||||
commonAnnotations: {}
|
||||
|
||||
## 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: buster
|
||||
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: {}
|
||||
|
||||
## extraVolumes and extraVolumeMounts allows you to mount other volumes
|
||||
## Example Use Cases:
|
||||
## mount certificates to enable tls
|
||||
# extraVolumes:
|
||||
# - name: zookeeper-keystore
|
||||
# secret:
|
||||
# defaultMode: 288
|
||||
# secretName: zookeeper-keystore
|
||||
# - name: zookeeper-trustsore
|
||||
# secret:
|
||||
# defaultMode: 288
|
||||
# secretName: zookeeper-truststore
|
||||
# extraVolumeMounts:
|
||||
# - name: zookeeper-keystore
|
||||
# mountPath: /certs/keystore
|
||||
# readOnly: true
|
||||
# - name: zookeeper-truststore
|
||||
# mountPath: /certs/truststore
|
||||
# readOnly: true
|
||||
|
||||
## 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
|
||||
##
|
||||
updateStrategy: RollingUpdate
|
||||
|
||||
## Limits the number of pods of the replicated application that are down simultaneously from voluntary disruptions
|
||||
## The PDB will only be created if replicaCount is greater than 1
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions
|
||||
##
|
||||
podDisruptionBudget:
|
||||
maxUnavailable: 1
|
||||
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
##
|
||||
# rollingUpdatePartition:
|
||||
|
||||
## StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel
|
||||
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy
|
||||
##
|
||||
podManagementPolicy: Parallel
|
||||
|
||||
## Number of ZooKeeper nodes
|
||||
##
|
||||
replicaCount: 1
|
||||
|
||||
## Basic time unit in milliseconds used by ZooKeeper for heartbeats
|
||||
##
|
||||
tickTime: 2000
|
||||
|
||||
## ZooKeeper uses to limit the length of time the ZooKeeper servers in quorum have to connect to a leader
|
||||
##
|
||||
initLimit: 10
|
||||
|
||||
## How far out of date a server can be from a leader
|
||||
##
|
||||
syncLimit: 5
|
||||
|
||||
## Limits the number of concurrent connections that a single client may make to a single member of the ZooKeeper ensemble
|
||||
##
|
||||
maxClientCnxns: 60
|
||||
|
||||
## A list of comma separated Four Letter Words commands to use
|
||||
##
|
||||
fourlwCommandsWhitelist: srvr, mntr, ruok
|
||||
|
||||
## Allow zookeeper to listen for peers on all IPs
|
||||
##
|
||||
listenOnAllIPs: false
|
||||
|
||||
## Allow to accept connections from unauthenticated users
|
||||
##
|
||||
allowAnonymousLogin: true
|
||||
|
||||
autopurge:
|
||||
## Retains the snapRetainCount most recent snapshots and the corresponding transaction logs and deletes the rest
|
||||
##
|
||||
snapRetainCount: 3
|
||||
## The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging.
|
||||
##
|
||||
purgeInterval: 0
|
||||
|
||||
## Maximum session timeout in milliseconds that the server will allow the client to negotiate. Defaults to 20 times the tickTime.
|
||||
##
|
||||
maxSessionTimeout: 40000
|
||||
|
||||
auth:
|
||||
## Use existing secret (ignores previous password)
|
||||
##
|
||||
# existingSecret:
|
||||
## Enable Zookeeper auth. It uses SASL/Digest-MD5
|
||||
##
|
||||
enabled: false
|
||||
## User that will use Zookeeper clients to auth
|
||||
##
|
||||
clientUser:
|
||||
## Password that will use Zookeeper clients to auth
|
||||
##
|
||||
clientPassword:
|
||||
## Comma, semicolon or whitespace separated list of user to be created. Specify them as a string, for example: "user1,user2,admin"
|
||||
##
|
||||
serverUsers:
|
||||
## Comma, semicolon or whitespace separated list of passwords to assign to users when created. Specify them as a string, for example: "pass4user1, pass4user2, pass4admin"
|
||||
##
|
||||
serverPasswords:
|
||||
|
||||
## Size in MB for the Java Heap options (Xmx and XMs). This env var is ignored if Xmx an Xms are configured via JVMFLAGS
|
||||
##
|
||||
heapSize: 1024
|
||||
|
||||
## Log level for the Zookeeper server. ERROR by default. Have in mind if you set it to INFO or WARN the ReadinessProve will produce a lot of logs.
|
||||
##
|
||||
logLevel: ERROR
|
||||
|
||||
## Data log directory. Specifying this option will direct zookeeper to write the transaction log to the dataLogDir rather than the dataDir.
|
||||
## This allows a dedicated log device to be used, and helps avoid competition between logging and snaphots.
|
||||
## Example:
|
||||
## dataLogDir: /bitnami/zookeeper/dataLog
|
||||
##
|
||||
dataLogDir: ""
|
||||
|
||||
## Default JVMFLAGS for the ZooKeeper process
|
||||
##
|
||||
# jvmFlags:
|
||||
|
||||
## Configure ZooKeeper with a custom zoo.cfg file
|
||||
##
|
||||
# config:
|
||||
|
||||
## Kubernetes configuration
|
||||
## For minikube, set this to NodePort, elsewhere use LoadBalancer
|
||||
##
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 2181
|
||||
followerPort: 2888
|
||||
electionPort: 3888
|
||||
publishNotReadyAddresses: true
|
||||
tls:
|
||||
client_enable: false
|
||||
quorum_enable: false
|
||||
disable_base_client_port: false
|
||||
|
||||
client_port: 3181
|
||||
|
||||
client_keystore_path: /tls_key_store/key_store_file
|
||||
client_keystore_password: ""
|
||||
client_truststore_path: /tls_trust_store/trust_store_file
|
||||
client_truststore_password: ""
|
||||
|
||||
quorum_keystore_path: /tls_key_store/key_store_file
|
||||
quorum_keystore_password: ""
|
||||
quorum_truststore_path: /tls_trust_store/trust_store_file
|
||||
quorum_truststore_password: ""
|
||||
annotations: {}
|
||||
headless:
|
||||
annotations: {}
|
||||
|
||||
## Service account for Zookeeper to use.
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||
##
|
||||
serviceAccount:
|
||||
## Specifies whether a ServiceAccount should be created
|
||||
##
|
||||
create: false
|
||||
## The name of the ServiceAccount to use.
|
||||
## If not set and create is true, a name is generated using the zookeeper.fullname template
|
||||
# name:
|
||||
|
||||
## Zookeeper Pod Security Context
|
||||
securityContext:
|
||||
enabled: true
|
||||
fsGroup: 1001
|
||||
runAsUser: 1001
|
||||
|
||||
## Zookeeper data Persistent Volume Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||
## GKE, AWS & OpenStack)
|
||||
##
|
||||
persistence:
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
|
||||
enabled: true
|
||||
# storageClass: "-"
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
size: 8Gi
|
||||
annotations: {}
|
||||
dataLogDir:
|
||||
size: 8Gi
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
|
||||
|
||||
## Node labels for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
## Labels
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
podLabels: {}
|
||||
|
||||
## Annotations
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
podAnnotations: {}
|
||||
|
||||
## Name of the priority class to be used by zookeeper pods, priority class needs to be created beforehand
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
priorityClassName: ""
|
||||
|
||||
## Affinity for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Scheduler name
|
||||
## https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||
##
|
||||
# schedulerName: stork
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 250m
|
||||
|
||||
## Configure extra options for liveness and readiness probes
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
|
||||
##
|
||||
livenessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
probeCommandTimeout: 2
|
||||
|
||||
readinessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
probeCommandTimeout: 2
|
||||
|
||||
## Network policies
|
||||
## Ref: https://kubernetes.io/docs/concepts/services-networking/network-policies/
|
||||
##
|
||||
networkPolicy:
|
||||
## Specifies whether a NetworkPolicy should be created
|
||||
##
|
||||
enabled: false
|
||||
|
||||
## The Policy model to apply. When set to false, only pods with the correct
|
||||
## client label will have network access to the port Redis is listening
|
||||
## on. When true, zookeeper accept connections from any source
|
||||
## (with the correct destination port).
|
||||
##
|
||||
# allowExternal: true
|
||||
|
||||
## Zookeeper Prometheus Exporter configuration
|
||||
##
|
||||
metrics:
|
||||
enabled: false
|
||||
|
||||
## Zookeeper Prometheus Exporter container port
|
||||
##
|
||||
containerPort: 9141
|
||||
|
||||
## Service configuration
|
||||
##
|
||||
service:
|
||||
## Zookeeper Prometheus Exporter service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## Zookeeper Prometheus Exporter service port
|
||||
##
|
||||
port: 9141
|
||||
## Annotations for the Zookeeper Prometheus Exporter metrics service
|
||||
##
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "{{ .Values.metrics.service.port }}"
|
||||
prometheus.io/path: "/metrics"
|
||||
|
||||
## Prometheus Operator ServiceMonitor configuration
|
||||
##
|
||||
serviceMonitor:
|
||||
enabled: false
|
||||
## Namespace for the ServiceMonitor Resource (defaults to the Release Namespace)
|
||||
##
|
||||
namespace:
|
||||
|
||||
## Interval at which metrics should be scraped.
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# interval: 10s
|
||||
|
||||
## Timeout after which the scrape is ended
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# scrapeTimeout: 10s
|
||||
|
||||
## ServiceMonitor selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
## Prometheus Operator PrometheusRule configuration
|
||||
##
|
||||
prometheusRule:
|
||||
enabled: false
|
||||
## Namespace for the PrometheusRule Resource (defaults to the Release Namespace)
|
||||
##
|
||||
namespace:
|
||||
|
||||
## PrometheusRule selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
## Some example rules.
|
||||
rules: []
|
||||
# - alert: ZookeeperSyncedFollowers
|
||||
# annotations:
|
||||
# message: The number of synced followers for the leader node in Zookeeper deployment my-release is less than 2. This usually means that some of the Zookeeper nodes aren't communicating properly. If it doesn't resolve itself you can try killing the pods (one by one).
|
||||
# expr: max(synced_followers{service="my-release-metrics"}) < 2
|
||||
# for: 5m
|
||||
# labels:
|
||||
# severity: critical
|
||||
# - alert: ZookeeperOutstandingRequests
|
||||
# annotations:
|
||||
# message: The number of outstanding requests for Zookeeper pod {{ $labels.pod }} is greater than 10. This can indicate a performance issue with the Pod or cluster a whole.
|
||||
# expr: outstanding_requests{service="my-release-metrics"} > 10
|
||||
# for: 5m
|
||||
# labels:
|
||||
# severity: critical
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# Java Key Stores
|
||||
|
||||
You can copy here your Java Key Stores (JKS) files so a secret is created including them. Remember to use a truststore (`kafka.truststore.jks`) and one keystore (`kafka.keystore.jks`) per Kafka broker you have in the cluster. For instance, if you have 3 brokers you need to copy here the following files:
|
||||
|
||||
- kafka.truststore.jks
|
||||
- kafka-0.keystore.jks
|
||||
- kafka-1.keystore.jks
|
||||
- kafka-2.keystore.jks
|
||||
|
||||
Find more info in [this section](https://github.com/bitnami/charts/tree/master/bitnami/kafka#enable-security-for-kafka-and-zookeeper) of the README.md file.
|
||||
|
|
@ -1,521 +0,0 @@
|
|||
---
|
||||
# Source: kafka/templates/serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: kafka
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
---
|
||||
# Source: kafka/templates/scripts-configmap.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: kafka-scripts
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
data:
|
||||
setup.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
ID="${MY_POD_NAME#"kafka-"}"
|
||||
export KAFKA_CFG_BROKER_ID="$ID"
|
||||
|
||||
exec /entrypoint.sh /run.sh
|
||||
---
|
||||
# Source: kafka/charts/zookeeper/templates/svc-headless.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-zookeeper-headless
|
||||
namespace: db
|
||||
labels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
helm.sh/chart: zookeeper-5.21.9
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: zookeeper
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
publishNotReadyAddresses: true
|
||||
ports:
|
||||
|
||||
- name: tcp-client
|
||||
port: 2181
|
||||
targetPort: client
|
||||
|
||||
|
||||
- name: follower
|
||||
port: 2888
|
||||
targetPort: follower
|
||||
- name: tcp-election
|
||||
port: 3888
|
||||
targetPort: election
|
||||
selector:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: zookeeper
|
||||
---
|
||||
# Source: kafka/charts/zookeeper/templates/svc.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-zookeeper
|
||||
namespace: db
|
||||
labels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
helm.sh/chart: zookeeper-5.21.9
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: zookeeper
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
|
||||
- name: tcp-client
|
||||
port: 2181
|
||||
targetPort: client
|
||||
|
||||
|
||||
- name: follower
|
||||
port: 2888
|
||||
targetPort: follower
|
||||
- name: tcp-election
|
||||
port: 3888
|
||||
targetPort: election
|
||||
selector:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: zookeeper
|
||||
---
|
||||
# Source: kafka/templates/kafka-metrics-svc.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-metrics
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: metrics
|
||||
annotations:
|
||||
|
||||
prometheus.io/path: /metrics
|
||||
prometheus.io/port: '9308'
|
||||
prometheus.io/scrape: "true"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: 9308
|
||||
protocol: TCP
|
||||
targetPort: metrics
|
||||
nodePort: null
|
||||
selector:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: metrics
|
||||
---
|
||||
# Source: kafka/templates/svc-headless.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-headless
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: tcp-client
|
||||
port: 9092
|
||||
protocol: TCP
|
||||
targetPort: kafka-client
|
||||
- name: tcp-internal
|
||||
port: 9093
|
||||
protocol: TCP
|
||||
targetPort: kafka-internal
|
||||
selector:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: kafka
|
||||
---
|
||||
# Source: kafka/templates/svc.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: tcp-client
|
||||
port: 9092
|
||||
protocol: TCP
|
||||
targetPort: kafka-client
|
||||
nodePort: null
|
||||
selector:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: kafka
|
||||
---
|
||||
# Source: kafka/templates/kafka-metrics-deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kafka-exporter
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: metrics
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: metrics
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: metrics
|
||||
spec:
|
||||
containers:
|
||||
- name: kafka-exporter
|
||||
image: docker.io/bitnami/kafka-exporter:1.2.0-debian-10-r220
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
read -r -a sasl_passwords <<< "$(tr ',;' ' ' <<< "${SASL_USER_PASSWORD}")"
|
||||
kafka_exporter \
|
||||
--kafka.server=kafka-0.kafka-headless.db.svc.cluster.local:9092 \
|
||||
--kafka.server=kafka-1.kafka-headless.db.svc.cluster.local:9092 \
|
||||
--web.listen-address=:9308
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9308
|
||||
resources:
|
||||
limits: {}
|
||||
requests: {}
|
||||
---
|
||||
# Source: kafka/charts/zookeeper/templates/statefulset.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: kafka-zookeeper
|
||||
namespace: db
|
||||
labels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
helm.sh/chart: zookeeper-5.21.9
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: zookeeper
|
||||
role: zookeeper
|
||||
spec:
|
||||
serviceName: kafka-zookeeper-headless
|
||||
replicas: 1
|
||||
podManagementPolicy: Parallel
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: zookeeper
|
||||
template:
|
||||
metadata:
|
||||
name: kafka-zookeeper
|
||||
labels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
helm.sh/chart: zookeeper-5.21.9
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: zookeeper
|
||||
spec:
|
||||
|
||||
serviceAccountName: default
|
||||
securityContext:
|
||||
fsGroup: 1001
|
||||
containers:
|
||||
- name: zookeeper
|
||||
image: docker.io/bitnami/zookeeper:3.6.2-debian-10-r10
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
securityContext:
|
||||
runAsUser: 1001
|
||||
command:
|
||||
- bash
|
||||
- -ec
|
||||
- |
|
||||
# Execute entrypoint as usual after obtaining ZOO_SERVER_ID based on POD hostname
|
||||
HOSTNAME=`hostname -s`
|
||||
if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
|
||||
ORD=${BASH_REMATCH[2]}
|
||||
export ZOO_SERVER_ID=$((ORD+1))
|
||||
else
|
||||
echo "Failed to get index from hostname $HOST"
|
||||
exit 1
|
||||
fi
|
||||
exec /entrypoint.sh /run.sh
|
||||
resources:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: 256Mi
|
||||
env:
|
||||
- name: ZOO_DATA_LOG_DIR
|
||||
value: ""
|
||||
- name: ZOO_PORT_NUMBER
|
||||
value: "2181"
|
||||
- name: ZOO_TICK_TIME
|
||||
value: "2000"
|
||||
- name: ZOO_INIT_LIMIT
|
||||
value: "10"
|
||||
- name: ZOO_SYNC_LIMIT
|
||||
value: "5"
|
||||
- name: ZOO_MAX_CLIENT_CNXNS
|
||||
value: "60"
|
||||
- name: ZOO_4LW_COMMANDS_WHITELIST
|
||||
value: "srvr, mntr, ruok"
|
||||
- name: ZOO_LISTEN_ALLIPS_ENABLED
|
||||
value: "no"
|
||||
- name: ZOO_AUTOPURGE_INTERVAL
|
||||
value: "0"
|
||||
- name: ZOO_AUTOPURGE_RETAIN_COUNT
|
||||
value: "3"
|
||||
- name: ZOO_MAX_SESSION_TIMEOUT
|
||||
value: "40000"
|
||||
- name: ZOO_SERVERS
|
||||
value: kafka-zookeeper-0.kafka-zookeeper-headless.db.svc.cluster.local:2888:3888
|
||||
- name: ZOO_ENABLE_AUTH
|
||||
value: "no"
|
||||
- name: ZOO_HEAP_SIZE
|
||||
value: "1024"
|
||||
- name: ZOO_LOG_LEVEL
|
||||
value: "ERROR"
|
||||
- name: ALLOW_ANONYMOUS_LOGIN
|
||||
value: "yes"
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.name
|
||||
ports:
|
||||
|
||||
- name: client
|
||||
containerPort: 2181
|
||||
|
||||
|
||||
- name: follower
|
||||
containerPort: 2888
|
||||
- name: election
|
||||
containerPort: 3888
|
||||
livenessProbe:
|
||||
exec:
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok']
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
successThreshold: 1
|
||||
failureThreshold: 6
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok']
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
successThreshold: 1
|
||||
failureThreshold: 6
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/zookeeper
|
||||
volumes:
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
annotations:
|
||||
spec:
|
||||
accessModes:
|
||||
- "ReadWriteOnce"
|
||||
resources:
|
||||
requests:
|
||||
storage: "8Gi"
|
||||
---
|
||||
# Source: kafka/templates/statefulset.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: kafka
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
spec:
|
||||
podManagementPolicy: Parallel
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: kafka
|
||||
serviceName: kafka-headless
|
||||
updateStrategy:
|
||||
type: "RollingUpdate"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
spec:
|
||||
securityContext:
|
||||
fsGroup: 1001
|
||||
runAsUser: 1001
|
||||
serviceAccountName: kafka
|
||||
containers:
|
||||
- name: kafka
|
||||
image: docker.io/bitnami/kafka:2.6.0-debian-10-r30
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
command:
|
||||
- /scripts/setup.sh
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: "false"
|
||||
- name: MY_POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: MY_POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: KAFKA_CFG_ZOOKEEPER_CONNECT
|
||||
value: "kafka-zookeeper"
|
||||
- name: KAFKA_INTER_BROKER_LISTENER_NAME
|
||||
value: "INTERNAL"
|
||||
- name: KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP
|
||||
value: "INTERNAL:PLAINTEXT,CLIENT:PLAINTEXT"
|
||||
- name: KAFKA_CFG_LISTENERS
|
||||
value: "INTERNAL://:9093,CLIENT://:9092"
|
||||
- name: KAFKA_CFG_ADVERTISED_LISTENERS
|
||||
value: "INTERNAL://$(MY_POD_NAME).kafka-headless.db.svc.cluster.local:9093,CLIENT://$(MY_POD_NAME).kafka-headless.db.svc.cluster.local:9092"
|
||||
- name: ALLOW_PLAINTEXT_LISTENER
|
||||
value: "yes"
|
||||
- name: KAFKA_CFG_DELETE_TOPIC_ENABLE
|
||||
value: "false"
|
||||
- name: KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE
|
||||
value: "true"
|
||||
- name: KAFKA_HEAP_OPTS
|
||||
value: "-Xmx1024m -Xms1024m"
|
||||
- name: KAFKA_CFG_LOG_FLUSH_INTERVAL_MESSAGES
|
||||
value: "10000"
|
||||
- name: KAFKA_CFG_LOG_FLUSH_INTERVAL_MS
|
||||
value: "1000"
|
||||
- name: KAFKA_CFG_LOG_RETENTION_BYTES
|
||||
value: "1073741824"
|
||||
- name: KAFKA_CFG_LOG_RETENTION_CHECK_INTERVALS_MS
|
||||
value: "300000"
|
||||
- name: KAFKA_CFG_LOG_RETENTION_HOURS
|
||||
value: "168"
|
||||
- name: KAFKA_CFG_MESSAGE_MAX_BYTES
|
||||
value: "1000012"
|
||||
- name: KAFKA_CFG_LOG_SEGMENT_BYTES
|
||||
value: "1073741824"
|
||||
- name: KAFKA_CFG_LOG_DIRS
|
||||
value: "/bitnami/kafka/data"
|
||||
- name: KAFKA_CFG_DEFAULT_REPLICATION_FACTOR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_TRANSACTION_STATE_LOG_REPLICATION_FACTOR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_NUM_IO_THREADS
|
||||
value: "8"
|
||||
- name: KAFKA_CFG_NUM_NETWORK_THREADS
|
||||
value: "3"
|
||||
- name: KAFKA_CFG_NUM_PARTITIONS
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_NUM_RECOVERY_THREADS_PER_DATA_DIR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_SOCKET_RECEIVE_BUFFER_BYTES
|
||||
value: "102400"
|
||||
- name: KAFKA_CFG_SOCKET_REQUEST_MAX_BYTES
|
||||
value: "104857600"
|
||||
- name: KAFKA_CFG_SOCKET_SEND_BUFFER_BYTES
|
||||
value: "102400"
|
||||
- name: KAFKA_CFG_ZOOKEEPER_CONNECTION_TIMEOUT_MS
|
||||
value: "6000"
|
||||
ports:
|
||||
- name: kafka-client
|
||||
containerPort: 9092
|
||||
- name: kafka-internal
|
||||
containerPort: 9093
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: kafka-client
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold:
|
||||
periodSeconds:
|
||||
successThreshold:
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: kafka-client
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
periodSeconds:
|
||||
successThreshold:
|
||||
resources:
|
||||
limits: {}
|
||||
requests: {}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/kafka
|
||||
- name: scripts
|
||||
mountPath: /scripts/setup.sh
|
||||
subPath: setup.sh
|
||||
volumes:
|
||||
- name: scripts
|
||||
configMap:
|
||||
name: kafka-scripts
|
||||
defaultMode: 0755
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- "ReadWriteOnce"
|
||||
resources:
|
||||
requests:
|
||||
storage: "8Gi"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
dependencies:
|
||||
- name: zookeeper
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 5.21.9
|
||||
digest: sha256:2f3c43ce02e3966648b8c89be121fe39537f62ea1d161ad908f51ddc90e4243e
|
||||
generated: "2020-09-29T07:43:56.483358254Z"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
dependencies:
|
||||
- name: zookeeper
|
||||
version: 5.x.x
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
condition: zookeeper.enabled
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
{{- $replicaCount := int .Values.replicaCount -}}
|
||||
{{- $releaseNamespace := .Release.Namespace -}}
|
||||
{{- $clusterDomain := .Values.clusterDomain -}}
|
||||
{{- $fullname := include "kafka.fullname" . -}}
|
||||
{{- $clientProtocol := include "kafka.listenerType" ( dict "protocol" .Values.auth.clientProtocol ) -}}
|
||||
{{- $servicePort := int .Values.service.port -}}
|
||||
{{- $loadBalancerIPListLength := len .Values.externalAccess.service.loadBalancerIPs -}}
|
||||
{{- if and .Values.externalAccess.enabled (not .Values.externalAccess.autoDiscovery.enabled) (not (eq $replicaCount $loadBalancerIPListLength )) (eq .Values.externalAccess.service.type "LoadBalancer") }}
|
||||
|
||||
###############################################################################
|
||||
### ERROR: You enabled external access to Kafka brokers without specifying ###
|
||||
### the array of load balancer IPs for Kafka brokers. ###
|
||||
###############################################################################
|
||||
|
||||
This deployment will be incomplete until you configure the array of load balancer
|
||||
IPs for Kafka brokers. To complete your deployment follow the steps below:
|
||||
|
||||
1. Wait for the load balancer IPs (it may take a few minutes for them to be available):
|
||||
|
||||
kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka,pod" -w
|
||||
|
||||
2. Obtain the load balancer IPs and upgrade your chart:
|
||||
|
||||
{{- range $i, $e := until $replicaCount }}
|
||||
LOAD_BALANCER_IP_{{ add $i 1 }}="$(kubectl get svc --namespace {{ $releaseNamespace }} {{ $fullname }}-{{ $i }}-external -o jsonpath='{.status.loadBalancer.ingress[0].ip}')"
|
||||
{{- end }}
|
||||
|
||||
3. Upgrade you chart:
|
||||
|
||||
helm upgrade {{ .Release.Name }} bitnami/{{ .Chart.Name }} \
|
||||
--set replicaCount={{ $replicaCount }} \
|
||||
--set externalAccess.enabled=true \
|
||||
{{- range $i, $e := until $replicaCount }}
|
||||
--set externalAccess.service.loadBalancerIPs[{{ $i }}]=$LOAD_BALANCER_IP_{{ add $i 1 }} \
|
||||
{{- end }}
|
||||
--set externalAccess.service.type=LoadBalancer
|
||||
|
||||
{{- else }}
|
||||
|
||||
{{- if and (or (eq .Values.service.type "LoadBalancer") .Values.externalAccess.enabled) (eq .Values.auth.clientProtocol "plaintext") }}
|
||||
---------------------------------------------------------------------------------------------
|
||||
WARNING
|
||||
|
||||
By specifying "serviceType=LoadBalancer" and not configuring the authentication
|
||||
you have most likely exposed the Kafka service externally without any
|
||||
authentication mechanism.
|
||||
|
||||
For security reasons, we strongly suggest that you switch to "ClusterIP" or
|
||||
"NodePort". As alternative, you can also configure the Kafka authentication.
|
||||
|
||||
---------------------------------------------------------------------------------------------
|
||||
{{- end }}
|
||||
|
||||
** Please be patient while the chart is being deployed **
|
||||
|
||||
Kafka can be accessed by consumers via port {{ $servicePort }} on the following DNS name from within your cluster:
|
||||
|
||||
{{ $fullname }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}
|
||||
|
||||
Each Kafka broker can be accessed by producers via port {{ $servicePort }} on the following DNS name(s) from within your cluster:
|
||||
|
||||
{{- $brokerList := list }}
|
||||
{{- range $e, $i := until $replicaCount }}
|
||||
{{- $brokerList = append $brokerList (printf "%s-%d.%s-headless.%s.svc.%s:%d" $fullname $i $fullname $releaseNamespace $clusterDomain $servicePort) }}
|
||||
{{- end }}
|
||||
{{ join "\n" $brokerList | nindent 4 }}
|
||||
|
||||
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
|
||||
You need to configure your Kafka client to access using SASL authentication. To do so, you need to create the 'kafka_jaas.conf' and 'client.properties' configuration files by executing these commands:
|
||||
|
||||
- kafka_jaas.conf:
|
||||
|
||||
cat > kafka_jaas.conf <<EOF
|
||||
KafkaClient {
|
||||
{{- if .Values.auth.saslMechanisms | regexFind "scram" }}
|
||||
org.apache.kafka.common.security.scram.ScramLoginModule required
|
||||
{{- else }}
|
||||
org.apache.kafka.common.security.plain.PlainLoginModule required
|
||||
{{- end }}
|
||||
username="{{ index .Values.auth.jaas.clientUsers 0 }}"
|
||||
password="$(kubectl get secret {{ $fullname }}-jaas -n {{ $releaseNamespace }} -o jsonpath='{.data.client-passwords}' | base64 --decode | cut -d , -f 1)";
|
||||
};
|
||||
EOF
|
||||
|
||||
- client.properties:
|
||||
|
||||
cat > client.properties <<EOF
|
||||
security.protocol={{ $clientProtocol }}
|
||||
{{- if .Values.auth.saslMechanisms | regexFind "scram-sha-256" }}
|
||||
sasl.mechanism=SCRAM-SHA-256
|
||||
{{- else if .Values.auth.saslMechanisms | regexFind "scram-sha-512" }}
|
||||
sasl.mechanism=SCRAM-SHA-512
|
||||
{{- else -}}
|
||||
sasl.mechanism=PLAIN
|
||||
{{- end }}
|
||||
{{- if eq .Values.auth.clientProtocol "sasl_tls" }}
|
||||
ssl.truststore.location=/tmp/kafka.truststore.jks
|
||||
{{- if .Values.auth.jksPassword }}
|
||||
ssl.truststore.password={{ .Values.auth.jksPassword }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.auth.tlsEndpointIdentificationAlgorithm "" }}
|
||||
ssl.endpoint.identification.algorithm=
|
||||
{{- end }}
|
||||
EOF
|
||||
{{- end }}
|
||||
|
||||
To create a pod that you can use as a Kafka client run the following commands:
|
||||
|
||||
kubectl run {{ $fullname }}-client --restart='Never' --image {{ template "kafka.image" . }} --namespace {{ $releaseNamespace }} --command -- sleep infinity
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
kubectl cp --namespace {{ $releaseNamespace }} /path/to/client.properties {{ $fullname }}-client:/tmp/client.properties
|
||||
kubectl cp --namespace {{ $releaseNamespace }} /path/to/kafka_jaas.conf {{ $fullname }}-client:/tmp/kafka_jaas.conf
|
||||
{{- if eq .Values.auth.clientProtocol "sasl_tls" }}
|
||||
kubectl cp --namespace {{ $releaseNamespace }} ./kafka.truststore.jks {{ $fullname }}-client:/tmp/kafka.truststore.jks
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
kubectl exec --tty -i {{ $fullname }}-client --namespace {{ $releaseNamespace }} -- bash
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
export KAFKA_OPTS="-Djava.security.auth.login.config=/tmp/kafka_jaas.conf"
|
||||
{{- end }}
|
||||
|
||||
PRODUCER:
|
||||
kafka-console-producer.sh \
|
||||
{{ if (include "kafka.client.saslAuthentication" .) }}--producer.config /tmp/client.properties \{{ end }}
|
||||
--broker-list {{ join "," $brokerList }} \
|
||||
--topic test
|
||||
|
||||
CONSUMER:
|
||||
kafka-console-consumer.sh \
|
||||
{{ if (include "kafka.client.saslAuthentication" .) }}--consumer.config /tmp/client.properties \{{ end }}
|
||||
--bootstrap-server {{ $fullname }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ .Values.service.port }} \
|
||||
--topic test \
|
||||
--from-beginning
|
||||
|
||||
{{- if .Values.externalAccess.enabled }}
|
||||
|
||||
To connect to your Kafka server from outside the cluster, follow the instructions below:
|
||||
|
||||
{{- if eq "NodePort" .Values.externalAccess.service.type }}
|
||||
{{- if .Values.externalAccess.service.domain }}
|
||||
|
||||
Kafka brokers domain: Use your provided hostname to reach Kafka brokers, {{ .Values.externalAccess.service.domain }}
|
||||
|
||||
{{- else }}
|
||||
|
||||
Kafka brokers domain: You can get the external node IP from the Kafka configuration file with the following commands (Check the EXTERNAL listener)
|
||||
|
||||
1. Obtain the pod name:
|
||||
|
||||
kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka"
|
||||
|
||||
2. Obtain pod configuration:
|
||||
|
||||
kubectl exec -it KAFKA_POD -- cat /opt/bitnami/kafka/config/server.properties | grep advertised.listeners
|
||||
|
||||
{{- end }}
|
||||
|
||||
Kafka brokers port: You will have a different node port for each Kafka broker. You can get the list of configured node ports using the command below:
|
||||
|
||||
echo "$(kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka,pod" -o jsonpath='{.items[*].spec.ports[0].nodePort}' | tr ' ' '\n')"
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.externalAccess.service.type }}
|
||||
|
||||
NOTE: It may take a few minutes for the LoadBalancer IPs to be available.
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka,pod" -w'
|
||||
|
||||
Kafka Brokers domain: You will have a different external IP for each Kafka broker. You can get the list of external IPs using the command below:
|
||||
|
||||
echo "$(kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka,pod" -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}' | tr ' ' '\n')"
|
||||
|
||||
Kafka Brokers port: {{ .Values.externalAccess.service.port }}
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- include "kafka.checkRollingTags" . }}
|
||||
{{- include "kafka.validateValues" . }}
|
||||
|
|
@ -1,556 +0,0 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "kafka.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "kafka.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "kafka.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "kafka.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "kafka.name" . }}
|
||||
helm.sh/chart: {{ include "kafka.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||
*/}}
|
||||
{{- define "kafka.matchLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "kafka.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified zookeeper name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "kafka.zookeeper.fullname" -}}
|
||||
{{- if .Values.zookeeper.fullnameOverride -}}
|
||||
{{- .Values.zookeeper.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default "zookeeper" .Values.zookeeper.nameOverride -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "kafka.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "kafka.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Kafka image name
|
||||
*/}}
|
||||
{{- define "kafka.image" -}}
|
||||
{{- $registryName := .Values.image.registry -}}
|
||||
{{- $repositoryName := .Values.image.repository -}}
|
||||
{{- $tag := .Values.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the init container auto-discovery image)
|
||||
*/}}
|
||||
{{- define "kafka.externalAccess.autoDiscovery.image" -}}
|
||||
{{- $registryName := .Values.externalAccess.autoDiscovery.image.registry -}}
|
||||
{{- $repositoryName := .Values.externalAccess.autoDiscovery.image.repository -}}
|
||||
{{- $tag := .Values.externalAccess.autoDiscovery.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 -}}
|
||||
|
||||
{{/*
|
||||
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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Kafka exporter image name
|
||||
*/}}
|
||||
{{- define "kafka.metrics.kafka.image" -}}
|
||||
{{- $registryName := .Values.metrics.kafka.image.registry -}}
|
||||
{{- $repositoryName := .Values.metrics.kafka.image.repository -}}
|
||||
{{- $tag := .Values.metrics.kafka.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper JMX exporter image name
|
||||
*/}}
|
||||
{{- define "kafka.metrics.jmx.image" -}}
|
||||
{{- $registryName := .Values.metrics.jmx.image.registry -}}
|
||||
{{- $repositoryName := .Values.metrics.jmx.image.repository -}}
|
||||
{{- $tag := .Values.metrics.jmx.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "kafka.imagePullSecrets" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Also, we can not use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- else if or .Values.image.pullSecrets .Values.externalAccess.autoDiscovery.image.pullSecrets .Values.volumePermissions.image.pullSecrets .Values.metrics.kafka.image.pullSecrets .Values.metrics.jmx.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.externalAccess.autoDiscovery.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumePermissions.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.metrics.kafka.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.metrics.jmx.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- else if or .Values.image.pullSecrets .Values.externalAccess.autoDiscovery.image.pullSecrets .Values.volumePermissions.image.pullSecrets .Values.metrics.kafka.image.pullSecrets .Values.metrics.jmx.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.externalAccess.autoDiscovery.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumePermissions.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.metrics.kafka.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.metrics.jmx.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "kafka.storageClass" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if authentication via SASL should be configured for client communications
|
||||
*/}}
|
||||
{{- define "kafka.client.saslAuthentication" -}}
|
||||
{{- $saslProtocols := list "sasl" "sasl_tls" -}}
|
||||
{{- if has .Values.auth.clientProtocol $saslProtocols -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if authentication via SASL should be configured for inter-broker communications
|
||||
*/}}
|
||||
{{- define "kafka.interBroker.saslAuthentication" -}}
|
||||
{{- $saslProtocols := list "sasl" "sasl_tls" -}}
|
||||
{{- if has .Values.auth.interBrokerProtocol $saslProtocols -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if encryption via TLS should be configured
|
||||
*/}}
|
||||
{{- define "kafka.tlsEncryption" -}}
|
||||
{{- $tlsProtocols := list "tls" "mtls" "sasl_tls" -}}
|
||||
{{- if or (has .Values.auth.clientProtocol $tlsProtocols) (has .Values.auth.interBrokerProtocol $tlsProtocols) -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the type of listener
|
||||
Usage:
|
||||
{{ include "kafka.listenerType" ( dict "protocol" .Values.path.to.the.Value ) }}
|
||||
*/}}
|
||||
{{- define "kafka.listenerType" -}}
|
||||
{{- if eq .protocol "plaintext" -}}
|
||||
PLAINTEXT
|
||||
{{- else if or (eq .protocol "tls") (eq .protocol "mtls") -}}
|
||||
SSL
|
||||
{{- else if eq .protocol "sasl_tls" -}}
|
||||
SASL_SSL
|
||||
{{- else if eq .protocol "sasl" -}}
|
||||
SASL_PLAINTEXT
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the SASL type
|
||||
Usage:
|
||||
{{ include "kafka.auth.saslMechanisms" ( dict "type" .Values.path.to.the.Value ) }}
|
||||
*/}}
|
||||
{{- define "kafka.auth.saslMechanisms" -}}
|
||||
{{- $mechanisms := list -}}
|
||||
{{- if .type | regexFind "plain" -}}
|
||||
{{- $mechanisms = append $mechanisms "PLAIN" -}}
|
||||
{{- end -}}
|
||||
{{- if .type | regexFind "scram-sha-256" -}}
|
||||
{{- $mechanisms = append $mechanisms "SCRAM-SHA-256" -}}
|
||||
{{- end -}}
|
||||
{{- if .type | regexFind "scram-sha-512" -}}
|
||||
{{- $mechanisms = append $mechanisms "SCRAM-SHA-512" -}}
|
||||
{{- end -}}
|
||||
{{- $mechanisms = join "," $mechanisms -}}
|
||||
{{- printf "%s" $mechanisms -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka JAAS credentials secret
|
||||
*/}}
|
||||
{{- define "kafka.jaasSecretName" -}}
|
||||
{{- if .Values.auth.jaas.existingSecret -}}
|
||||
{{- printf "%s" (tpl .Values.auth.jaas.existingSecret $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-jaas" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a JAAS credentials secret object should be created
|
||||
*/}}
|
||||
{{- define "kafka.createJaasSecret" -}}
|
||||
{{- if and (or (include "kafka.client.saslAuthentication" .) (include "kafka.interBroker.saslAuthentication" .) .Values.auth.jaas.zookeeperUser) (not .Values.auth.jaas.existingSecret) -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka JKS credentials secret
|
||||
*/}}
|
||||
{{- define "kafka.jksSecretName" -}}
|
||||
{{- if .Values.auth.jksSecret -}}
|
||||
{{- printf "%s" (tpl .Values.auth.jksSecret $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-jks" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a JAAS credentials secret object should be created
|
||||
*/}}
|
||||
{{- define "kafka.createJksSecret" -}}
|
||||
{{- if and (.Files.Glob "files/jks/*.jks") (not .Values.auth.jksSecret) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka configuration configmap
|
||||
*/}}
|
||||
{{- define "kafka.configmapName" -}}
|
||||
{{- if .Values.existingConfigmap -}}
|
||||
{{- printf "%s" (tpl .Values.existingConfigmap $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-configuration" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a configmap object should be created
|
||||
*/}}
|
||||
{{- define "kafka.createConfigmap" -}}
|
||||
{{- if and .Values.config (not .Values.existingConfigmap) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka log4j ConfigMap name.
|
||||
*/}}
|
||||
{{- define "kafka.log4j.configMapName" -}}
|
||||
{{- if .Values.existingLog4jConfigMap -}}
|
||||
{{- printf "%s" (tpl .Values.existingLog4jConfigMap $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-log4j-configuration" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a log4j ConfigMap object should be created.
|
||||
*/}}
|
||||
{{- define "kafka.log4j.createConfigMap" -}}
|
||||
{{- if and .Values.log4j (not .Values.existingLog4jConfigMap) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka configuration configmap
|
||||
*/}}
|
||||
{{- define "kafka.metrics.jmx.configmapName" -}}
|
||||
{{- if .Values.metrics.jmx.existingConfigmap -}}
|
||||
{{- printf "%s" (tpl .Values.metrics.jmx.existingConfigmap $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-jmx-configuration" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a configmap object should be created
|
||||
*/}}
|
||||
{{- define "kafka.metrics.jmx.createConfigmap" -}}
|
||||
{{- if and .Values.metrics.jmx.enabled .Values.metrics.jmx.config (not .Values.metrics.jmx.existingConfigmap) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Renders a value that contains template.
|
||||
Usage:
|
||||
{{ include "kafka.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||
*/}}
|
||||
{{- define "kafka.tplValue" -}}
|
||||
{{- if typeIs "string" .value }}
|
||||
{{- tpl .value .context }}
|
||||
{{- else }}
|
||||
{{- tpl (.value | toYaml) .context }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Check if there are rolling tags in the images
|
||||
*/}}
|
||||
{{- define "kafka.checkRollingTags" -}}
|
||||
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- if and (contains "bitnami/" .Values.externalAccess.autoDiscovery.image.repository) (not (.Values.externalAccess.autoDiscovery.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.externalAccess.autoDiscovery.image.repository }}:{{ .Values.externalAccess.autoDiscovery.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- if and (contains "bitnami/" .Values.metrics.kafka.image.repository) (not (.Values.metrics.kafka.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.metrics.kafka.image.repository }}:{{ .Values.metrics.kafka.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- if and (contains "bitnami/" .Values.metrics.jmx.image.repository) (not (.Values.metrics.jmx.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.metrics.jmx.image.repository }}:{{ .Values.metrics.jmx.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Compile all warnings into a single message, and call fail.
|
||||
*/}}
|
||||
{{- define "kafka.validateValues" -}}
|
||||
{{- $messages := list -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.authProtocols" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.nodePortListLength" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.externalAccessServiceType" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.externalAccessAutoDiscoveryRBAC" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.jksSecret" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.saslMechanisms" .) -}}
|
||||
{{- $messages := without $messages "" -}}
|
||||
{{- $message := join "\n" $messages -}}
|
||||
|
||||
{{- if $message -}}
|
||||
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - Authentication protocols for Kafka */}}
|
||||
{{- define "kafka.validateValues.authProtocols" -}}
|
||||
{{- $authProtocols := list "plaintext" "tls" "mtls" "sasl" "sasl_tls" -}}
|
||||
{{- if or (not (has .Values.auth.clientProtocol $authProtocols)) (not (has .Values.auth.interBrokerProtocol $authProtocols)) -}}
|
||||
kafka: auth.clientProtocol auth.interBrokerProtocol
|
||||
Available authentication protocols are "plaintext", "tls", "mtls", "sasl" and "sasl_tls"
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - number of replicas must be the same than NodePort list */}}
|
||||
{{- define "kafka.validateValues.nodePortListLength" -}}
|
||||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- $nodePortListLength := len .Values.externalAccess.service.nodePorts }}
|
||||
{{- if and .Values.externalAccess.enabled (not .Values.externalAccess.autoDiscovery.enabled) (not (eq $replicaCount $nodePortListLength )) (eq .Values.externalAccess.service.type "NodePort") -}}
|
||||
kafka: .Values.externalAccess.service.nodePorts
|
||||
Number of replicas and nodePort array length must be the same. Currently: replicaCount = {{ $replicaCount }} and nodePorts = {{ $nodePortListLength }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - service type for external access */}}
|
||||
{{- define "kafka.validateValues.externalAccessServiceType" -}}
|
||||
{{- if and (not (eq .Values.externalAccess.service.type "NodePort")) (not (eq .Values.externalAccess.service.type "LoadBalancer")) -}}
|
||||
kafka: externalAccess.service.type
|
||||
Available servive type for external access are NodePort or LoadBalancer.
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - RBAC should be enabled when autoDiscovery is enabled */}}
|
||||
{{- define "kafka.validateValues.externalAccessAutoDiscoveryRBAC" -}}
|
||||
{{- if and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled (not .Values.rbac.create )}}
|
||||
kafka: rbac.create
|
||||
By specifying "externalAccess.enabled=true" and "externalAccess.autoDiscovery.enabled=true"
|
||||
an initContainer will be used to autodetect the external IPs/ports by querying the
|
||||
K8s API. Please note this initContainer requires specific RBAC resources. You can create them
|
||||
by specifying "--set rbac.create=true".
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - A secret containing JKS files must be provided when TLS authentication is enabled */}}
|
||||
{{- define "kafka.validateValues.jksSecret" -}}
|
||||
{{- if and (include "kafka.tlsEncryption" .) (not .Values.auth.jksSecret) (not (.Files.Glob "files/jks/*.jks")) }}
|
||||
kafka: auth.jksSecret
|
||||
A secret containing the Kafka JKS files is required when TLS encryption in enabled
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - SASL mechanisms must be provided when using SASL */}}
|
||||
{{- define "kafka.validateValues.saslMechanisms" -}}
|
||||
{{- if and (or (.Values.auth.clientProtocol | regexFind "sasl") (.Values.auth.interBrokerProtocol | regexFind "sasl") .Values.auth.jaas.zookeeperUser) (not .Values.auth.saslMechanisms) }}
|
||||
kafka: auth.saslMechanisms
|
||||
The SASL mechanisms are required when either auth.clientProtocol or auth.interBrokerProtocol use SASL or Zookeeper user is provided.
|
||||
{{- end }}
|
||||
{{- if not (contains .Values.auth.saslInterBrokerMechanism .Values.auth.saslMechanisms) }}
|
||||
kafka: auth.saslMechanisms
|
||||
auth.saslInterBrokerMechanism must be provided and it should be one of the specified mechanisms at auth.saslMechanisms
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{{- if (include "kafka.createConfigmap" .) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-configuration
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
server.properties: |-
|
||||
{{ .Values.config | nindent 4 }}
|
||||
{{- end -}}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{{- if .Values.extraDeploy }}
|
||||
apiVersion: v1
|
||||
kind: List
|
||||
items: {{- include "kafka.tplValue" (dict "value" .Values.extraDeploy "context" $) | nindent 2 }}
|
||||
{{- end }}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
{{- if (include "kafka.createJaasSecret" .) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-jaas
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
{{- if .Values.auth.jaas.clientPasswords }}
|
||||
client-passwords: {{ join "," .Values.auth.jaas.clientPasswords | b64enc | quote }}
|
||||
{{- else }}
|
||||
{{- $passwords := list }}
|
||||
{{- range .Values.auth.jaas.clientUsers }}
|
||||
{{- $passwords = append $passwords (randAlphaNum 10) }}
|
||||
{{- end }}
|
||||
client-passwords: {{ join "," $passwords | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.auth.jaas.zookeeperUser }}
|
||||
zookeeper-password: {{ ternary (randAlphaNum 10) .Values.auth.jaas.zookeeperPassword (empty .Values.auth.jaas.zookeeperPassword) | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- if (include "kafka.interBroker.saslAuthentication" .) }}
|
||||
inter-broker-password: {{ ternary (randAlphaNum 10) .Values.auth.jaas.interBrokerPassword (empty .Values.auth.jaas.interBrokerPassword) | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{{- if (include "kafka.createJksSecret" .) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-jks
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- $root := . }}
|
||||
{{- range $path, $bytes := .Files.Glob "files/jks/*.jks" }}
|
||||
{{ base $path }}: {{ $root.Files.Get $path | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
{{- if (include "kafka.metrics.jmx.createConfigmap" .) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-jmx-configuration
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
jmx-kafka-prometheus.yml: |-
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.metrics.jmx.config "context" $ ) | nindent 4 }}
|
||||
rules:
|
||||
- pattern: kafka.controller<type=(ControllerChannelManager), name=(QueueSize), broker-id=(\d+)><>(Value)
|
||||
name: kafka_controller_$1_$2_$4
|
||||
labels:
|
||||
broker_id: "$3"
|
||||
- pattern: kafka.controller<type=(ControllerChannelManager), name=(TotalQueueSize)><>(Value)
|
||||
name: kafka_controller_$1_$2_$3
|
||||
- pattern: kafka.controller<type=(KafkaController), name=(.+)><>(Value)
|
||||
name: kafka_controller_$1_$2_$3
|
||||
- pattern: kafka.controller<type=(ControllerStats), name=(.+)><>(Count)
|
||||
name: kafka_controller_$1_$2_$3
|
||||
- pattern: kafka.server<type=(ReplicaFetcherManager), name=(.+), clientId=(.+)><>(Value)
|
||||
name: kafka_server_$1_$2_$4
|
||||
labels:
|
||||
client_id: "$3"
|
||||
- pattern : kafka.network<type=(Processor), name=(IdlePercent), networkProcessor=(.+)><>(Value)
|
||||
name: kafka_network_$1_$2_$4
|
||||
labels:
|
||||
network_processor: $3
|
||||
- pattern : kafka.network<type=(RequestMetrics), name=(RequestsPerSec), request=(.+)><>(Count)
|
||||
name: kafka_network_$1_$2_$4
|
||||
labels:
|
||||
request: $3
|
||||
- pattern: kafka.server<type=(.+), name=(.+), topic=(.+)><>(Count|OneMinuteRate)
|
||||
name: kafka_server_$1_$2_$4
|
||||
labels:
|
||||
topic: $3
|
||||
- pattern: kafka.server<type=(DelayedOperationPurgatory), name=(.+), delayedOperation=(.+)><>(Value)
|
||||
name: kafka_server_$1_$2_$3_$4
|
||||
- pattern: kafka.server<type=(.+), name=(.+)><>(Count|Value|OneMinuteRate)
|
||||
name: kafka_server_$1_total_$2_$3
|
||||
- pattern: kafka.server<type=(.+)><>(queue-size)
|
||||
name: kafka_server_$1_$2
|
||||
- pattern: java.lang<type=(.+), name=(.+)><(.+)>(\w+)
|
||||
name: java_lang_$1_$4_$3_$2
|
||||
- pattern: java.lang<type=(.+), name=(.+)><>(\w+)
|
||||
name: java_lang_$1_$3_$2
|
||||
- pattern : java.lang<type=(.*)>
|
||||
- pattern: kafka.log<type=(.+), name=(.+), topic=(.+), partition=(.+)><>Value
|
||||
name: kafka_log_$1_$2
|
||||
labels:
|
||||
topic: $3
|
||||
partition: $4
|
||||
{{- end -}}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
{{- if .Values.metrics.jmx.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-jmx-metrics
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.metrics.jmx.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.metrics.jmx.service.annotations }}
|
||||
{{ include "kafka.tplValue" ( dict "value" .Values.metrics.jmx.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.metrics.jmx.service.type }}
|
||||
{{- if eq .Values.metrics.jmx.service.type "LoadBalancer" }}
|
||||
{{- if .Values.metrics.jmx.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.metrics.jmx.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.jmx.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{- toYaml .Values.metrics.jmx.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.metrics.jmx.service.type "ClusterIP") .Values.metrics.jmx.service.clusterIP }}
|
||||
clusterIP: {{ .Values.metrics.jmx.service.clusterIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: {{ .Values.metrics.jmx.service.port }}
|
||||
protocol: TCP
|
||||
targetPort: metrics
|
||||
{{- if and (or (eq .Values.metrics.jmx.service.type "NodePort") (eq .Values.metrics.jmx.service.type "LoadBalancer")) (not (empty .Values.metrics.jmx.service.nodePort)) }}
|
||||
nodePort: {{ .Values.metrics.jmx.service.nodePort }}
|
||||
{{- else if eq .Values.metrics.jmx.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
selector: {{- include "kafka.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- end }}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
{{- if .Values.metrics.kafka.enabled }}
|
||||
{{- $replicaCount := int .Values.replicaCount -}}
|
||||
{{- $releaseNamespace := .Release.Namespace -}}
|
||||
{{- $clusterDomain := .Values.clusterDomain -}}
|
||||
{{- $fullname := include "kafka.fullname" . -}}
|
||||
{{- $servicePort := int .Values.service.port -}}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-exporter
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: {{- include "kafka.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "kafka.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
spec:
|
||||
{{- include "kafka.imagePullSecrets" . | indent 6 }}
|
||||
containers:
|
||||
- name: kafka-exporter
|
||||
image: {{ include "kafka.metrics.kafka.image" . }}
|
||||
imagePullPolicy: {{ .Values.metrics.kafka.image.pullPolicy | quote }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
read -r -a sasl_passwords <<< "$(tr ',;' ' ' <<< "${SASL_USER_PASSWORD}")"
|
||||
kafka_exporter \
|
||||
{{- range $i, $e := until $replicaCount }}
|
||||
--kafka.server={{ $fullname }}-{{ $i }}.{{ $fullname }}-headless.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ $servicePort }} \
|
||||
{{- end }}
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
--sasl.enabled \
|
||||
--sasl.username="$SASL_USERNAME" \
|
||||
--sasl.password="${sasl_passwords[0]}" \
|
||||
{{- end }}
|
||||
{{- if (include "kafka.tlsEncryption" .) }}
|
||||
--tls.enabled \
|
||||
{{- if .Values.metrics.kafka.certificatesSecret }}
|
||||
--tls.ca-file="/opt/bitnami/kafka-exporter/certs/ca-file" \
|
||||
--tls.cert-file="/opt/bitnami/kafka-exporter/certs/cert-file" \
|
||||
--tls.key-file="/opt/bitnami/kafka-exporter/certs/key-file" \
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $key, $value := .Values.metrics.kafka.extraFlags }}
|
||||
--{{ $key }}{{ if $value }}={{ $value }}{{ end }} \
|
||||
{{- end }}
|
||||
--web.listen-address=:9308
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
env:
|
||||
- name: SASL_USERNAME
|
||||
value: {{ index .Values.auth.jaas.clientUsers 0 | quote }}
|
||||
- name: SASL_USER_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "kafka.jaasSecretName" . }}
|
||||
key: client-passwords
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9308
|
||||
{{- if .Values.metrics.kafka.resources }}
|
||||
resources: {{ toYaml .Values.metrics.kafka.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if and (include "kafka.tlsEncryption" .) .Values.metrics.kafka.certificatesSecret }}
|
||||
volumeMounts:
|
||||
- name: kafka-exporter-certificates
|
||||
mountPath: /opt/bitnami/kafka-exporter/certs/
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: kafka-exporter-certificates
|
||||
secret:
|
||||
secretName: {{ .Values.metrics.kafka.certificatesSecret }}
|
||||
defaultMode: 0440
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
{{- if .Values.metrics.kafka.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-metrics
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.metrics.kafka.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.metrics.kafka.service.annotations }}
|
||||
{{ include "kafka.tplValue" ( dict "value" .Values.metrics.kafka.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.metrics.kafka.service.type }}
|
||||
{{- if eq .Values.metrics.kafka.service.type "LoadBalancer" }}
|
||||
{{- if .Values.metrics.kafka.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.metrics.kafka.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.kafka.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{- toYaml .Values.metrics.kafka.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.metrics.kafka.service.type "ClusterIP") .Values.metrics.kafka.service.clusterIP }}
|
||||
clusterIP: {{ .Values.metrics.kafka.service.clusterIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: {{ .Values.metrics.kafka.service.port }}
|
||||
protocol: TCP
|
||||
targetPort: metrics
|
||||
{{- if and (or (eq .Values.metrics.kafka.service.type "NodePort") (eq .Values.metrics.kafka.service.type "LoadBalancer")) (not (empty .Values.metrics.kafka.service.nodePort)) }}
|
||||
nodePort: {{ .Values.metrics.kafka.service.nodePort }}
|
||||
{{- else if eq .Values.metrics.kafka.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
selector: {{- include "kafka.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- end }}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{{- if (include "kafka.log4j.createConfigMap" .) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "kafka.log4j.configMapName" . }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
log4j.properties: |-
|
||||
{{ .Values.log4j | nindent 4 }}
|
||||
{{- end -}}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- if and .Values.pdb.create (gt $replicaCount 1) }}
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.pdb.minAvailable }}
|
||||
minAvailable: {{ .Values.pdb.minAvailable }}
|
||||
{{- end }}
|
||||
{{- if .Values.pdb.maxUnavailable }}
|
||||
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "kafka.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- end }}
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
{{- if .Values.rbac.create -}}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: Role
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
rules:
|
||||
- apiGroups:
|
||||
- ""
|
||||
resources:
|
||||
- services
|
||||
verbs:
|
||||
- get
|
||||
- list
|
||||
- watch
|
||||
{{- end -}}
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
{{- if and .Values.serviceAccount.create .Values.rbac.create }}
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
roleRef:
|
||||
kind: Role
|
||||
name: {{ template "kafka.fullname" . }}
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: {{ template "kafka.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
|
|
@ -1,118 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-scripts
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
{{- $fullname := include "kafka.fullname" . }}
|
||||
{{- $releaseNamespace := .Release.Namespace }}
|
||||
{{- $clusterDomain := .Values.clusterDomain }}
|
||||
{{- $interBrokerPort := .Values.service.internalPort }}
|
||||
{{- $clientPort := .Values.service.port }}
|
||||
{{- if .Values.externalAccess.autoDiscovery.enabled }}
|
||||
auto-discovery.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
SVC_NAME="${MY_POD_NAME}-external"
|
||||
|
||||
{{- if eq .Values.externalAccess.service.type "LoadBalancer" }}
|
||||
# Auxiliar functions
|
||||
retry_while() {
|
||||
local -r cmd="${1:?cmd is missing}"
|
||||
local -r retries="${2:-12}"
|
||||
local -r sleep_time="${3:-5}"
|
||||
local return_value=1
|
||||
|
||||
read -r -a command <<< "$cmd"
|
||||
for ((i = 1 ; i <= retries ; i+=1 )); do
|
||||
"${command[@]}" && return_value=0 && break
|
||||
sleep "$sleep_time"
|
||||
done
|
||||
return $return_value
|
||||
}
|
||||
k8s_svc_lb_ip() {
|
||||
local namespace=${1:?namespace is missing}
|
||||
local service=${2:?service is missing}
|
||||
local service_ip=$(kubectl get svc "$service" -n "$namespace" -o jsonpath="{.status.loadBalancer.ingress[0].ip}")
|
||||
local service_hostname=$(kubectl get svc "$service" -n "$namespace" -o jsonpath="{.status.loadBalancer.ingress[0].hostname}")
|
||||
|
||||
if [[ -n ${service_ip} ]]; then
|
||||
echo "${service_ip}"
|
||||
else
|
||||
echo "${service_hostname}"
|
||||
fi
|
||||
}
|
||||
k8s_svc_lb_ip_ready() {
|
||||
local namespace=${1:?namespace is missing}
|
||||
local service=${2:?service is missing}
|
||||
[[ -n "$(k8s_svc_lb_ip "$namespace" "$service")" ]]
|
||||
}
|
||||
# Wait until LoadBalancer IP is ready
|
||||
retry_while "k8s_svc_lb_ip_ready {{ $releaseNamespace }} $SVC_NAME" || exit 1
|
||||
# Obtain LoadBalancer external IP
|
||||
k8s_svc_lb_ip "{{ $releaseNamespace }}" "$SVC_NAME" | tee "$SHARED_FILE"
|
||||
{{- else if eq .Values.externalAccess.service.type "NodePort" }}
|
||||
k8s_svc_node_port() {
|
||||
local namespace=${1:?namespace is missing}
|
||||
local service=${2:?service is missing}
|
||||
local index=${3:-0}
|
||||
local node_port="$(kubectl get svc "$service" -n "$namespace" -o jsonpath="{.spec.ports[$index].nodePort}")"
|
||||
echo "$node_port"
|
||||
}
|
||||
k8s_svc_node_port "{{ $releaseNamespace }}" "$SVC_NAME" | tee "$SHARED_FILE"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
setup.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
ID="${MY_POD_NAME#"{{ $fullname }}-"}"
|
||||
export KAFKA_CFG_BROKER_ID="$ID"
|
||||
|
||||
{{- if .Values.externalAccess.enabled }}
|
||||
# Configure external ip and port
|
||||
{{- if eq .Values.externalAccess.service.type "LoadBalancer" }}
|
||||
{{- if .Values.externalAccess.autoDiscovery.enabled }}
|
||||
export EXTERNAL_ACCESS_IP="$(<${SHARED_FILE})"
|
||||
{{- else }}
|
||||
export EXTERNAL_ACCESS_IP=$(echo '{{ .Values.externalAccess.service.loadBalancerIPs }}' | tr -d '[]' | cut -d ' ' -f "$(($ID + 1))")
|
||||
{{- end }}
|
||||
export EXTERNAL_ACCESS_PORT={{ .Values.externalAccess.service.port }}
|
||||
{{- else if eq .Values.externalAccess.service.type "NodePort" }}
|
||||
{{- if .Values.externalAccess.service.domain }}
|
||||
export EXTERNAL_ACCESS_IP={{ .Values.externalAccess.service.domain }}
|
||||
{{- else }}
|
||||
export EXTERNAL_ACCESS_IP=$(curl -s https://ipinfo.io/ip)
|
||||
{{- end }}
|
||||
{{- if .Values.externalAccess.autoDiscovery.enabled }}
|
||||
export EXTERNAL_ACCESS_PORT="$(<${SHARED_FILE})"
|
||||
{{- else }}
|
||||
export EXTERNAL_ACCESS_PORT=$(echo '{{ .Values.externalAccess.service.nodePorts }}' | tr -d '[]' | cut -d ' ' -f "$(($ID + 1))")
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
# Configure Kafka advertised listeners
|
||||
{{- if .Values.advertisedListeners }}
|
||||
export KAFKA_CFG_ADVERTISED_LISTENERS={{ .Values.advertisedListeners }}
|
||||
{{- else }}
|
||||
export KAFKA_CFG_ADVERTISED_LISTENERS="INTERNAL://${MY_POD_NAME}.{{ $fullname }}-headless.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ $interBrokerPort }},CLIENT://${MY_POD_NAME}.{{ $fullname }}-headless.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ $clientPort }},EXTERNAL://${EXTERNAL_ACCESS_IP}:${EXTERNAL_ACCESS_PORT}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- if (include "kafka.tlsEncryption" .) }}
|
||||
if [[ -f "/certs/kafka.truststore.jks" ]] && [[ -f "/certs/kafka-${ID}.keystore.jks" ]]; then
|
||||
mkdir -p /opt/bitnami/kafka/config/certs
|
||||
cp "/certs/kafka.truststore.jks" "/opt/bitnami/kafka/config/certs/kafka.truststore.jks"
|
||||
cp "/certs/kafka-${ID}.keystore.jks" "/opt/bitnami/kafka/config/certs/kafka.keystore.jks"
|
||||
else
|
||||
echo "Couldn't find the expected Java Key Stores (JKS) files! They are mandatory when encryption via TLS is enabled."
|
||||
exit 1
|
||||
fi
|
||||
{{- end }}
|
||||
|
||||
exec /entrypoint.sh /run.sh
|
||||
|
|
@ -1,14 +0,0 @@
|
|||
{{- if .Values.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "kafka.serviceAccountName" . }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
{{- if and .Values.metrics.jmx.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-jmx-metrics
|
||||
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||
{{- end }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- range $key, $value := .Values.metrics.serviceMonitor.selector }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "kafka.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
endpoints:
|
||||
- port: http-metrics
|
||||
path: "/"
|
||||
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
|
|
@ -1,36 +0,0 @@
|
|||
{{- if and .Values.metrics.kafka.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-metrics
|
||||
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||
{{- end }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- range $key, $value := .Values.metrics.serviceMonitor.selector }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "kafka.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
endpoints:
|
||||
- port: http-metrics
|
||||
path: "/metrics"
|
||||
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
|
|
@ -1,435 +0,0 @@
|
|||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- $fullname := include "kafka.fullname" . }}
|
||||
{{- $releaseNamespace := .Release.Namespace }}
|
||||
{{- $clusterDomain := .Values.clusterDomain }}
|
||||
{{- $interBrokerPort := .Values.service.internalPort }}
|
||||
{{- $clientPort := .Values.service.port }}
|
||||
{{- $interBrokerProtocol := include "kafka.listenerType" ( dict "protocol" .Values.auth.interBrokerProtocol ) -}}
|
||||
{{- $clientProtocol := include "kafka.listenerType" ( dict "protocol" .Values.auth.clientProtocol ) -}}
|
||||
{{- $loadBalancerIPListLength := len .Values.externalAccess.service.loadBalancerIPs }}
|
||||
{{- if not (and .Values.externalAccess.enabled (not .Values.externalAccess.autoDiscovery.enabled) (not (eq $replicaCount $loadBalancerIPListLength )) (eq .Values.externalAccess.service.type "LoadBalancer")) }}
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "kafka.fullname" . }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
podManagementPolicy: Parallel
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels: {{- include "kafka.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
serviceName: {{ template "kafka.fullname" . }}-headless
|
||||
updateStrategy:
|
||||
type: {{ .Values.updateStrategy | quote }}
|
||||
{{- if (eq "OnDelete" .Values.updateStrategy) }}
|
||||
rollingUpdate: null
|
||||
{{- else if .Values.rollingUpdatePartition }}
|
||||
rollingUpdate:
|
||||
partition: {{ .Values.rollingUpdatePartition }}
|
||||
{{- end }}
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "kafka.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.podLabels }}
|
||||
{{- include "kafka.tplValue" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if or (include "kafka.createConfigmap" .) (include "kafka.createJaasSecret" .) .Values.externalAccess.enabled (include "kafka.metrics.jmx.createConfigmap" .) .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- if (include "kafka.createConfigmap" .) }}
|
||||
checksum/configuration: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if (include "kafka.createJaasSecret" .) }}
|
||||
checksum/secret: {{ include (print $.Template.BasePath "/jaas-secret.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if .Values.externalAccess.enabled }}
|
||||
checksum/scripts: {{ include (print $.Template.BasePath "/scripts-configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if (include "kafka.metrics.jmx.createConfigmap" .) }}
|
||||
checksum/jmx-configuration: {{ include (print $.Template.BasePath "/jmx-configmap.yaml") . | sha256sum }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
{{- include "kafka.tplValue" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- include "kafka.imagePullSecrets" . | indent 6 }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "kafka.tplValue" ( dict "value" .Values.affinity "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "kafka.tplValue" ( dict "value" .Values.nodeSelector "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "kafka.tplValue" ( dict "value" .Values.tolerations "context" $ ) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: {{ .Values.priorityClassName }}
|
||||
{{- end }}
|
||||
{{- if .Values.podSecurityContext }}
|
||||
securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
serviceAccountName: {{ template "kafka.serviceAccountName" . }}
|
||||
{{- end }}
|
||||
{{- if or (and .Values.volumePermissions.enabled .Values.persistence.enabled) (and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled) }}
|
||||
initContainers:
|
||||
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
||||
- name: volume-permissions
|
||||
image: {{ include "kafka.volumePermissions.image" . }}
|
||||
imagePullPolicy: {{ .Values.volumePermissions.image.pullPolicy | quote }}
|
||||
command:
|
||||
- /bin/bash
|
||||
args:
|
||||
- -ec
|
||||
- |
|
||||
mkdir -p /bitnami/kafka
|
||||
chown -R "{{ .Values.podSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }}" "/bitnami/kafka"
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
{{- if .Values.volumePermissions.resources }}
|
||||
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/kafka
|
||||
{{- end }}
|
||||
{{- if and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled }}
|
||||
- name: auto-discovery
|
||||
image: {{ include "kafka.externalAccess.autoDiscovery.image" . }}
|
||||
imagePullPolicy: {{ .Values.externalAccess.autoDiscovery.image.pullPolicy | quote }}
|
||||
command:
|
||||
- /scripts/auto-discovery.sh
|
||||
env:
|
||||
- name: MY_POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: SHARED_FILE
|
||||
value: "/shared/info.txt"
|
||||
{{- if .Values.externalAccess.autoDiscovery.resources }}
|
||||
resources: {{- toYaml .Values.externalAccess.autoDiscovery.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: shared
|
||||
mountPath: /shared
|
||||
- name: scripts
|
||||
mountPath: /scripts/auto-discovery.sh
|
||||
subPath: auto-discovery.sh
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: kafka
|
||||
image: {{ include "kafka.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
command: {{- include "kafka.tplValue" (dict "value" .Values.command "context" $) | nindent 12 }}
|
||||
{{- if .Values.args }}
|
||||
args: {{- include "kafka.tplValue" (dict "value" .Values.args "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: {{ ternary "true" "false" .Values.image.debug | quote }}
|
||||
- name: MY_POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: MY_POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: KAFKA_CFG_ZOOKEEPER_CONNECT
|
||||
{{- if .Values.zookeeper.enabled }}
|
||||
value: {{ include "kafka.zookeeper.fullname" . | quote }}
|
||||
{{- else }}
|
||||
value: {{ join "," .Values.externalZookeeper.servers | quote }}
|
||||
{{- end }}
|
||||
- name: KAFKA_INTER_BROKER_LISTENER_NAME
|
||||
value: {{ .Values.interBrokerListenerName | quote }}
|
||||
- name: KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP
|
||||
{{- if .Values.listenerSecurityProtocolMap }}
|
||||
value: {{ .Values.listenerSecurityProtocolMap | quote }}
|
||||
{{- else if .Values.externalAccess.enabled }}
|
||||
value: "INTERNAL:{{ $interBrokerProtocol }},CLIENT:{{ $clientProtocol }},EXTERNAL:{{ $clientProtocol }}"
|
||||
{{- else }}
|
||||
value: "INTERNAL:{{ $interBrokerProtocol }},CLIENT:{{ $clientProtocol }}"
|
||||
{{- end }}
|
||||
{{- if or ($clientProtocol | regexFind "SASL") ($interBrokerProtocol | regexFind "SASL") .Values.auth.jaas.zookeeperUser }}
|
||||
- name: KAFKA_CFG_SASL_ENABLED_MECHANISMS
|
||||
value: {{ include "kafka.auth.saslMechanisms" ( dict "type" .Values.auth.saslMechanisms ) }}
|
||||
- name: KAFKA_CFG_SASL_MECHANISM_INTER_BROKER_PROTOCOL
|
||||
value: {{ upper .Values.auth.saslInterBrokerMechanism | quote }}
|
||||
{{- end }}
|
||||
- name: KAFKA_CFG_LISTENERS
|
||||
{{- if .Values.listeners }}
|
||||
value: {{ .Values.listeners }}
|
||||
{{- else if .Values.externalAccess.enabled }}
|
||||
value: "INTERNAL://:{{ $interBrokerPort }},CLIENT://:9092,EXTERNAL://:9094"
|
||||
{{- else }}
|
||||
value: "INTERNAL://:{{ $interBrokerPort }},CLIENT://:9092"
|
||||
{{- end }}
|
||||
{{- if .Values.externalAccess.enabled }}
|
||||
{{- if .Values.externalAccess.autoDiscovery.enabled }}
|
||||
- name: SHARED_FILE
|
||||
value: "/shared/info.txt"
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
- name: KAFKA_CFG_ADVERTISED_LISTENERS
|
||||
{{- if .Values.advertisedListeners }}
|
||||
value: {{ .Values.advertisedListeners }}
|
||||
{{- else }}
|
||||
value: "INTERNAL://$(MY_POD_NAME).{{ $fullname }}-headless.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ $interBrokerPort }},CLIENT://$(MY_POD_NAME).{{ $fullname }}-headless.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ $clientPort }}"
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
- name: ALLOW_PLAINTEXT_LISTENER
|
||||
value: {{ ternary "yes" "no" (or .Values.auth.enabled .Values.allowPlaintextListener) | quote }}
|
||||
{{- if or (include "kafka.client.saslAuthentication" .) (include "kafka.interBroker.saslAuthentication" .) }}
|
||||
- name: KAFKA_OPTS
|
||||
value: "-Djava.security.auth.login.config=/opt/bitnami/kafka/config/kafka_jaas.conf"
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
- name: KAFKA_CLIENT_USERS
|
||||
value: {{ join "," .Values.auth.jaas.clientUsers | quote }}
|
||||
- name: KAFKA_CLIENT_PASSWORDS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "kafka.jaasSecretName" . }}
|
||||
key: client-passwords
|
||||
{{- end }}
|
||||
{{- if .Values.auth.jaas.zookeeperUser }}
|
||||
- name: KAFKA_ZOOKEEPER_PROTOCOL
|
||||
value: "SASL"
|
||||
- name: KAFKA_ZOOKEEPER_USER
|
||||
value: {{ .Values.auth.jaas.zookeeperUser | quote }}
|
||||
- name: KAFKA_ZOOKEEPER_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "kafka.jaasSecretName" . }}
|
||||
key: zookeeper-password
|
||||
{{- end }}
|
||||
{{- if (include "kafka.interBroker.saslAuthentication" .) }}
|
||||
- name: KAFKA_INTER_BROKER_USER
|
||||
value: {{ .Values.auth.jaas.interBrokerUser | quote }}
|
||||
- name: KAFKA_INTER_BROKER_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "kafka.jaasSecretName" . }}
|
||||
key: inter-broker-password
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if (include "kafka.tlsEncryption" .) }}
|
||||
- name: KAFKA_CFG_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM
|
||||
value: {{ .Values.auth.tlsEndpointIdentificationAlgorithm | quote }}
|
||||
{{- if .Values.auth.jksPassword }}
|
||||
- name: KAFKA_CERTIFICATE_PASSWORD
|
||||
value: {{ .Values.auth.jksPassword | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.jmx.enabled }}
|
||||
- name: JMX_PORT
|
||||
value: "5555"
|
||||
{{- end }}
|
||||
- name: KAFKA_CFG_DELETE_TOPIC_ENABLE
|
||||
value: {{ .Values.deleteTopicEnable | quote }}
|
||||
- name: KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE
|
||||
value: {{ .Values.autoCreateTopicsEnable | quote }}
|
||||
- name: KAFKA_HEAP_OPTS
|
||||
value: {{ .Values.heapOpts | quote }}
|
||||
- name: KAFKA_CFG_LOG_FLUSH_INTERVAL_MESSAGES
|
||||
value: {{ .Values.logFlushIntervalMessages | quote }}
|
||||
- name: KAFKA_CFG_LOG_FLUSH_INTERVAL_MS
|
||||
value: {{ .Values.logFlushIntervalMs | quote }}
|
||||
- name: KAFKA_CFG_LOG_RETENTION_BYTES
|
||||
value: {{ .Values.logRetentionBytes | replace "_" "" | quote }}
|
||||
- name: KAFKA_CFG_LOG_RETENTION_CHECK_INTERVALS_MS
|
||||
value: {{ .Values.logRetentionCheckIntervalMs | quote }}
|
||||
- name: KAFKA_CFG_LOG_RETENTION_HOURS
|
||||
value: {{ .Values.logRetentionHours | quote }}
|
||||
- name: KAFKA_CFG_MESSAGE_MAX_BYTES
|
||||
value: {{ .Values.maxMessageBytes | replace "_" "" | quote }}
|
||||
- name: KAFKA_CFG_LOG_SEGMENT_BYTES
|
||||
value: {{ .Values.logSegmentBytes | replace "_" "" | quote }}
|
||||
- name: KAFKA_CFG_LOG_DIRS
|
||||
value: {{ .Values.logsDirs | quote }}
|
||||
- name: KAFKA_CFG_DEFAULT_REPLICATION_FACTOR
|
||||
value: {{ .Values.defaultReplicationFactor | quote }}
|
||||
- name: KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR
|
||||
value: {{ .Values.offsetsTopicReplicationFactor | quote }}
|
||||
- name: KAFKA_CFG_TRANSACTION_STATE_LOG_REPLICATION_FACTOR
|
||||
value: {{ .Values.transactionStateLogReplicationFactor | quote }}
|
||||
- name: KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR
|
||||
value: {{ .Values.transactionStateLogMinIsr | quote }}
|
||||
- name: KAFKA_CFG_NUM_IO_THREADS
|
||||
value: {{ .Values.numIoThreads | quote }}
|
||||
- name: KAFKA_CFG_NUM_NETWORK_THREADS
|
||||
value: {{ .Values.numNetworkThreads | quote }}
|
||||
- name: KAFKA_CFG_NUM_PARTITIONS
|
||||
value: {{ .Values.numPartitions | quote }}
|
||||
- name: KAFKA_CFG_NUM_RECOVERY_THREADS_PER_DATA_DIR
|
||||
value: {{ .Values.numRecoveryThreadsPerDataDir | quote }}
|
||||
- name: KAFKA_CFG_SOCKET_RECEIVE_BUFFER_BYTES
|
||||
value: {{ .Values.socketReceiveBufferBytes | quote }}
|
||||
- name: KAFKA_CFG_SOCKET_REQUEST_MAX_BYTES
|
||||
value: {{ .Values.socketRequestMaxBytes | replace "_" "" | quote }}
|
||||
- name: KAFKA_CFG_SOCKET_SEND_BUFFER_BYTES
|
||||
value: {{ .Values.socketSendBufferBytes | quote }}
|
||||
- name: KAFKA_CFG_ZOOKEEPER_CONNECTION_TIMEOUT_MS
|
||||
value: {{ .Values.zookeeperConnectionTimeoutMs | quote }}
|
||||
{{- if .Values.extraEnvVars }}
|
||||
{{ include "kafka.tplValue" ( dict "value" .Values.extraEnvVars "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: kafka-client
|
||||
containerPort: 9092
|
||||
- name: kafka-internal
|
||||
containerPort: {{ $interBrokerPort }}
|
||||
{{- if .Values.externalAccess.enabled }}
|
||||
- name: kafka-external
|
||||
containerPort: 9094
|
||||
{{- end }}
|
||||
{{- if .Values.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: kafka-client
|
||||
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
||||
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||
{{- else if .Values.customLivenessProbe }}
|
||||
livenessProbe: {{- include "kafka.tplValue" (dict "value" .Values.customlivenessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: kafka-client
|
||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||
{{- else if .Values.customReadinessProbe }}
|
||||
readinessProbe: {{- include "kafka.tplValue" (dict "value" .Values.customreadinessProbe "context" $) | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.resources }}
|
||||
resources: {{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/kafka
|
||||
{{- if or .Values.config .Values.existingConfigmap }}
|
||||
- name: kafka-config
|
||||
mountPath: /bitnami/kafka/config/server.properties
|
||||
subPath: server.properties
|
||||
{{- end }}
|
||||
{{- if or .Values.log4j .Values.existingLog4jConfigMap }}
|
||||
- name: log4j-config
|
||||
mountPath: /bitnami/kafka/config/log4j.properties
|
||||
subPath: log4j.properties
|
||||
{{- end }}
|
||||
- name: scripts
|
||||
mountPath: /scripts/setup.sh
|
||||
subPath: setup.sh
|
||||
{{- if and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled }}
|
||||
- name: shared
|
||||
mountPath: /shared
|
||||
{{- end }}
|
||||
{{- if (include "kafka.tlsEncryption" .) }}
|
||||
- name: kafka-certificates
|
||||
mountPath: /certs
|
||||
readOnly: true
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumeMounts }}
|
||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.jmx.enabled }}
|
||||
- name: jmx-exporter
|
||||
image: {{ template "kafka.metrics.jmx.image" . }}
|
||||
imagePullPolicy: {{ .Values.metrics.jmx.image.pullPolicy | quote }}
|
||||
command:
|
||||
- java
|
||||
- -XX:+UnlockExperimentalVMOptions
|
||||
- -XX:+UseCGroupMemoryLimitForHeap
|
||||
- -XX:MaxRAMFraction=1
|
||||
- -XshowSettings:vm
|
||||
- -jar
|
||||
- jmx_prometheus_httpserver.jar
|
||||
- "5556"
|
||||
- /etc/jmx-kafka/jmx-kafka-prometheus.yml
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 5556
|
||||
{{- if .Values.metrics.jmx.resources }}
|
||||
resources: {{- toYaml .Values.metrics.jmx.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: jmx-config
|
||||
mountPath: /etc/jmx-kafka
|
||||
{{- end }}
|
||||
{{- if .Values.sidecars }}
|
||||
{{- include "kafka.tplValue" (dict "value" .Values.sidecars "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if or .Values.config .Values.existingConfigmap }}
|
||||
- name: kafka-config
|
||||
configMap:
|
||||
name: {{ include "kafka.configmapName" . }}
|
||||
{{- end }}
|
||||
{{- if or .Values.log4j .Values.existingLog4jConfigMap }}
|
||||
- name: log4j-config
|
||||
configMap:
|
||||
name: {{ include "kafka.log4j.configMapName" . }}
|
||||
{{ end }}
|
||||
- name: scripts
|
||||
configMap:
|
||||
name: {{ include "kafka.fullname" . }}-scripts
|
||||
defaultMode: 0755
|
||||
{{- if and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled }}
|
||||
- name: shared
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.jmx.enabled }}
|
||||
- name: jmx-config
|
||||
configMap:
|
||||
name: {{ include "kafka.metrics.jmx.configmapName" . }}
|
||||
{{- end }}
|
||||
{{- if (include "kafka.tlsEncryption" .) }}
|
||||
- name: kafka-certificates
|
||||
secret:
|
||||
secretName: {{ include "kafka.jksSecretName" . }}
|
||||
defaultMode: 256
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if not .Values.persistence.enabled }}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- else if .Values.persistence.existingClaim }}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ printf "%s" (tpl .Values.persistence.existingClaim .) }}
|
||||
{{- else }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
{{- if .Values.persistence.annotations }}
|
||||
annotations: {{- include "kafka.tplValue" (dict "value" .Values.persistence.annotations "context" $) | nindent 10 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{ include "kafka.storageClass" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,52 +0,0 @@
|
|||
{{- if .Values.externalAccess.enabled }}
|
||||
{{- $fullName := include "kafka.fullname" . }}
|
||||
{{- $replicaCount := .Values.replicaCount | int }}
|
||||
{{- $root := . }}
|
||||
|
||||
{{- range $i, $e := until $replicaCount }}
|
||||
{{- $targetPod := printf "%s-%d" (printf "%s" $fullName) $i }}
|
||||
---
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" $ }}-{{ $i }}-external
|
||||
labels: {{- include "kafka.labels" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
pod: {{ $targetPod }}
|
||||
{{- if $root.Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" $root.Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or $root.Values.externalAccess.service.annotations $root.Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if $root.Values.externalAccess.service.annotations }}
|
||||
{{ include "kafka.tplValue" ( dict "value" $root.Values.externalAccess.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if $root.Values.commonAnnotations }}
|
||||
{{- include "kafka.tplValue" ( dict "value" $root.Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ $root.Values.externalAccess.service.type }}
|
||||
{{- if eq $root.Values.externalAccess.service.type "LoadBalancer" }}
|
||||
{{- if not (empty $root.Values.externalAccess.service.loadBalancerIPs) }}
|
||||
loadBalancerIP: {{ index $root.Values.externalAccess.service.loadBalancerIPs $i }}
|
||||
{{- end }}
|
||||
{{- if $root.Values.externalAccess.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{- toYaml $root.Values.externalAccess.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: tcp-kafka
|
||||
port: {{ $root.Values.externalAccess.service.port }}
|
||||
{{- if not (empty $root.Values.externalAccess.service.nodePorts) }}
|
||||
nodePort: {{ index $root.Values.externalAccess.service.nodePorts $i }}
|
||||
{{- else }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
targetPort: kafka-external
|
||||
selector: {{- include "kafka.matchLabels" $ | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
statefulset.kubernetes.io/pod-name: {{ $targetPod }}
|
||||
---
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-headless
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: tcp-client
|
||||
port: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
targetPort: kafka-client
|
||||
- name: tcp-internal
|
||||
port: {{ .Values.service.internalPort }}
|
||||
protocol: TCP
|
||||
targetPort: kafka-internal
|
||||
selector: {{- include "kafka.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
|
|
@ -1,49 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.service.annotations }}
|
||||
{{ include "kafka.tplValue" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
{{- if eq .Values.service.type "LoadBalancer" }}
|
||||
{{- if .Values.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{- toYaml .Values.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: tcp-client
|
||||
port: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
targetPort: kafka-client
|
||||
{{- if and (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) (not (empty .Values.service.nodePorts.client)) }}
|
||||
nodePort: {{ .Values.service.nodePorts.client }}
|
||||
{{- else if eq .Values.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
{{- if and .Values.externalAccess.enabled (or (eq .Values.service.type "NodePort") (eq .Values.service.type "LoadBalancer")) }}
|
||||
- name: tcp-external
|
||||
port: {{ .Values.service.externalPort }}
|
||||
protocol: TCP
|
||||
targetPort: kafka-external
|
||||
{{- if (not (empty .Values.service.nodePorts.external)) }}
|
||||
nodePort: {{ .Values.service.nodePorts.external }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
selector: {{- include "kafka.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
|
|
@ -1,931 +0,0 @@
|
|||
## Global Docker image parameters
|
||||
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
|
||||
##
|
||||
# global:
|
||||
# imageRegistry: myRegistryName
|
||||
# imagePullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
# storageClass: myStorageClass
|
||||
|
||||
## Bitnami Kafka image version
|
||||
## ref: https://hub.docker.com/r/bitnami/kafka/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/kafka
|
||||
tag: 2.6.0-debian-10-r30
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
|
||||
## Set to true if you would like to see extra information on logs
|
||||
##
|
||||
debug: false
|
||||
|
||||
## String to partially override kafka.fullname template (will maintain the release name)
|
||||
##
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override kafka.fullname template
|
||||
##
|
||||
# fullnameOverride:
|
||||
|
||||
## Kubernetes Cluster Domain
|
||||
##
|
||||
clusterDomain: cluster.local
|
||||
|
||||
## Add labels to all the deployed resources
|
||||
##
|
||||
commonLabels: {}
|
||||
|
||||
## Add annotations to all the deployed resources
|
||||
##
|
||||
commonAnnotations: {}
|
||||
|
||||
## Kafka Configuration
|
||||
## Specify content for server.properties
|
||||
## The server.properties is auto-generated based on other parameters when this paremeter is not specified
|
||||
##
|
||||
## Example:
|
||||
## config: |-
|
||||
## broker.id=-1
|
||||
## listeners=PLAINTEXT://:9092
|
||||
## advertised.listeners=PLAINTEXT://KAFKA_IP:9092
|
||||
## num.network.threads=3
|
||||
## num.io.threads=8
|
||||
## socket.send.buffer.bytes=102400
|
||||
## socket.receive.buffer.bytes=102400
|
||||
## socket.request.max.bytes=104857600
|
||||
## log.dirs=/bitnami/kafka/data
|
||||
## num.partitions=1
|
||||
## num.recovery.threads.per.data.dir=1
|
||||
## offsets.topic.replication.factor=1
|
||||
## transaction.state.log.replication.factor=1
|
||||
## transaction.state.log.min.isr=1
|
||||
## log.flush.interval.messages=10000
|
||||
## log.flush.interval.ms=1000
|
||||
## log.retention.hours=168
|
||||
## log.retention.bytes=1073741824
|
||||
## log.segment.bytes=1073741824
|
||||
## log.retention.check.interval.ms=300000
|
||||
## zookeeper.connect=ZOOKEEPER_SERVICE_NAME
|
||||
## zookeeper.connection.timeout.ms=6000
|
||||
## group.initial.rebalance.delay.ms=0
|
||||
##
|
||||
# config:
|
||||
|
||||
## ConfigMap with Kafka Configuration
|
||||
## NOTE: This will override config
|
||||
##
|
||||
# existingConfigmap:
|
||||
|
||||
## Kafka Log4J Configuration
|
||||
## An optional log4j.properties file to overwrite the default of the Kafka brokers.
|
||||
## See an example log4j.properties at:
|
||||
## https://github.com/apache/kafka/blob/trunk/config/log4j.properties
|
||||
##
|
||||
# log4j:
|
||||
|
||||
## Kafka Log4j ConfigMap
|
||||
## The name of an existing ConfigMap containing a log4j.properties file.
|
||||
## NOTE: this will override log4j.
|
||||
##
|
||||
# existingLog4jConfigMap:
|
||||
|
||||
## Kafka's Java Heap size
|
||||
##
|
||||
heapOpts: -Xmx1024m -Xms1024m
|
||||
|
||||
## Switch to enable topic deletion or not.
|
||||
##
|
||||
deleteTopicEnable: false
|
||||
|
||||
## Switch to enable auto creation of topics.
|
||||
## Enabling auto creation of topics not recommended for production or similar environments.
|
||||
##
|
||||
autoCreateTopicsEnable: false
|
||||
|
||||
## The number of messages to accept before forcing a flush of data to disk.
|
||||
##
|
||||
logFlushIntervalMessages: 10000
|
||||
|
||||
## The maximum amount of time a message can sit in a log before we force a flush.
|
||||
##
|
||||
logFlushIntervalMs: 1000
|
||||
|
||||
## A size-based retention policy for logs.
|
||||
##
|
||||
logRetentionBytes: _1073741824
|
||||
|
||||
## The interval at which log segments are checked to see if they can be deleted.
|
||||
##
|
||||
logRetentionCheckIntervalMs: 300000
|
||||
|
||||
## The minimum age of a log file to be eligible for deletion due to age.
|
||||
##
|
||||
logRetentionHours: 168
|
||||
|
||||
## The maximum size of a log segment file. When this size is reached a new log segment will be created.
|
||||
##
|
||||
logSegmentBytes: _1073741824
|
||||
|
||||
## A comma separated list of directories under which to store log files.
|
||||
##
|
||||
logsDirs: /bitnami/kafka/data
|
||||
|
||||
## The largest record batch size allowed by Kafka
|
||||
##
|
||||
maxMessageBytes: _1000012
|
||||
|
||||
## Default replication factors for automatically created topics
|
||||
##
|
||||
defaultReplicationFactor: 3
|
||||
|
||||
## The replication factor for the offsets topic
|
||||
##
|
||||
offsetsTopicReplicationFactor: 3
|
||||
|
||||
## The replication factor for the transaction topic
|
||||
##
|
||||
transactionStateLogReplicationFactor: 3
|
||||
|
||||
## Overridden min.insync.replicas config for the transaction topic
|
||||
##
|
||||
transactionStateLogMinIsr: 3
|
||||
|
||||
## The number of threads doing disk I/O.
|
||||
##
|
||||
numIoThreads: 8
|
||||
|
||||
## The number of threads handling network requests.
|
||||
##
|
||||
numNetworkThreads: 3
|
||||
|
||||
## The default number of log partitions per topic.
|
||||
##
|
||||
numPartitions: 1
|
||||
|
||||
## The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
|
||||
##
|
||||
numRecoveryThreadsPerDataDir: 1
|
||||
|
||||
## The receive buffer (SO_RCVBUF) used by the socket server.
|
||||
##
|
||||
socketReceiveBufferBytes: 102400
|
||||
|
||||
## The maximum size of a request that the socket server will accept (protection against OOM).
|
||||
##
|
||||
socketRequestMaxBytes: _104857600
|
||||
|
||||
## The send buffer (SO_SNDBUF) used by the socket server.
|
||||
##
|
||||
socketSendBufferBytes: 102400
|
||||
|
||||
## Timeout in ms for connecting to zookeeper.
|
||||
##
|
||||
zookeeperConnectionTimeoutMs: 6000
|
||||
|
||||
## Command and args for running the container. Use array form
|
||||
##
|
||||
command:
|
||||
- /scripts/setup.sh
|
||||
args:
|
||||
|
||||
## All the parameters from the configuration file can be overwritten by using environment variables with this format: KAFKA_CFG_{KEY}
|
||||
## ref: https://github.com/bitnami/bitnami-docker-kafka#configuration
|
||||
## Example:
|
||||
## extraEnvVars:
|
||||
## - name: KAFKA_CFG_BACKGROUND_THREADS
|
||||
## value: "10"
|
||||
##
|
||||
extraEnvVars: []
|
||||
|
||||
## extraVolumes and extraVolumeMounts allows you to mount other volumes
|
||||
## Examples:
|
||||
# extraVolumes:
|
||||
# - name: kafka-jaas
|
||||
# secret:
|
||||
# secretName: kafka-jaas
|
||||
# extraVolumeMounts:
|
||||
# - name: kafka-jaas
|
||||
# mountPath: /bitnami/kafka/config/kafka_jaas.conf
|
||||
# subPath: kafka_jaas.conf
|
||||
extraVolumes: []
|
||||
extraVolumeMounts: []
|
||||
|
||||
## Extra objects to deploy (value evaluated as a template)
|
||||
##
|
||||
extraDeploy: []
|
||||
|
||||
## Authentication parameteres
|
||||
## https://github.com/bitnami/bitnami-docker-kafka#security
|
||||
##
|
||||
auth:
|
||||
## Authentication protocol for client and inter-broker communications
|
||||
## Supported values: 'plaintext', 'tls', 'mtls', 'sasl' and 'sasl_tls'
|
||||
## This table shows the security provided on each protocol:
|
||||
## | Method | Authentication | Encryption via TLS |
|
||||
## | plaintext | None | No |
|
||||
## | tls | None | Yes |
|
||||
## | mtls | Yes (two-way authentication) | Yes |
|
||||
## | sasl | Yes (via SASL) | No |
|
||||
## | sasl_tls | Yes (via SASL) | Yes |
|
||||
##
|
||||
clientProtocol: sasl
|
||||
interBrokerProtocol: sasl
|
||||
|
||||
## Allowed SASL mechanisms when clientProtocol or interBrokerProtocol are using either sasl or sasl_tls
|
||||
##
|
||||
saslMechanisms: plain,scram-sha-256,scram-sha-512
|
||||
## SASL mechanism for inter broker communication
|
||||
##
|
||||
saslInterBrokerMechanism: plain
|
||||
|
||||
## Name of the existing secret containing the truststore and
|
||||
## one keystore per Kafka broker you have in the Kafka cluster.
|
||||
## MANDATORY when 'tls', 'mtls', or 'sasl_tls' authentication protocols are used.
|
||||
## Create this secret following the steps below:
|
||||
## 1) Generate your trustore and keystore files. Helpful script: https://raw.githubusercontent.com/confluentinc/confluent-platform-security-tools/master/kafka-generate-ssl.sh
|
||||
## 2) Rename your truststore to `kafka.truststore.jks`.
|
||||
## 3) Rename your keystores to `kafka-X.keystore.jks` where X is the ID of each Kafka broker.
|
||||
## 4) Run the command below where SECRET_NAME is the name of the secret you want to create:
|
||||
## kubectl create secret generic SECRET_NAME --from-file=./kafka.truststore.jks --from-file=./kafka-0.keystore.jks --from-file=./kafka-1.keystore.jks ...
|
||||
## Alternatively, you can put your JKS files under the files/jks directory
|
||||
##
|
||||
# jksSecret:
|
||||
|
||||
## Password to access the JKS files when they are password-protected.
|
||||
##
|
||||
# jksPassword:
|
||||
|
||||
## The endpoint identification algorithm used by clients to validate server host name.
|
||||
## Disable server host name verification by setting it to an empty string
|
||||
## See: https://docs.confluent.io/current/kafka/authentication_ssl.html#optional-settings
|
||||
##
|
||||
tlsEndpointIdentificationAlgorithm: https
|
||||
|
||||
## JAAS configuration for SASL authentication
|
||||
## MANDATORY when method is 'sasl', or 'sasl_tls'
|
||||
##
|
||||
jaas:
|
||||
## Kafka client user list
|
||||
##
|
||||
## clientUsers:
|
||||
## - user1
|
||||
## - user2
|
||||
##
|
||||
clientUsers:
|
||||
- user
|
||||
|
||||
## Kafka client passwords
|
||||
##
|
||||
## clientPasswords:
|
||||
## - password1
|
||||
## - password2
|
||||
##
|
||||
clientPasswords: []
|
||||
|
||||
## Kafka inter broker communication user
|
||||
##
|
||||
interBrokerUser: admin
|
||||
|
||||
## Kafka inter broker communication password
|
||||
##
|
||||
interBrokerPassword: ""
|
||||
|
||||
## Kafka Zookeeper user
|
||||
##
|
||||
zookeeperUser: zookeeperUser
|
||||
|
||||
## Kafka Zookeeper password
|
||||
##
|
||||
zookeeperPassword: zookeeperPassword
|
||||
|
||||
## Name of the existing secret containing credentials for clientUsers, interBrokerUser and zookeeperUser.
|
||||
## Create this secret running the command below where SECRET_NAME is the name of the secret you want to create:
|
||||
## kubectl create secret generic SECRET_NAME --from-literal=client-password=CLIENT_PASSWORD1,CLIENT_PASSWORD2 --from-literal=inter-broker-password=INTER_BROKER_PASSWORD --from-literal=zookeeper-password=ZOOKEEPER_PASSWORD
|
||||
##
|
||||
# existingSecret:
|
||||
|
||||
## The address(es) the socket server listens on.
|
||||
## When it's set to an empty array, the listeners will be configured
|
||||
## based on the authentication protocols (auth.clientProtocol and auth.interBrokerProtocol parameters)
|
||||
##
|
||||
listeners: []
|
||||
|
||||
## The address(es) (hostname:port) the brokers will advertise to producers and consumers.
|
||||
## When it's set to an empty array, the advertised listeners will be configured
|
||||
## based on the authentication protocols (auth.clientProtocol and auth.interBrokerProtocol parameters)
|
||||
##
|
||||
advertisedListeners: []
|
||||
|
||||
## The listener->protocol mapping
|
||||
## When it's nil, the listeners will be configured
|
||||
## based on the authentication protocols (auth.clientProtocol and auth.interBrokerProtocol parameters)
|
||||
##
|
||||
# listenerSecurityProtocolMap:
|
||||
|
||||
## Allow to use the PLAINTEXT listener.
|
||||
##
|
||||
allowPlaintextListener: false
|
||||
|
||||
## Name of listener used for communication between brokers.
|
||||
##
|
||||
interBrokerListenerName: INTERNAL
|
||||
|
||||
## Number of Kafka brokers to deploy
|
||||
##
|
||||
replicaCount: 3
|
||||
|
||||
## StrategyType, can be set to RollingUpdate or OnDelete by default.
|
||||
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets
|
||||
##
|
||||
updateStrategy: RollingUpdate
|
||||
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
##
|
||||
# rollingUpdatePartition:
|
||||
|
||||
## Pod labels. Evaluated as a template
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
podLabels: {}
|
||||
|
||||
## Pod annotations. Evaluated as a template
|
||||
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
##
|
||||
podAnnotations: {}
|
||||
|
||||
## Name of the priority class to be used by kafka pods, priority class needs to be created beforehand
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
priorityClassName: ""
|
||||
|
||||
## Affinity for pod assignment. Evaluated as a template
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Node labels for pod assignment. Evaluated as a template
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment. Evaluated as a template
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
## Kafka pods' Security Context
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
|
||||
##
|
||||
podSecurityContext:
|
||||
fsGroup: 1001
|
||||
runAsUser: 1001
|
||||
|
||||
## Kafka containers' Security Context
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
|
||||
## Example:
|
||||
## containerSecurityContext:
|
||||
## capabilities:
|
||||
## drop: ["NET_RAW"]
|
||||
## readOnlyRootFilesystem: true
|
||||
##
|
||||
containerSecurityContext: {}
|
||||
|
||||
## Kafka containers' resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 250m
|
||||
# memory: 1Gi
|
||||
requests: {}
|
||||
# cpu: 250m
|
||||
# memory: 256Mi
|
||||
|
||||
## Kafka containers' liveness and readiness probes. Evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
|
||||
##
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: kafka-client
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 5
|
||||
# failureThreshold: 3
|
||||
# periodSeconds: 10
|
||||
# successThreshold: 1
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: kafka-client
|
||||
initialDelaySeconds: 5
|
||||
failureThreshold: 6
|
||||
timeoutSeconds: 5
|
||||
# periodSeconds: 10
|
||||
# successThreshold: 1
|
||||
|
||||
## Pod Disruption Budget configuration
|
||||
## The PDB will only be created if replicaCount is greater than 1
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions
|
||||
##
|
||||
pdb:
|
||||
create: true
|
||||
## Min number of pods that must still be available after the eviction
|
||||
##
|
||||
# minAvailable: 1
|
||||
## Max number of pods that can be unavailable after the eviction
|
||||
##
|
||||
maxUnavailable: 1
|
||||
|
||||
## Add sidecars to the pod.
|
||||
## Example:
|
||||
## sidecars:
|
||||
## - name: your-image-name
|
||||
## image: your-image
|
||||
## imagePullPolicy: Always
|
||||
## ports:
|
||||
## - name: portname
|
||||
## containerPort: 1234
|
||||
##
|
||||
sidecars: {}
|
||||
|
||||
## Service parameters
|
||||
##
|
||||
service:
|
||||
## Service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## Kafka port for client connections
|
||||
##
|
||||
port: 9092
|
||||
## Kafka port for inter-broker connections
|
||||
##
|
||||
internalPort: 9093
|
||||
## Kafka port for external connections
|
||||
##
|
||||
externalPort: 9094
|
||||
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||
##
|
||||
nodePorts:
|
||||
client: ""
|
||||
external: ""
|
||||
## Set the LoadBalancer service type to internal only.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||
##
|
||||
# loadBalancerIP:
|
||||
## Load Balancer sources
|
||||
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||
## Example:
|
||||
## loadBalancerSourceRanges:
|
||||
## - 10.10.10.0/24
|
||||
##
|
||||
loadBalancerSourceRanges: []
|
||||
## Provide any additional annotations which may be required. Evaluated as a template
|
||||
##
|
||||
annotations: {}
|
||||
|
||||
## External Access to Kafka brokers configuration
|
||||
##
|
||||
externalAccess:
|
||||
## Enable Kubernetes external cluster access to Kafka brokers
|
||||
##
|
||||
enabled: false
|
||||
|
||||
## External IPs auto-discovery configuration
|
||||
## An init container is used to auto-detect LB IPs or node ports by querying the K8s API
|
||||
## Note: RBAC might be required
|
||||
##
|
||||
autoDiscovery:
|
||||
## Enable external IP/ports auto-discovery
|
||||
##
|
||||
enabled: false
|
||||
## Bitnami Kubectl image
|
||||
## ref: https://hub.docker.com/r/bitnami/kubectl/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/kubectl
|
||||
tag: 1.17.12-debian-10-r3
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
## Init Container resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
requests: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Parameters to configure K8s service(s) used to externally access Kafka brokers
|
||||
## A new service per broker will be created
|
||||
##
|
||||
service:
|
||||
## Service type. Allowed values: LoadBalancer or NodePort
|
||||
##
|
||||
type: LoadBalancer
|
||||
## Port used when service type is LoadBalancer
|
||||
##
|
||||
port: 9094
|
||||
## Array of load balancer IPs for each Kafka broker. Length must be the same as replicaCount
|
||||
## Example:
|
||||
## loadBalancerIPs:
|
||||
## - X.X.X.X
|
||||
## - Y.Y.Y.Y
|
||||
##
|
||||
loadBalancerIPs: []
|
||||
## Load Balancer sources
|
||||
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||
## Example:
|
||||
## loadBalancerSourceRanges:
|
||||
## - 10.10.10.0/24
|
||||
##
|
||||
loadBalancerSourceRanges: []
|
||||
## Array of node ports used for each Kafka broker. Length must be the same as replicaCount
|
||||
## Example:
|
||||
## nodePorts:
|
||||
## - 30001
|
||||
## - 30002
|
||||
##
|
||||
nodePorts: []
|
||||
## When service type is NodePort, you can specify the domain used for Kafka advertised listeners.
|
||||
## If not specified, the container will try to get the kubernetes node external IP
|
||||
##
|
||||
# domain: mydomain.com
|
||||
## Provide any additional annotations which may be required. Evaluated as a template
|
||||
##
|
||||
annotations: {}
|
||||
|
||||
## Persistence paramaters
|
||||
##
|
||||
persistence:
|
||||
enabled: true
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
## PV Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner.
|
||||
##
|
||||
# storageClass: "-"
|
||||
## PV Access Mode
|
||||
##
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
## PVC size
|
||||
##
|
||||
size: 8Gi
|
||||
## PVC annotations
|
||||
##
|
||||
annotations: {}
|
||||
|
||||
## Init Container paramaters
|
||||
## Change the owner and group of the persistent volume(s) mountpoint(s) to 'runAsUser:fsGroup' on each component
|
||||
## values from the securityContext section of the component
|
||||
##
|
||||
volumePermissions:
|
||||
enabled: false
|
||||
## Bitnami Minideb image
|
||||
## ref: https://hub.docker.com/r/bitnami/minideb/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/minideb
|
||||
tag: buster
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
## Init Container resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
requests: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Kafka pods ServiceAccount
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||
##
|
||||
serviceAccount:
|
||||
## Specifies whether a ServiceAccount should be created
|
||||
##
|
||||
create: true
|
||||
## The name of the ServiceAccount to use.
|
||||
## If not set and create is true, a name is generated using the fluentd.fullname template
|
||||
##
|
||||
# name:
|
||||
|
||||
## Role Based Access
|
||||
## ref: https://kubernetes.io/docs/admin/authorization/rbac/
|
||||
##
|
||||
rbac:
|
||||
## Specifies whether RBAC rules should be created
|
||||
## binding Kafka ServiceAccount to a role
|
||||
## that allows Kafka pods querying the K8s API
|
||||
##
|
||||
create: false
|
||||
|
||||
## Prometheus Exporters / Metrics
|
||||
##
|
||||
metrics:
|
||||
## Prometheus Kafka Exporter: exposes complimentary metrics to JMX Exporter
|
||||
##
|
||||
kafka:
|
||||
enabled: true
|
||||
|
||||
## Bitnami Kafka exporter image
|
||||
## ref: https://hub.docker.com/r/bitnami/kafka-exporter/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/kafka-exporter
|
||||
tag: 1.2.0-debian-10-r220
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
|
||||
## Extra flags to be passed to Kafka exporter
|
||||
## Example:
|
||||
## extraFlags:
|
||||
## tls.insecure-skip-tls-verify: ""
|
||||
## web.telemetry-path: "/metrics"
|
||||
##
|
||||
extraFlags: {}
|
||||
|
||||
## Name of the existing secret containing the optional certificate and key files
|
||||
## for Kafka Exporter client authentication
|
||||
##
|
||||
# certificatesSecret:
|
||||
|
||||
## Prometheus Kafka Exporter' resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
requests: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Service configuration
|
||||
##
|
||||
service:
|
||||
## Kafka Exporter Service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## Kafka Exporter Prometheus port
|
||||
##
|
||||
port: 9308
|
||||
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||
##
|
||||
nodePort: ""
|
||||
## Set the LoadBalancer service type to internal only.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||
##
|
||||
# loadBalancerIP:
|
||||
## Load Balancer sources
|
||||
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||
## Example:
|
||||
## loadBalancerSourceRanges:
|
||||
## - 10.10.10.0/24
|
||||
##
|
||||
loadBalancerSourceRanges: []
|
||||
## Set the Cluster IP to use
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address
|
||||
##
|
||||
# clusterIP: None
|
||||
## Annotations for the Kafka Exporter Prometheus metrics service
|
||||
##
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "{{ .Values.metrics.kafka.service.port }}"
|
||||
prometheus.io/path: "/metrics"
|
||||
|
||||
## Prometheus JMX Exporter: exposes the majority of Kafkas metrics
|
||||
##
|
||||
jmx:
|
||||
enabled: true
|
||||
|
||||
## Bitnami JMX exporter image
|
||||
## ref: https://hub.docker.com/r/bitnami/jmx-exporter/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/jmx-exporter
|
||||
tag: 0.14.0-debian-10-r15
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
|
||||
## Prometheus JMX Exporter' resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
requests: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Service configuration
|
||||
##
|
||||
service:
|
||||
## JMX Exporter Service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## JMX Exporter Prometheus port
|
||||
##
|
||||
port: 5556
|
||||
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||
##
|
||||
nodePort: ""
|
||||
## Set the LoadBalancer service type to internal only.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||
##
|
||||
# loadBalancerIP:
|
||||
## Load Balancer sources
|
||||
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||
## Example:
|
||||
## loadBalancerSourceRanges:
|
||||
## - 10.10.10.0/24
|
||||
##
|
||||
loadBalancerSourceRanges: []
|
||||
## Set the Cluster IP to use
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address
|
||||
##
|
||||
# clusterIP: None
|
||||
## Annotations for the JMX Exporter Prometheus metrics service
|
||||
##
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "{{ .Values.metrics.jmx.service.port }}"
|
||||
prometheus.io/path: "/"
|
||||
|
||||
## JMX Whitelist Objects, can be set to control which JMX metrics are exposed. Only whitelisted
|
||||
## values will be exposed via JMX Exporter. They must also be exposed via Rules. To expose all metrics
|
||||
## (warning its crazy excessive and they aren't formatted in a prometheus style) (1) `whitelistObjectNames: []`
|
||||
## (2) commented out above `overrideConfig`.
|
||||
##
|
||||
whitelistObjectNames:
|
||||
- kafka.controller:*
|
||||
- kafka.server:*
|
||||
- java.lang:*
|
||||
- kafka.network:*
|
||||
- kafka.log:*
|
||||
|
||||
## Prometheus JMX exporter configuration
|
||||
## Specify content for jmx-kafka-prometheus.yml. Evaluated as a template
|
||||
##
|
||||
## Credits to the incubator/kafka chart for the JMX configuration.
|
||||
## https://github.com/helm/charts/tree/master/incubator/kafka
|
||||
##
|
||||
config: |-
|
||||
jmxUrl: service:jmx:rmi:///jndi/rmi://127.0.0.1:5555/jmxrmi
|
||||
lowercaseOutputName: true
|
||||
lowercaseOutputLabelNames: true
|
||||
ssl: false
|
||||
{{- if .Values.metrics.jmx.whitelistObjectNames }}
|
||||
whitelistObjectNames: ["{{ join "\",\"" .Values.metrics.jmx.whitelistObjectNames }}"]
|
||||
{{- end }}
|
||||
|
||||
## ConfigMap with Prometheus JMX exporter configuration
|
||||
## NOTE: This will override metrics.jmx.config
|
||||
##
|
||||
# existingConfigmap:
|
||||
|
||||
## Prometheus Operator ServiceMonitor configuration
|
||||
##
|
||||
serviceMonitor:
|
||||
enabled: false
|
||||
## Namespace in which Prometheus is running
|
||||
##
|
||||
# namespace: monitoring
|
||||
|
||||
## Interval at which metrics should be scraped.
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# interval: 10s
|
||||
|
||||
## Timeout after which the scrape is ended
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# scrapeTimeout: 10s
|
||||
|
||||
## ServiceMonitor selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
##
|
||||
## Zookeeper chart configuration
|
||||
##
|
||||
## https://github.com/bitnami/charts/blob/master/bitnami/zookeeper/values.yaml
|
||||
##
|
||||
zookeeper:
|
||||
enabled: true
|
||||
auth:
|
||||
## Enable Zookeeper auth
|
||||
##
|
||||
enabled: true
|
||||
## User that will use Zookeeper clients to auth
|
||||
##
|
||||
clientUser: zookeeperUser
|
||||
## Password that will use Zookeeper clients to auth
|
||||
##
|
||||
clientPassword: zookeeperPassword
|
||||
## Comma, semicolon or whitespace separated list of user to be created. Specify them as a string, for example: "user1,user2,admin"
|
||||
##
|
||||
serverUsers: zookeeperUser
|
||||
## Comma, semicolon or whitespace separated list of passwords to assign to users when created. Specify them as a string, for example: "pass4user1, pass4user2, pass4admin"
|
||||
##
|
||||
serverPasswords: zookeeperPassword
|
||||
metrics:
|
||||
enabled: true
|
||||
|
||||
## This value is only used when zookeeper.enabled is set to false
|
||||
##
|
||||
externalZookeeper:
|
||||
## Server or list of external zookeeper servers to use.
|
||||
##
|
||||
servers: []
|
||||
|
|
@ -1,934 +0,0 @@
|
|||
## Global Docker image parameters
|
||||
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
|
||||
##
|
||||
# global:
|
||||
# imageRegistry: myRegistryName
|
||||
# imagePullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
# storageClass: myStorageClass
|
||||
|
||||
## Bitnami Kafka image version
|
||||
## ref: https://hub.docker.com/r/bitnami/kafka/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/kafka
|
||||
tag: 2.6.0-debian-10-r30
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
|
||||
## Set to true if you would like to see extra information on logs
|
||||
##
|
||||
debug: false
|
||||
|
||||
## String to partially override kafka.fullname template (will maintain the release name)
|
||||
##
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override kafka.fullname template
|
||||
##
|
||||
# fullnameOverride:
|
||||
|
||||
## Kubernetes Cluster Domain
|
||||
##
|
||||
clusterDomain: cluster.local
|
||||
|
||||
## Add labels to all the deployed resources
|
||||
##
|
||||
commonLabels: {}
|
||||
|
||||
## Add annotations to all the deployed resources
|
||||
##
|
||||
commonAnnotations: {}
|
||||
|
||||
## Kafka Configuration
|
||||
## Specify content for server.properties
|
||||
## The server.properties is auto-generated based on other parameters when this paremeter is not specified
|
||||
##
|
||||
## Example:
|
||||
## config: |-
|
||||
## broker.id=-1
|
||||
## listeners=PLAINTEXT://:9092
|
||||
## advertised.listeners=PLAINTEXT://KAFKA_IP:9092
|
||||
## num.network.threads=3
|
||||
## num.io.threads=8
|
||||
## socket.send.buffer.bytes=102400
|
||||
## socket.receive.buffer.bytes=102400
|
||||
## socket.request.max.bytes=104857600
|
||||
## log.dirs=/bitnami/kafka/data
|
||||
## num.partitions=1
|
||||
## num.recovery.threads.per.data.dir=1
|
||||
## offsets.topic.replication.factor=1
|
||||
## transaction.state.log.replication.factor=1
|
||||
## transaction.state.log.min.isr=1
|
||||
## log.flush.interval.messages=10000
|
||||
## log.flush.interval.ms=1000
|
||||
## log.retention.hours=168
|
||||
## log.retention.bytes=1073741824
|
||||
## log.segment.bytes=1073741824
|
||||
## log.retention.check.interval.ms=300000
|
||||
## zookeeper.connect=ZOOKEEPER_SERVICE_NAME
|
||||
## zookeeper.connection.timeout.ms=6000
|
||||
## group.initial.rebalance.delay.ms=0
|
||||
##
|
||||
# config:
|
||||
|
||||
## ConfigMap with Kafka Configuration
|
||||
## NOTE: This will override config
|
||||
##
|
||||
# existingConfigmap:
|
||||
|
||||
## Kafka Log4J Configuration
|
||||
## An optional log4j.properties file to overwrite the default of the Kafka brokers.
|
||||
## See an example log4j.properties at:
|
||||
## https://github.com/apache/kafka/blob/trunk/config/log4j.properties
|
||||
##
|
||||
# log4j:
|
||||
|
||||
## Kafka Log4j ConfigMap
|
||||
## The name of an existing ConfigMap containing a log4j.properties file.
|
||||
## NOTE: this will override log4j.
|
||||
##
|
||||
# existingLog4jConfigMap:
|
||||
|
||||
## Kafka's Java Heap size
|
||||
##
|
||||
heapOpts: -Xmx1024m -Xms1024m
|
||||
|
||||
## Switch to enable topic deletion or not.
|
||||
##
|
||||
deleteTopicEnable: false
|
||||
|
||||
## Switch to enable auto creation of topics.
|
||||
## Enabling auto creation of topics not recommended for production or similar environments.
|
||||
##
|
||||
autoCreateTopicsEnable: true
|
||||
|
||||
## The number of messages to accept before forcing a flush of data to disk.
|
||||
##
|
||||
logFlushIntervalMessages: 10000
|
||||
|
||||
## The maximum amount of time a message can sit in a log before we force a flush.
|
||||
##
|
||||
logFlushIntervalMs: 1000
|
||||
|
||||
## A size-based retention policy for logs.
|
||||
##
|
||||
logRetentionBytes: _1073741824
|
||||
|
||||
## The interval at which log segments are checked to see if they can be deleted.
|
||||
##
|
||||
logRetentionCheckIntervalMs: 300000
|
||||
|
||||
## The minimum age of a log file to be eligible for deletion due to age.
|
||||
##
|
||||
logRetentionHours: 168
|
||||
|
||||
## The maximum size of a log segment file. When this size is reached a new log segment will be created.
|
||||
##
|
||||
logSegmentBytes: _1073741824
|
||||
|
||||
## A comma separated list of directories under which to store log files.
|
||||
##
|
||||
logsDirs: /bitnami/kafka/data
|
||||
|
||||
## The largest record batch size allowed by Kafka
|
||||
##
|
||||
maxMessageBytes: _1000012
|
||||
|
||||
## Default replication factors for automatically created topics
|
||||
##
|
||||
defaultReplicationFactor: 1
|
||||
|
||||
## The replication factor for the offsets topic
|
||||
##
|
||||
offsetsTopicReplicationFactor: 1
|
||||
|
||||
## The replication factor for the transaction topic
|
||||
##
|
||||
transactionStateLogReplicationFactor: 1
|
||||
|
||||
## Overridden min.insync.replicas config for the transaction topic
|
||||
##
|
||||
transactionStateLogMinIsr: 1
|
||||
|
||||
## The number of threads doing disk I/O.
|
||||
##
|
||||
numIoThreads: 8
|
||||
|
||||
## The number of threads handling network requests.
|
||||
##
|
||||
numNetworkThreads: 3
|
||||
|
||||
## The default number of log partitions per topic.
|
||||
##
|
||||
numPartitions: 1
|
||||
|
||||
## The number of threads per data directory to be used for log recovery at startup and flushing at shutdown.
|
||||
##
|
||||
numRecoveryThreadsPerDataDir: 1
|
||||
|
||||
## The receive buffer (SO_RCVBUF) used by the socket server.
|
||||
##
|
||||
socketReceiveBufferBytes: 102400
|
||||
|
||||
## The maximum size of a request that the socket server will accept (protection against OOM).
|
||||
##
|
||||
socketRequestMaxBytes: _104857600
|
||||
|
||||
## The send buffer (SO_SNDBUF) used by the socket server.
|
||||
##
|
||||
socketSendBufferBytes: 102400
|
||||
|
||||
## Timeout in ms for connecting to zookeeper.
|
||||
##
|
||||
zookeeperConnectionTimeoutMs: 6000
|
||||
|
||||
## Command and args for running the container. Use array form
|
||||
##
|
||||
command:
|
||||
- /scripts/setup.sh
|
||||
args:
|
||||
|
||||
## All the parameters from the configuration file can be overwritten by using environment variables with this format: KAFKA_CFG_{KEY}
|
||||
## ref: https://github.com/bitnami/bitnami-docker-kafka#configuration
|
||||
## Example:
|
||||
## extraEnvVars:
|
||||
## - name: KAFKA_CFG_BACKGROUND_THREADS
|
||||
## value: "10"
|
||||
##
|
||||
extraEnvVars: []
|
||||
|
||||
## extraVolumes and extraVolumeMounts allows you to mount other volumes
|
||||
## Examples:
|
||||
# extraVolumes:
|
||||
# - name: kafka-jaas
|
||||
# secret:
|
||||
# secretName: kafka-jaas
|
||||
# extraVolumeMounts:
|
||||
# - name: kafka-jaas
|
||||
# mountPath: /bitnami/kafka/config/kafka_jaas.conf
|
||||
# subPath: kafka_jaas.conf
|
||||
extraVolumes: []
|
||||
extraVolumeMounts: []
|
||||
|
||||
## Extra objects to deploy (value evaluated as a template)
|
||||
##
|
||||
extraDeploy: []
|
||||
|
||||
## Authentication parameteres
|
||||
## https://github.com/bitnami/bitnami-docker-kafka#security
|
||||
##
|
||||
auth:
|
||||
## Authentication protocol for client and inter-broker communications
|
||||
## Supported values: 'plaintext', 'tls', 'mtls', 'sasl' and 'sasl_tls'
|
||||
## This table shows the security provided on each protocol:
|
||||
## | Method | Authentication | Encryption via TLS |
|
||||
## | plaintext | None | No |
|
||||
## | tls | None | Yes |
|
||||
## | mtls | Yes (two-way authentication) | Yes |
|
||||
## | sasl | Yes (via SASL) | No |
|
||||
## | sasl_tls | Yes (via SASL) | Yes |
|
||||
##
|
||||
clientProtocol: plaintext
|
||||
interBrokerProtocol: plaintext
|
||||
|
||||
## Allowed SASL mechanisms when clientProtocol or interBrokerProtocol are using either sasl or sasl_tls
|
||||
##
|
||||
saslMechanisms: plain,scram-sha-256,scram-sha-512
|
||||
## SASL mechanism for inter broker communication
|
||||
##
|
||||
saslInterBrokerMechanism: plain
|
||||
|
||||
## Name of the existing secret containing the truststore and
|
||||
## one keystore per Kafka broker you have in the Kafka cluster.
|
||||
## MANDATORY when 'tls', 'mtls', or 'sasl_tls' authentication protocols are used.
|
||||
## Create this secret following the steps below:
|
||||
## 1) Generate your trustore and keystore files. Helpful script: https://raw.githubusercontent.com/confluentinc/confluent-platform-security-tools/master/kafka-generate-ssl.sh
|
||||
## 2) Rename your truststore to `kafka.truststore.jks`.
|
||||
## 3) Rename your keystores to `kafka-X.keystore.jks` where X is the ID of each Kafka broker.
|
||||
## 4) Run the command below where SECRET_NAME is the name of the secret you want to create:
|
||||
## kubectl create secret generic SECRET_NAME --from-file=./kafka.truststore.jks --from-file=./kafka-0.keystore.jks --from-file=./kafka-1.keystore.jks ...
|
||||
## Alternatively, you can put your JKS files under the files/jks directory
|
||||
##
|
||||
# jksSecret:
|
||||
|
||||
## Password to access the JKS files when they are password-protected.
|
||||
##
|
||||
# jksPassword:
|
||||
|
||||
## The endpoint identification algorithm used by clients to validate server host name.
|
||||
## Disable server host name verification by setting it to an empty string
|
||||
## See: https://docs.confluent.io/current/kafka/authentication_ssl.html#optional-settings
|
||||
##
|
||||
tlsEndpointIdentificationAlgorithm: https
|
||||
|
||||
## JAAS configuration for SASL authentication
|
||||
## MANDATORY when method is 'sasl', or 'sasl_tls'
|
||||
##
|
||||
jaas:
|
||||
## Kafka client user list
|
||||
##
|
||||
## clientUsers:
|
||||
## - user1
|
||||
## - user2
|
||||
##
|
||||
clientUsers:
|
||||
- user
|
||||
|
||||
## Kafka client passwords. This is mandatory if more than one user is specified in clientUsers.
|
||||
##
|
||||
## clientPasswords:
|
||||
## - password1
|
||||
## - password2"
|
||||
##
|
||||
clientPasswords: []
|
||||
|
||||
## Kafka inter broker communication user
|
||||
##
|
||||
interBrokerUser: admin
|
||||
|
||||
## Kafka inter broker communication password
|
||||
##
|
||||
interBrokerPassword: ""
|
||||
|
||||
## Kafka Zookeeper user
|
||||
##
|
||||
# zookeeperUser:
|
||||
|
||||
## Kafka Zookeeper password
|
||||
##
|
||||
# zookeeperPassword:
|
||||
|
||||
## Name of the existing secret containing credentials for clientUsers, interBrokerUser and zookeeperUser.
|
||||
## Create this secret running the command below where SECRET_NAME is the name of the secret you want to create:
|
||||
## kubectl create secret generic SECRET_NAME --from-literal=client-passwords=CLIENT_PASSWORD1,CLIENT_PASSWORD2 --from-literal=inter-broker-password=INTER_BROKER_PASSWORD --from-literal=zookeeper-password=ZOOKEEPER_PASSWORD
|
||||
##
|
||||
# existingSecret:
|
||||
|
||||
## The address(es) the socket server listens on.
|
||||
## When it's set to an empty array, the listeners will be configured
|
||||
## based on the authentication protocols (auth.clientProtocol and auth.interBrokerProtocol parameters)
|
||||
##
|
||||
listeners: []
|
||||
|
||||
## The address(es) (hostname:port) the brokers will advertise to producers and consumers.
|
||||
## When it's set to an empty array, the advertised listeners will be configured
|
||||
## based on the authentication protocols (auth.clientProtocol and auth.interBrokerProtocol parameters)
|
||||
##
|
||||
advertisedListeners: []
|
||||
|
||||
## The listener->protocol mapping
|
||||
## When it's nil, the listeners will be configured
|
||||
## based on the authentication protocols (auth.clientProtocol and auth.interBrokerProtocol parameters)
|
||||
##
|
||||
# listenerSecurityProtocolMap:
|
||||
|
||||
## Allow to use the PLAINTEXT listener.
|
||||
##
|
||||
allowPlaintextListener: true
|
||||
|
||||
## Name of listener used for communication between brokers.
|
||||
##
|
||||
interBrokerListenerName: INTERNAL
|
||||
|
||||
## Number of Kafka brokers to deploy
|
||||
##
|
||||
replicaCount: 2
|
||||
|
||||
## StrategyType, can be set to RollingUpdate or OnDelete by default.
|
||||
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets
|
||||
##
|
||||
updateStrategy: RollingUpdate
|
||||
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
##
|
||||
# rollingUpdatePartition:
|
||||
|
||||
## Pod labels. Evaluated as a template
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
##
|
||||
podLabels: {}
|
||||
|
||||
## Pod annotations. Evaluated as a template
|
||||
## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
##
|
||||
podAnnotations: {}
|
||||
|
||||
## Name of the priority class to be used by kafka pods, priority class needs to be created beforehand
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
##
|
||||
priorityClassName: ""
|
||||
|
||||
## Affinity for pod assignment. Evaluated as a template
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Node labels for pod assignment. Evaluated as a template
|
||||
## ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment. Evaluated as a template
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
## Kafka pods' Security Context
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod
|
||||
##
|
||||
podSecurityContext:
|
||||
fsGroup: 1001
|
||||
runAsUser: 1001
|
||||
|
||||
## Kafka containers' Security Context
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container
|
||||
## Example:
|
||||
## containerSecurityContext:
|
||||
## capabilities:
|
||||
## drop: ["NET_RAW"]
|
||||
## readOnlyRootFilesystem: true
|
||||
##
|
||||
containerSecurityContext: {}
|
||||
|
||||
## Kafka containers' resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 250m
|
||||
# memory: 1Gi
|
||||
requests: {}
|
||||
# cpu: 250m
|
||||
# memory: 256Mi
|
||||
|
||||
## Kafka containers' liveness and readiness probes. Evaluated as a template.
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes
|
||||
##
|
||||
livenessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 5
|
||||
# failureThreshold: 3
|
||||
# periodSeconds: 10
|
||||
# successThreshold: 1
|
||||
readinessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 5
|
||||
failureThreshold: 6
|
||||
timeoutSeconds: 5
|
||||
# periodSeconds: 10
|
||||
# successThreshold: 1
|
||||
|
||||
## Custom liveness/readiness probes that will override the default ones
|
||||
##
|
||||
customLivenessProbe: {}
|
||||
customReadinessProbe: {}
|
||||
|
||||
## Pod Disruption Budget configuration
|
||||
## The PDB will only be created if replicaCount is greater than 1
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions
|
||||
##
|
||||
pdb:
|
||||
create: true
|
||||
## Min number of pods that must still be available after the eviction
|
||||
##
|
||||
# minAvailable: 1
|
||||
## Max number of pods that can be unavailable after the eviction
|
||||
##
|
||||
maxUnavailable: 1
|
||||
|
||||
## Add sidecars to the pod.
|
||||
## Example:
|
||||
## sidecars:
|
||||
## - name: your-image-name
|
||||
## image: your-image
|
||||
## imagePullPolicy: Always
|
||||
## ports:
|
||||
## - name: portname
|
||||
## containerPort: 1234
|
||||
##
|
||||
sidecars: {}
|
||||
|
||||
## Service parameters
|
||||
##
|
||||
service:
|
||||
## Service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## Kafka port for client connections
|
||||
##
|
||||
port: 9092
|
||||
## Kafka port for inter-broker connections
|
||||
##
|
||||
internalPort: 9093
|
||||
## Kafka port for external connections
|
||||
##
|
||||
externalPort: 9094
|
||||
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||
##
|
||||
nodePorts:
|
||||
client: ""
|
||||
external: ""
|
||||
## Set the LoadBalancer service type to internal only.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||
##
|
||||
# loadBalancerIP:
|
||||
## Load Balancer sources
|
||||
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||
## Example:
|
||||
## loadBalancerSourceRanges:
|
||||
## - 10.10.10.0/24
|
||||
##
|
||||
loadBalancerSourceRanges: []
|
||||
## Provide any additional annotations which may be required. Evaluated as a template
|
||||
##
|
||||
annotations: {}
|
||||
|
||||
## External Access to Kafka brokers configuration
|
||||
##
|
||||
externalAccess:
|
||||
## Enable Kubernetes external cluster access to Kafka brokers
|
||||
##
|
||||
enabled: false
|
||||
|
||||
## External IPs auto-discovery configuration
|
||||
## An init container is used to auto-detect LB IPs or node ports by querying the K8s API
|
||||
## Note: RBAC might be required
|
||||
##
|
||||
autoDiscovery:
|
||||
## Enable external IP/ports auto-discovery
|
||||
##
|
||||
enabled: false
|
||||
## Bitnami Kubectl image
|
||||
## ref: https://hub.docker.com/r/bitnami/kubectl/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/kubectl
|
||||
tag: 1.17.12-debian-10-r3
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
## Init Container resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
requests: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Parameters to configure K8s service(s) used to externally access Kafka brokers
|
||||
## A new service per broker will be created
|
||||
##
|
||||
service:
|
||||
## Service type. Allowed values: LoadBalancer or NodePort
|
||||
##
|
||||
type: LoadBalancer
|
||||
## Port used when service type is LoadBalancer
|
||||
##
|
||||
port: 9094
|
||||
## Array of load balancer IPs for each Kafka broker. Length must be the same as replicaCount
|
||||
## Example:
|
||||
## loadBalancerIPs:
|
||||
## - X.X.X.X
|
||||
## - Y.Y.Y.Y
|
||||
##
|
||||
loadBalancerIPs: []
|
||||
## Load Balancer sources
|
||||
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||
## Example:
|
||||
## loadBalancerSourceRanges:
|
||||
## - 10.10.10.0/24
|
||||
##
|
||||
loadBalancerSourceRanges: []
|
||||
## Array of node ports used for each Kafka broker. Length must be the same as replicaCount
|
||||
## Example:
|
||||
## nodePorts:
|
||||
## - 30001
|
||||
## - 30002
|
||||
##
|
||||
nodePorts: []
|
||||
## When service type is NodePort, you can specify the domain used for Kafka advertised listeners.
|
||||
## If not specified, the container will try to get the kubernetes node external IP
|
||||
##
|
||||
# domain: mydomain.com
|
||||
## Provide any additional annotations which may be required. Evaluated as a template
|
||||
##
|
||||
annotations: {}
|
||||
|
||||
## Persistence paramaters
|
||||
##
|
||||
persistence:
|
||||
enabled: true
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
## PV Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner.
|
||||
##
|
||||
# storageClass: "-"
|
||||
## PV Access Mode
|
||||
##
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
## PVC size
|
||||
##
|
||||
size: 8Gi
|
||||
## PVC annotations
|
||||
##
|
||||
annotations: {}
|
||||
|
||||
## Init Container paramaters
|
||||
## Change the owner and group of the persistent volume(s) mountpoint(s) to 'runAsUser:fsGroup' on each component
|
||||
## values from the securityContext section of the component
|
||||
##
|
||||
volumePermissions:
|
||||
enabled: false
|
||||
## Bitnami Minideb image
|
||||
## ref: https://hub.docker.com/r/bitnami/minideb/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/minideb
|
||||
tag: buster
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
## Init Container resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
requests: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Kafka pods ServiceAccount
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||
##
|
||||
serviceAccount:
|
||||
## Specifies whether a ServiceAccount should be created
|
||||
##
|
||||
create: true
|
||||
## The name of the ServiceAccount to use.
|
||||
## If not set and create is true, a name is generated using the fluentd.fullname template
|
||||
##
|
||||
# name:
|
||||
|
||||
## Role Based Access
|
||||
## ref: https://kubernetes.io/docs/admin/authorization/rbac/
|
||||
##
|
||||
rbac:
|
||||
## Specifies whether RBAC rules should be created
|
||||
## binding Kafka ServiceAccount to a role
|
||||
## that allows Kafka pods querying the K8s API
|
||||
##
|
||||
create: false
|
||||
|
||||
## Prometheus Exporters / Metrics
|
||||
##
|
||||
metrics:
|
||||
## Prometheus Kafka Exporter: exposes complimentary metrics to JMX Exporter
|
||||
##
|
||||
kafka:
|
||||
enabled: false
|
||||
|
||||
## Bitnami Kafka exporter image
|
||||
## ref: https://hub.docker.com/r/bitnami/kafka-exporter/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/kafka-exporter
|
||||
tag: 1.2.0-debian-10-r220
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
|
||||
## Extra flags to be passed to Kafka exporter
|
||||
## Example:
|
||||
## extraFlags:
|
||||
## tls.insecure-skip-tls-verify: ""
|
||||
## web.telemetry-path: "/metrics"
|
||||
##
|
||||
extraFlags: {}
|
||||
|
||||
## Name of the existing secret containing the optional certificate and key files
|
||||
## for Kafka Exporter client authentication
|
||||
##
|
||||
# certificatesSecret:
|
||||
|
||||
## Prometheus Kafka Exporter' resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
requests: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Service configuration
|
||||
##
|
||||
service:
|
||||
## Kafka Exporter Service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## Kafka Exporter Prometheus port
|
||||
##
|
||||
port: 9308
|
||||
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||
##
|
||||
nodePort: ""
|
||||
## Set the LoadBalancer service type to internal only.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||
##
|
||||
# loadBalancerIP:
|
||||
## Load Balancer sources
|
||||
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||
## Example:
|
||||
## loadBalancerSourceRanges:
|
||||
## - 10.10.10.0/24
|
||||
##
|
||||
loadBalancerSourceRanges: []
|
||||
## Set the Cluster IP to use
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address
|
||||
##
|
||||
# clusterIP: None
|
||||
## Annotations for the Kafka Exporter Prometheus metrics service
|
||||
##
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "{{ .Values.metrics.kafka.service.port }}"
|
||||
prometheus.io/path: "/metrics"
|
||||
|
||||
## Prometheus JMX Exporter: exposes the majority of Kafkas metrics
|
||||
##
|
||||
jmx:
|
||||
enabled: false
|
||||
|
||||
## Bitnami JMX exporter image
|
||||
## ref: https://hub.docker.com/r/bitnami/jmx-exporter/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/jmx-exporter
|
||||
tag: 0.14.0-debian-10-r15
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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/
|
||||
## Example:
|
||||
## pullSecrets:
|
||||
## - myRegistryKeySecretName
|
||||
##
|
||||
pullSecrets: []
|
||||
|
||||
## Prometheus JMX Exporter' resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
limits: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
requests: {}
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
## Service configuration
|
||||
##
|
||||
service:
|
||||
## JMX Exporter Service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## JMX Exporter Prometheus port
|
||||
##
|
||||
port: 5556
|
||||
## Specify the nodePort value for the LoadBalancer and NodePort service types.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport
|
||||
##
|
||||
nodePort: ""
|
||||
## Set the LoadBalancer service type to internal only.
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer
|
||||
##
|
||||
# loadBalancerIP:
|
||||
## Load Balancer sources
|
||||
## ref: https://kubernetes.io/docs/tasks/access-application-cluster/configure-cloud-provider-firewall/#restrict-access-for-loadbalancer-service
|
||||
## Example:
|
||||
## loadBalancerSourceRanges:
|
||||
## - 10.10.10.0/24
|
||||
##
|
||||
loadBalancerSourceRanges: []
|
||||
## Set the Cluster IP to use
|
||||
## ref: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address
|
||||
##
|
||||
# clusterIP: None
|
||||
## Annotations for the JMX Exporter Prometheus metrics service
|
||||
##
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "{{ .Values.metrics.jmx.service.port }}"
|
||||
prometheus.io/path: "/"
|
||||
|
||||
## JMX Whitelist Objects, can be set to control which JMX metrics are exposed. Only whitelisted
|
||||
## values will be exposed via JMX Exporter. They must also be exposed via Rules. To expose all metrics
|
||||
## (warning its crazy excessive and they aren't formatted in a prometheus style) (1) `whitelistObjectNames: []`
|
||||
## (2) commented out above `overrideConfig`.
|
||||
##
|
||||
whitelistObjectNames:
|
||||
- kafka.controller:*
|
||||
- kafka.server:*
|
||||
- java.lang:*
|
||||
- kafka.network:*
|
||||
- kafka.log:*
|
||||
|
||||
## Prometheus JMX exporter configuration
|
||||
## Specify content for jmx-kafka-prometheus.yml. Evaluated as a template
|
||||
##
|
||||
## Credits to the incubator/kafka chart for the JMX configuration.
|
||||
## https://github.com/helm/charts/tree/master/incubator/kafka
|
||||
##
|
||||
config: |-
|
||||
jmxUrl: service:jmx:rmi:///jndi/rmi://127.0.0.1:5555/jmxrmi
|
||||
lowercaseOutputName: true
|
||||
lowercaseOutputLabelNames: true
|
||||
ssl: false
|
||||
{{- if .Values.metrics.jmx.whitelistObjectNames }}
|
||||
whitelistObjectNames: ["{{ join "\",\"" .Values.metrics.jmx.whitelistObjectNames }}"]
|
||||
{{- end }}
|
||||
|
||||
## ConfigMap with Prometheus JMX exporter configuration
|
||||
## NOTE: This will override metrics.jmx.config
|
||||
##
|
||||
# existingConfigmap:
|
||||
|
||||
## Prometheus Operator ServiceMonitor configuration
|
||||
##
|
||||
serviceMonitor:
|
||||
enabled: false
|
||||
## Namespace in which Prometheus is running
|
||||
##
|
||||
# namespace: monitoring
|
||||
|
||||
## Interval at which metrics should be scraped.
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# interval: 10s
|
||||
|
||||
## Timeout after which the scrape is ended
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# scrapeTimeout: 10s
|
||||
|
||||
## ServiceMonitor selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
##
|
||||
## Zookeeper chart configuration
|
||||
##
|
||||
## https://github.com/bitnami/charts/blob/master/bitnami/zookeeper/values.yaml
|
||||
##
|
||||
zookeeper:
|
||||
enabled: true
|
||||
auth:
|
||||
## Enable Zookeeper auth
|
||||
##
|
||||
enabled: false
|
||||
## User that will use Zookeeper clients to auth
|
||||
##
|
||||
# clientUser:
|
||||
## Password that will use Zookeeper clients to auth
|
||||
##
|
||||
# clientPassword:
|
||||
## Comma, semicolon or whitespace separated list of user to be created. Specify them as a string, for example: "user1,user2,admin"
|
||||
##
|
||||
# serverUsers:
|
||||
## Comma, semicolon or whitespace separated list of passwords to assign to users when created. Specify them as a string, for example: "pass4user1, pass4user2, pass4admin"
|
||||
##
|
||||
# serverPasswords:
|
||||
|
||||
## This value is only used when zookeeper.enabled is set to false
|
||||
##
|
||||
externalZookeeper:
|
||||
## Server or list of external zookeeper servers to use.
|
||||
##
|
||||
servers: []
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*.orig
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
.vscode/
|
||||
|
|
@ -1,23 +0,0 @@
|
|||
apiVersion: v2
|
||||
name: clickhouse
|
||||
description: A Helm chart for Kubernetes
|
||||
|
||||
# A chart can be either an 'application' or a 'library' chart.
|
||||
#
|
||||
# Application charts are a collection of templates that can be packaged into versioned archives
|
||||
# to be deployed.
|
||||
#
|
||||
# Library charts provide useful utilities or functions for the chart developer. They're included as
|
||||
# a dependency of application charts to inject those utilities and functions into the rendering
|
||||
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
|
||||
type: application
|
||||
|
||||
# This is the chart version. This version number should be incremented each time you make changes
|
||||
# to the chart and its templates, including the app version.
|
||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||
version: 0.1.0
|
||||
|
||||
# This is the version number of the application being deployed. This version number should be
|
||||
# incremented each time you make changes to the application. Versions are not expected to
|
||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||
appVersion: 1.16.0
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "clickhouse.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "clickhouse.fullname" -}}
|
||||
{{- if .Values.fullnameOverride }}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride }}
|
||||
{{- if contains $name .Release.Name }}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
|
||||
{{- else }}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "clickhouse.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "clickhouse.labels" -}}
|
||||
helm.sh/chart: {{ include "clickhouse.chart" . }}
|
||||
{{ include "clickhouse.selectorLabels" . }}
|
||||
{{- if .Chart.AppVersion }}
|
||||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
|
||||
{{- end }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Selector labels
|
||||
*/}}
|
||||
{{- define "clickhouse.selectorLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "clickhouse.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end }}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "clickhouse.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create }}
|
||||
{{- default (include "clickhouse.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else }}
|
||||
{{- default "default" .Values.serviceAccount.name }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: clickhouse
|
||||
labels:
|
||||
{{- include "clickhouse.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- port: {{ .Values.service.webPort }}
|
||||
targetPort: web
|
||||
protocol: TCP
|
||||
name: web
|
||||
- port: {{ .Values.service.dataPort }}
|
||||
targetPort: data
|
||||
protocol: TCP
|
||||
name: data
|
||||
selector:
|
||||
{{- include "clickhouse.selectorLabels" . | nindent 4 }}
|
||||
|
|
@ -1,12 +0,0 @@
|
|||
{{- if .Values.serviceAccount.create -}}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ include "clickhouse.serviceAccountName" . }}
|
||||
labels:
|
||||
{{- include "clickhouse.labels" . | nindent 4 }}
|
||||
{{- with .Values.serviceAccount.annotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,69 +0,0 @@
|
|||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ include "clickhouse.fullname" . }}
|
||||
labels:
|
||||
{{- include "clickhouse.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
serviceName: {{ include "clickhouse.fullname" . }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "clickhouse.selectorLabels" . | nindent 6 }}
|
||||
template:
|
||||
metadata:
|
||||
{{- with .Values.podAnnotations }}
|
||||
annotations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
labels:
|
||||
{{- include "clickhouse.selectorLabels" . | nindent 8 }}
|
||||
spec:
|
||||
{{- with .Values.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
serviceAccountName: {{ include "clickhouse.serviceAccountName" . }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.podSecurityContext | nindent 8 }}
|
||||
containers:
|
||||
- name: {{ .Chart.Name }}
|
||||
env:
|
||||
{{- range $key, $value := .Values.env }}
|
||||
- name: "{{ $key }}"
|
||||
value: "{{ $value }}"
|
||||
{{- end }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: 9000
|
||||
name: web
|
||||
- containerPort: 8123
|
||||
name: data
|
||||
volumeMounts:
|
||||
- name: ch-volume
|
||||
mountPath: /var/lib/mydata
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- with .Values.nodeSelector }}
|
||||
nodeSelector:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.affinity }}
|
||||
affinity:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- with .Values.tolerations }}
|
||||
tolerations:
|
||||
{{- toYaml . | nindent 8 }}
|
||||
{{- end }}
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: ch-volume
|
||||
spec:
|
||||
accessModes: [ "ReadWriteOnce" ]
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.storageSize }}
|
||||
|
|
@ -1,62 +0,0 @@
|
|||
# Default values for clickhouse.
|
||||
# This is a YAML-formatted file.
|
||||
# Declare variables to be passed into your templates.
|
||||
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: yandex/clickhouse-server
|
||||
pullPolicy: IfNotPresent
|
||||
# Overrides the image tag whose default is the chart appVersion.
|
||||
tag: "20.9"
|
||||
|
||||
imagePullSecrets: []
|
||||
nameOverride: ""
|
||||
fullnameOverride: ""
|
||||
|
||||
serviceAccount:
|
||||
# Specifies whether a service account should be created
|
||||
create: true
|
||||
# Annotations to add to the service account
|
||||
annotations: {}
|
||||
# The name of the service account to use.
|
||||
# If not set and create is true, a name is generated using the fullname template
|
||||
name: ""
|
||||
|
||||
podAnnotations: {}
|
||||
|
||||
podSecurityContext: {}
|
||||
# fsGroup: 2000
|
||||
|
||||
securityContext: {}
|
||||
# capabilities:
|
||||
# drop:
|
||||
# - ALL
|
||||
# readOnlyRootFilesystem: true
|
||||
# runAsNonRoot: true
|
||||
# runAsUser: 1000
|
||||
|
||||
env: {}
|
||||
|
||||
service:
|
||||
webPort: 9000
|
||||
dataPort: 8123
|
||||
|
||||
resources: {}
|
||||
# We usually recommend not to specify default resources and to leave this as a conscious
|
||||
# choice for the user. This also increases chances charts run on environments with little
|
||||
# resources, such as Minikube. If you do want to specify resources, uncomment the following
|
||||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
|
||||
# limits:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
# requests:
|
||||
# cpu: 100m
|
||||
# memory: 128Mi
|
||||
|
||||
nodeSelector: {}
|
||||
|
||||
tolerations: []
|
||||
|
||||
affinity: {}
|
||||
storageSize: 8G
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
|
|
@ -1,22 +0,0 @@
|
|||
annotations:
|
||||
category: Infrastructure
|
||||
apiVersion: v1
|
||||
appVersion: 2.6.0
|
||||
description: Apache Kafka is a distributed streaming platform.
|
||||
engine: gotpl
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/kafka
|
||||
icon: https://bitnami.com/assets/stacks/kafka/img/kafka-stack-110x117.png
|
||||
keywords:
|
||||
- kafka
|
||||
- zookeeper
|
||||
- streaming
|
||||
- producer
|
||||
- consumer
|
||||
maintainers:
|
||||
- email: containers@bitnami.com
|
||||
name: Bitnami
|
||||
name: kafka
|
||||
sources:
|
||||
- https://github.com/bitnami/bitnami-docker-kafka
|
||||
- https://kafka.apache.org/
|
||||
version: 11.8.6
|
||||
|
|
@ -1,737 +0,0 @@
|
|||
# Kafka
|
||||
|
||||
[Kafka](https://www.kafka.org/) is a distributed streaming platform used for building real-time data pipelines and streaming apps. It is horizontally scalable, fault-tolerant, wicked fast, and runs in production in thousands of companies.
|
||||
|
||||
## TL;DR
|
||||
|
||||
```console
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
helm install my-release bitnami/kafka
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart bootstraps a [Kafka](https://github.com/bitnami/bitnami-docker-kafka) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||
|
||||
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes 1.12+
|
||||
- Helm 2.12+ or Helm 3.0-beta3+
|
||||
- PV provisioner support in the underlying infrastructure
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```console
|
||||
helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
helm install my-release bitnami/kafka
|
||||
```
|
||||
|
||||
These commands deploy Kafka on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
|
||||
|
||||
> **Tip**: List all releases using `helm list`
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the `my-release` deployment:
|
||||
|
||||
```console
|
||||
helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Parameters
|
||||
|
||||
The following tables lists the configurable parameters of the Kafka chart and their default values per section/component:
|
||||
|
||||
### Global parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `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.storageClass` | Global storage class for dynamic provisioning | `nil` |
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `nameOverride` | String to partially override kafka.fullname | `nil` |
|
||||
| `fullnameOverride` | String to fully override kafka.fullname | `nil` |
|
||||
| `clusterDomain` | Default Kubernetes cluster domain | `cluster.local` |
|
||||
| `commonLabels` | Labels to add to all deployed objects | `{}` |
|
||||
| `commonAnnotations` | Annotations to add to all deployed objects | `{}` |
|
||||
| `extraDeploy` | Array of extra objects to deploy with the release | `nil` (evaluated as a template) |
|
||||
|
||||
### Kafka parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `image.registry` | Kafka image registry | `docker.io` |
|
||||
| `image.repository` | Kafka image name | `bitnami/kafka` |
|
||||
| `image.tag` | Kafka image tag | `{TAG_NAME}` |
|
||||
| `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.debug` | Set to true if you would like to see extra information on logs | `false` |
|
||||
| `config` | Configuration file for Kafka. Auto-generated based on other parameters when not specified | `nil` |
|
||||
| `existingConfigmap` | Name of existing ConfigMap with Kafka configuration | `nil` |
|
||||
| `log4j` | An optional log4j.properties file to overwrite the default of the Kafka brokers. | `nil` |
|
||||
| `existingLog4jConfigMap` | The name of an existing ConfigMap containing a log4j.properties file. | `nil` |
|
||||
| `heapOpts` | Kafka's Java Heap size | `-Xmx1024m -Xms1024m` |
|
||||
| `deleteTopicEnable` | Switch to enable topic deletion or not | `false` |
|
||||
| `autoCreateTopicsEnable` | Switch to enable auto creation of topics. Enabling auto creation of topics not recommended for production or similar environments | `false` |
|
||||
| `logFlushIntervalMessages` | The number of messages to accept before forcing a flush of data to disk | `10000` |
|
||||
| `logFlushIntervalMs` | The maximum amount of time a message can sit in a log before we force a flush | `1000` |
|
||||
| `logRetentionBytes` | A size-based retention policy for logs | `_1073741824` |
|
||||
| `logRetentionCheckIntervalMs` | The interval at which log segments are checked to see if they can be deleted | `300000` |
|
||||
| `logRetentionHours` | The minimum age of a log file to be eligible for deletion due to age | `168` |
|
||||
| `logSegmentBytes` | The maximum size of a log segment file. When this size is reached a new log segment will be created | `_1073741824` |
|
||||
| `logsDirs` | A comma separated list of directories under which to store log files | `/bitnami/kafka/data` |
|
||||
| `maxMessageBytes` | The largest record batch size allowed by Kafka | `1000012` |
|
||||
| `defaultReplicationFactor` | Default replication factors for automatically created topics | `1` |
|
||||
| `offsetsTopicReplicationFactor` | The replication factor for the offsets topic | `1` |
|
||||
| `transactionStateLogReplicationFactor` | The replication factor for the transaction topic | `1` |
|
||||
| `transactionStateLogMinIsr` | Overridden min.insync.replicas config for the transaction topic | `1` |
|
||||
| `numIoThreads` | The number of threads doing disk I/O | `8` |
|
||||
| `numNetworkThreads` | The number of threads handling network requests | `3` |
|
||||
| `numPartitions` | The default number of log partitions per topic | `1` |
|
||||
| `numRecoveryThreadsPerDataDir` | The number of threads per data directory to be used for log recovery at startup and flushing at shutdown | `1` |
|
||||
| `socketReceiveBufferBytes` | The receive buffer (SO_RCVBUF) used by the socket server | `102400` |
|
||||
| `socketRequestMaxBytes` | The maximum size of a request that the socket server will accept (protection against OOM) | `_104857600` |
|
||||
| `socketSendBufferBytes` | The send buffer (SO_SNDBUF) used by the socket server | `102400` |
|
||||
| `zookeeperConnectionTimeoutMs` | Timeout in ms for connecting to Zookeeper | `6000` |
|
||||
| `extraEnvVars` | Extra environment variables to add to kafka pods | `[]` |
|
||||
| `extraVolumes` | Extra volume(s) to add to Kafka statefulset | `[]` |
|
||||
| `extraVolumeMounts` | Extra volumeMount(s) to add to Kafka containers | `[]` |
|
||||
| `auth.clientProtocol` | Authentication protocol for communications with clients. Allowed protocols: `plaintext`, `tls`, `mtls`, `sasl` and `sasl_tls` | `plaintext` |
|
||||
| `auth.interBrokerProtocol` | Authentication protocol for inter-broker communications. Allowed protocols: `plaintext`, `tls`, `mtls`, `sasl` and `sasl_tls` | `plaintext` |
|
||||
| `auth.saslMechanisms` | SASL mechanisms when either `auth.interBrokerProtocol` or `auth.clientProtocol` are `sasl`. Allowed types: `plain`, `scram-sha-256`, `scram-sha-512` | `plain,scram-sha-256,scram-sha-512` |
|
||||
| `auth.saslInterBrokerMechanism` | SASL mechanism to use as inter broker protocol, it must be included at `auth.saslMechanisms` | `plain` |
|
||||
| `auth.jksSecret` | Name of the existing secret containing the truststore and one keystore per Kafka broker you have in the cluster | `nil` |
|
||||
| `auth.jksPassword` | Password to access the JKS files when they are password-protected | `nil` |
|
||||
| `auth.tlsEndpointIdentificationAlgorithm` | The endpoint identification algorithm to validate server hostname using server certificate | `https` |
|
||||
| `auth.jaas.interBrokerUser` | Kafka inter broker communication user for SASL authentication | `admin` |
|
||||
| `auth.jaas.interBrokerPassword` | Kafka inter broker communication password for SASL authentication | `nil` |
|
||||
| `auth.jaas.zookeeperUser` | Kafka Zookeeper user for SASL authentication | `nil` |
|
||||
| `auth.jaas.zookeeperPassword` | Kafka Zookeeper password for SASL authentication | `nil` |
|
||||
| `auth.jaas.existingSecret` | Name of the existing secret containing credentials for brokerUser, interBrokerUser and zookeeperUser | `nil` |
|
||||
| `auth.jaas.clientUsers` | List of Kafka client users to be created, separated by commas. This values will override `auth.jaas.clientUser` | `[]` |
|
||||
| `auth.jaas.clientPasswords` | List of passwords for `auth.jaas.clientUsers`. It is mandatory to provide the passwords when using `auth.jaas.clientUsers` | `[]` |
|
||||
| `listeners` | The address(es) the socket server listens on. Auto-calculated it's set to an empty array | `[]` |
|
||||
| `advertisedListeners` | The address(es) (hostname:port) the broker will advertise to producers and consumers. Auto-calculated it's set to an empty array | `[]` |
|
||||
| `listenerSecurityProtocolMap` | The protocol->listener mapping. Auto-calculated it's set to nil | `nil` |
|
||||
| `allowPlaintextListener` | Allow to use the PLAINTEXT listener | `true` |
|
||||
| `interBrokerListenerName` | The listener that the brokers should communicate on | `INTERNAL` |
|
||||
|
||||
### Statefulset parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `replicaCount` | Number of Kafka nodes | `1` |
|
||||
| `updateStrategy` | Update strategy for the stateful set | `RollingUpdate` |
|
||||
| `rollingUpdatePartition` | Partition update strategy | `nil` |
|
||||
| `podLabels` | Kafka pod labels | `{}` (evaluated as a template) |
|
||||
| `podAnnotations` | Kafka Pod annotations | `{}` (evaluated as a template) |
|
||||
| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `priorityClassName` | Name of the existing priority class to be used by kafka pods | `""` |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `podSecurityContext` | Kafka pods' Security Context | `{}` |
|
||||
| `containerSecurityContext` | Kafka containers' Security Context | `{}` |
|
||||
| `resources.limits` | The resources limits for Kafka containers | `{}` |
|
||||
| `resources.requests` | The requested resources for Kafka containers | `{}` |
|
||||
| `livenessProbe` | Liveness probe configuration for Kafka | `Check values.yaml file` |
|
||||
| `readinessProbe` | Readiness probe configuration for Kafka | `Check values.yaml file` |
|
||||
| `customLivenessProbe` | Custom Liveness probe configuration for Kafka | `{}` |
|
||||
| `customReadinessProbe` | Custom Readiness probe configuration for Kafka | `{}` |
|
||||
| `pdb.create` | Enable/disable a Pod Disruption Budget creation | `false` |
|
||||
| `pdb.minAvailable` | Minimum number/percentage of pods that should remain scheduled | `nil` |
|
||||
| `pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable | `1` |
|
||||
| `command` | Override kafka container command | `['/scripts/setup.sh']` (evaluated as a template) |
|
||||
| `args` | Override kafka container arguments | `[]` (evaluated as a template) |
|
||||
| `sidecars` | Attach additional sidecar containers to the Kafka pod | `{}` |
|
||||
|
||||
### Exposure parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `service.type` | Kubernetes Service type | `ClusterIP` |
|
||||
| `service.port` | Kafka port for client connections | `9092` |
|
||||
| `service.internalPort` | Kafka port for inter-broker connections | `9093` |
|
||||
| `service.externalPort` | Kafka port for external connections | `9094` |
|
||||
| `service.nodePorts.client` | Nodeport for client connections | `""` |
|
||||
| `service.nodePorts.external` | Nodeport for external connections | `""` |
|
||||
| `service.loadBalancerIP` | loadBalancerIP for Kafka Service | `nil` |
|
||||
| `service.loadBalancerSourceRanges` | Address(es) that are allowed when service is LoadBalancer | `[]` |
|
||||
| `service.annotations` | Service annotations | `{}`(evaluated as a template) |
|
||||
| `externalAccess.enabled` | Enable Kubernetes external cluster access to Kafka brokers | `false` |
|
||||
| `externalAccess.autoDiscovery.enabled` | Enable using an init container to auto-detect external IPs/ports by querying the K8s API | `false` |
|
||||
| `externalAccess.autoDiscovery.image.registry` | Init container auto-discovery image registry (kubectl) | `docker.io` |
|
||||
| `externalAccess.autoDiscovery.image.repository` | Init container auto-discovery image name (kubectl) | `bitnami/kubectl` |
|
||||
| `externalAccess.autoDiscovery.image.tag` | Init container auto-discovery image tag (kubectl) | `{TAG_NAME}` |
|
||||
| `externalAccess.autoDiscovery.image.pullPolicy` | Init container auto-discovery image pull policy (kubectl) | `Always` |
|
||||
| `externalAccess.autoDiscovery.resources.limits` | Init container auto-discovery resource limits | `{}` |
|
||||
| `externalAccess.autoDiscovery.resources.requests` | Init container auto-discovery resource requests | `{}` |
|
||||
| `externalAccess.service.type` | Kubernetes Service type for external access. It can be NodePort or LoadBalancer | `LoadBalancer` |
|
||||
| `externalAccess.service.port` | Kafka port used for external access when service type is LoadBalancer | `9094` |
|
||||
| `externalAccess.service.loadBalancerIPs` | Array of load balancer IPs for Kafka brokers | `[]` |
|
||||
| `externalAccess.service.loadBalancerSourceRanges` | Address(es) that are allowed when service is LoadBalancer | `[]` |
|
||||
| `externalAccess.service.domain` | Domain or external ip used to configure Kafka external listener when service type is NodePort | `nil` |
|
||||
| `externalAccess.service.nodePorts` | Array of node ports used to configure Kafka external listener when service type is NodePort | `[]` |
|
||||
| `externalAccess.service.annotations` | Service annotations for external access | `{}`(evaluated as a template) |
|
||||
|
||||
### Persistence parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `persistence.enabled` | Enable Kafka data persistence using PVC, note that Zookeeper persistence is unaffected | `true` |
|
||||
| `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template | `nil` |
|
||||
| `persistence.storageClass` | PVC Storage Class for Kafka data volume | `nil` |
|
||||
| `persistence.accessMode` | PVC Access Mode for Kafka data volume | `ReadWriteOnce` |
|
||||
| `persistence.size` | PVC Storage Request for Kafka data volume | `8Gi` |
|
||||
| `persistence.annotations` | Annotations for the PVC | `{}`(evaluated as a template) |
|
||||
|
||||
### RBAC parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `serviceAccount.create` | Enable creation of ServiceAccount for Kafka pods | `true` |
|
||||
| `serviceAccount.name` | Name of the created serviceAccount | Generated using the `kafka.fullname` template |
|
||||
| `rbac.create` | Weather to create & use RBAC resources or not | `false` |
|
||||
|
||||
### Volume Permissions parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `volumePermissions.enabled` | Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup` | `false` |
|
||||
| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` |
|
||||
| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` |
|
||||
| `volumePermissions.image.tag` | Init container volume-permissions image tag | `buster` |
|
||||
| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `Always` |
|
||||
| `volumePermissions.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `volumePermissions.resources.limits` | Init container volume-permissions resource limits | `{}` |
|
||||
| `volumePermissions.resources.requests` | Init container volume-permissions resource requests | `{}` |
|
||||
|
||||
### Metrics parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `metrics.kafka.enabled` | Whether or not to create a standalone Kafka exporter to expose Kafka metrics | `false` |
|
||||
| `metrics.kafka.image.registry` | Kafka exporter image registry | `docker.io` |
|
||||
| `metrics.kafka.image.repository` | Kafka exporter image name | `bitnami/kafka-exporter` |
|
||||
| `metrics.kafka.image.tag` | Kafka exporter image tag | `{TAG_NAME}` |
|
||||
| `metrics.kafka.image.pullPolicy` | Kafka exporter image pull policy | `IfNotPresent` |
|
||||
| `metrics.kafka.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `metrics.kafka.extraFlags` | Extra flags to be passed to Kafka exporter | `{}` |
|
||||
| `metrics.kafka.certificatesSecret` | Name of the existing secret containing the optional certificate and key files | `nil` |
|
||||
| `metrics.kafka.resources.limits` | Kafka Exporter container resource limits | `{}` |
|
||||
| `metrics.kafka.resources.requests` | Kafka Exporter container resource requests | `{}` |
|
||||
| `metrics.kafka.service.type` | Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) for Kafka Exporter | `ClusterIP` |
|
||||
| `metrics.kafka.service.port` | Kafka Exporter Prometheus port | `9308` |
|
||||
| `metrics.kafka.service.nodePort` | Kubernetes HTTP node port | `""` |
|
||||
| `metrics.kafka.service.annotations` | Annotations for Prometheus metrics service | `Check values.yaml file` |
|
||||
| `metrics.kafka.service.loadBalancerIP` | loadBalancerIP if service type is `LoadBalancer` | `nil` |
|
||||
| `metrics.kafka.service.clusterIP` | Static clusterIP or None for headless services | `nil` |
|
||||
| `metrics.jmx.enabled` | Whether or not to expose JMX metrics to Prometheus | `false` |
|
||||
| `metrics.jmx.image.registry` | JMX exporter image registry | `docker.io` |
|
||||
| `metrics.jmx.image.repository` | JMX exporter image name | `bitnami/jmx-exporter` |
|
||||
| `metrics.jmx.image.tag` | JMX exporter image tag | `{TAG_NAME}` |
|
||||
| `metrics.jmx.image.pullPolicy` | JMX exporter image pull policy | `IfNotPresent` |
|
||||
| `metrics.jmx.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` (does not add image pull secrets to deployed pods) |
|
||||
| `metrics.jmx.resources.limits` | JMX Exporter container resource limits | `{}` |
|
||||
| `metrics.jmx.resources.requests` | JMX Exporter container resource requests | `{}` |
|
||||
| `metrics.jmx.service.type` | Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) for JMX Exporter | `ClusterIP` |
|
||||
| `metrics.jmx.service.port` | JMX Exporter Prometheus port | `5556` |
|
||||
| `metrics.jmx.service.nodePort` | Kubernetes HTTP node port | `""` |
|
||||
| `metrics.jmx.service.annotations` | Annotations for Prometheus metrics service | `Check values.yaml file` |
|
||||
| `metrics.jmx.service.loadBalancerIP` | loadBalancerIP if service type is `LoadBalancer` | `nil` |
|
||||
| `metrics.jmx.service.clusterIP` | Static clusterIP or None for headless services | `nil` |
|
||||
| `metrics.jmx.whitelistObjectNames` | Allows setting which JMX objects you want to expose to via JMX stats to JMX Exporter | (see `values.yaml`) |
|
||||
| `metrics.jmx.config` | Configuration file for JMX exporter | (see `values.yaml`) |
|
||||
| `metrics.jmx.existingConfigmap` | Name of existing ConfigMap with JMX exporter configuration | `nil` |
|
||||
| `metrics.serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (requires `metrics.kafka.enabled` or `metrics.jmx.enabled` to be `true`) | `false` |
|
||||
| `metrics.serviceMonitor.namespace` | Namespace which Prometheus is running in | `monitoring` |
|
||||
| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped | `nil` |
|
||||
| `metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `nil` (Prometheus Operator default value) |
|
||||
| `metrics.serviceMonitor.selector` | ServiceMonitor selector labels | `nil` (Prometheus Operator default value) |
|
||||
|
||||
### Zookeeper chart parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `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 | `[]` |
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
```console
|
||||
helm install my-release \
|
||||
--set replicaCount=3 \
|
||||
bitnami/kafka
|
||||
```
|
||||
|
||||
The above command deploys Kafka with 3 brokers (replicas).
|
||||
|
||||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||
|
||||
```console
|
||||
helm install my-release -f values.yaml bitnami/kafka
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
## Configuration and installation details
|
||||
|
||||
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||
|
||||
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||
|
||||
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||
|
||||
### Production configuration and horizontal scaling
|
||||
|
||||
This chart includes a `values-production.yaml` file where you can find some parameters oriented to production configuration in comparison to the regular `values.yaml`. You can use this file instead of the default one.
|
||||
|
||||
- Number of Kafka nodes:
|
||||
|
||||
```diff
|
||||
- replicaCount: 1
|
||||
+ replicaCount: 3
|
||||
```
|
||||
|
||||
- Allow to use the PLAINTEXT listener:
|
||||
|
||||
```diff
|
||||
- allowPlaintextListener: true
|
||||
+ allowPlaintextListener: false
|
||||
```
|
||||
|
||||
- Default replication factors for automatically created topics:
|
||||
|
||||
```diff
|
||||
- defaultReplicationFactor: 1
|
||||
+ defaultReplicationFactor: 3
|
||||
```
|
||||
|
||||
- Allow auto creation of topics.
|
||||
|
||||
```diff
|
||||
- autoCreateTopicsEnable: true
|
||||
+ autoCreateTopicsEnable: false
|
||||
```
|
||||
|
||||
- The replication factor for the offsets topic:
|
||||
|
||||
```diff
|
||||
- offsetsTopicReplicationFactor: 1
|
||||
+ offsetsTopicReplicationFactor: 3
|
||||
```
|
||||
|
||||
- The replication factor for the transaction topic:
|
||||
|
||||
```diff
|
||||
- transactionStateLogReplicationFactor: 1
|
||||
+ transactionStateLogReplicationFactor: 3
|
||||
```
|
||||
|
||||
- Overridden min.insync.replicas config for the transaction topic:
|
||||
|
||||
```diff
|
||||
- transactionStateLogMinIsr: 1
|
||||
+ transactionStateLogMinIsr: 3
|
||||
```
|
||||
|
||||
- Switch to enable the Kafka SASAL authentication on client and inter-broker communications:
|
||||
|
||||
```diff
|
||||
- auth.clientProtocol: plaintext
|
||||
+ auth.clientProtocol: sasl
|
||||
- auth.interBrokerProtocol: plaintext
|
||||
+ auth.interBrokerProtocol: sasl
|
||||
```
|
||||
|
||||
- Enable Zookeeper authentication:
|
||||
|
||||
```diff
|
||||
+ auth.jaas.zookeeperUser: zookeeperUser
|
||||
+ auth.jaas.zookeeperPassword: zookeeperPassword
|
||||
- zookeeper.auth.enabled: false
|
||||
+ zookeeper.auth.enabled: true
|
||||
+ zookeeper.auth.clientUser: zookeeperUser
|
||||
+ zookeeper.auth.clientPassword: zookeeperPassword
|
||||
+ zookeeper.auth.serverUsers: zookeeperUser
|
||||
+ zookeeper.auth.serverPasswords: zookeeperPassword
|
||||
```
|
||||
|
||||
- Enable Pod Disruption Budget:
|
||||
|
||||
```diff
|
||||
- pdb.create: false
|
||||
+ pdb.create: true
|
||||
```
|
||||
|
||||
- Create a separate Kafka metrics exporter:
|
||||
|
||||
```diff
|
||||
- metrics.kafka.enabled: false
|
||||
+ metrics.kafka.enabled: true
|
||||
```
|
||||
|
||||
- Expose JMX metrics to Prometheus:
|
||||
|
||||
```diff
|
||||
- metrics.jmx.enabled: false
|
||||
+ metrics.jmx.enabled: true
|
||||
```
|
||||
|
||||
- Enable Zookeeper metrics:
|
||||
|
||||
```diff
|
||||
+ zookeeper.metrics.enabled: true
|
||||
```
|
||||
|
||||
To horizontally scale this chart once it has been deployed, you can upgrade the statefulset using a new value for the `replicaCount` parameter. Please note that, when enabling TLS encryption, you must update your JKS secret including the keystore for the new replicas.
|
||||
|
||||
### Setting custom parameters
|
||||
|
||||
Any environment variable beginning with `KAFKA_CFG_` will be mapped to its corresponding Kafka key. For example, use `KAFKA_CFG_BACKGROUND_THREADS` in order to set `background.threads`. In order to pass custom environment variables use the `extraEnvVars` property.
|
||||
|
||||
### Listeners configuration
|
||||
|
||||
This chart allows you to automatically configure Kafka with 3 listeners:
|
||||
|
||||
- One for inter-broker communications.
|
||||
- A second one for communications with clients within the K8s cluster.
|
||||
- (optional) a third listener for communications with clients outside the K8s cluster. Check [this section](#accessing-kafka-brokers-from-outside-the-clusters) for more information.
|
||||
|
||||
For more complex configurations, set the `listeners`, `advertisedListeners` and `listenerSecurityProtocolMap` parameters as needed.
|
||||
|
||||
### Enable security for Kafka and Zookeeper
|
||||
|
||||
You can configure different authentication protocols for each listener you configure in Kafka. For instance, you can use `sasl_tls` authentication for client communications, while using `tls` for inter-broker communications. This table shows the available protocols and the security they provide:
|
||||
|
||||
| Method | Authentication | Encryption via TLS |
|
||||
|-----------|-------------------------------|--------------------|
|
||||
| plaintext | None | No |
|
||||
| tls | None | Yes |
|
||||
| mtls | Yes (two-way authentication) | Yes |
|
||||
| sasl | Yes (via SASL) | No |
|
||||
| sasl_tls | Yes (via SASL) | Yes |
|
||||
|
||||
If you enabled SASL authentication on any listener, you can set the SASL credentials using the parameters below:
|
||||
|
||||
- `auth.jaas.clientUsers`/`auth.jaas.clientPasswords`: when enabling SASL authentication for communications with clients.
|
||||
- `auth.jaas.interBrokerUser`/`auth.jaas.interBrokerPassword`: when enabling SASL authentication for inter-broker communications.
|
||||
- `auth.jaas.zookeeperUser`/`auth.jaas.zookeeperPassword`: In the case that the Zookeeper chart is deployed with SASL authentication enabled.
|
||||
|
||||
In order to configure TLS authentication/encryption, you **must** create a secret containing the Java Key Stores (JKS) files: the truststore (`kafka.truststore.jks`) and one keystore (`kafka.keystore.jks`) per Kafka broker you have in the cluster. Then, you need pass the secret name with the `--auth.jksSecret` parameter when deploying the chart.
|
||||
|
||||
> **Note**: If the JKS files are password protected (recommended), you will need to provide the password to get access to the keystores. To do so, use the `auth.jksPassword` parameter to provide your password.
|
||||
|
||||
For instance, to configure TLS authentication on a Kafka cluster with 2 Kafka brokers use the command below to create the secret:
|
||||
|
||||
```console
|
||||
kubectl create secret generic kafka-jks --from-file=./kafka.truststore.jks --from-file=./kafka-0.keystore.jks --from-file=./kafka-1.keystore.jks
|
||||
```
|
||||
|
||||
> **Note**: the command above assumes you already created the trustore and keystores files. This [script](https://raw.githubusercontent.com/confluentinc/confluent-platform-security-tools/master/kafka-generate-ssl.sh) can help you with the JKS files generation.
|
||||
|
||||
As an alternative to manually create the secret before installing the chart, you can put your JKS files inside the chart folder `files/jks`, an a secret including them will be generated. Please note this alternative requires to have the chart downloaded locally, so you will have to clone this repository or fetch the chart before installing it.
|
||||
|
||||
You can deploy the chart with authentication using the following parameters:
|
||||
|
||||
```console
|
||||
replicaCount=2
|
||||
auth.clientProtocol=sasl
|
||||
auth.interBrokerProtocol=tls
|
||||
auth.certificatesSecret=kafka-jks
|
||||
auth.certificatesPassword=jksPassword
|
||||
auth.jaas.clientUsers[0]=brokerUser
|
||||
auth.jaas.clientPassword[0]=brokerPassword
|
||||
auth.jaas.zookeeperUser=zookeeperUser
|
||||
auth.jaas.zookeeperPassword=zookeeperPassword
|
||||
zookeeper.auth.enabled=true
|
||||
zookeeper.auth.serverUsers=zookeeperUser
|
||||
zookeeper.auth.serverPasswords=zookeeperPassword
|
||||
zookeeper.auth.clientUser=zookeeperUser
|
||||
zookeeper.auth.clientPassword=zookeeperPassword
|
||||
```
|
||||
|
||||
If you also enable exposing metrics using the Kafka expoter, and you are using `sasl_tls`, `tls`, or `mtls` authentication protocols, you need to mount the CA certificated used to sign the brokers certificates in the exporter so it can validate the Kafka brokers. To do so, create a secret containing the CA, and set the `metrics.certificatesSecret` parameter. As an alternative, you can skip TLS validation using extra flags:
|
||||
|
||||
```console
|
||||
metrics.kafka.extraFlags={tls.insecure-skip-tls-verify: ""}
|
||||
```
|
||||
|
||||
### Accessing Kafka brokers from outside the cluster
|
||||
|
||||
In order to access Kafka Brokers from outside the cluster, an additional listener and advertised listener must be configured. Additionally, a specific service per kafka pod will be created.
|
||||
|
||||
There are two ways of configuring external access. Using LoadBalancer services or using NodePort services.
|
||||
|
||||
#### Using LoadBalancer services
|
||||
|
||||
You have two alternatives to use LoadBalancer services:
|
||||
|
||||
- Option A) Use random load balancer IPs using an **initContainer** that waits for the IPs to be ready and discover them automatically.
|
||||
|
||||
```console
|
||||
externalAccess.enabled=true
|
||||
externalAccess.service.type=LoadBalancer
|
||||
externalAccess.service.port=9094
|
||||
externalAccess.autoDiscovery.enabled=true
|
||||
serviceAccount.create=true
|
||||
rbac.create=true
|
||||
```
|
||||
|
||||
Note: This option requires creating RBAC rules on clusters where RBAC policies are enabled.
|
||||
|
||||
- Option B) Manually specify the load balancer IPs:
|
||||
|
||||
```console
|
||||
externalAccess.enabled=true
|
||||
externalAccess.service.type=LoadBalancer
|
||||
externalAccess.service.port=9094
|
||||
externalAccess.service.loadBalancerIPs[0]='external-ip-1'
|
||||
externalAccess.service.loadBalancerIPs[1]='external-ip-2'}
|
||||
```
|
||||
|
||||
Note: You need to know in advance the load balancer IPs so each Kafka broker advertised listener is configured with it.
|
||||
|
||||
#### Using NodePort services
|
||||
|
||||
You have two alternatives to use NodePort services:
|
||||
|
||||
- Option A) Use random node ports using an **initContainer** that discover them automatically.
|
||||
|
||||
```console
|
||||
externalAccess.enabled=true
|
||||
externalAccess.service.type=NodePort
|
||||
externalAccess.autoDiscovery.enabled=true
|
||||
serviceAccount.create=true
|
||||
rbac.create=true
|
||||
```
|
||||
|
||||
Note: This option requires creating RBAC rules on clusters where RBAC policies are enabled.
|
||||
|
||||
- Option B) Manually specify the node ports:
|
||||
|
||||
```console
|
||||
externalAccess.enabled=true
|
||||
externalAccess.service.type=NodePort
|
||||
externalAccess.serivce.nodePorts[0]='node-port-1'
|
||||
externalAccess.serivce.nodePorts[1]='node-port-2'
|
||||
```
|
||||
|
||||
Note: You need to know in advance the node ports that will be exposed so each Kafka broker advertised listener is configured with it.
|
||||
|
||||
The pod will try to get the external ip of the node using `curl -s https://ipinfo.io/ip` unless `externalAccess.service.domain` is provided.
|
||||
|
||||
Following the aforementioned steps will also allow to connect the brokers from the outside using the cluster's default service (when `service.type` is `LoadBalancer` or `NodePort`). Use the property `service.externalPort` to specify the port used for external connections.
|
||||
|
||||
### Sidecars
|
||||
|
||||
If you have a need for additional containers to run within the same pod as Kafka (e.g. an additional metrics or logging exporter), you can do so via the `sidecars` config parameter. Simply define your container according to the Kubernetes container spec.
|
||||
|
||||
```yaml
|
||||
sidecars:
|
||||
- name: your-image-name
|
||||
image: your-image
|
||||
imagePullPolicy: Always
|
||||
ports:
|
||||
- name: portname
|
||||
containerPort: 1234
|
||||
```
|
||||
|
||||
### Deploying extra resources
|
||||
|
||||
There are cases where you may want to deploy extra objects, such as Kafka Connect. For covering this case, the chart allows adding the full specification of other objects using the `extraDeploy` parameter. The following example would create a deployment including a Kafka Connect deployment so you can connect Kafka with MongoDB:
|
||||
|
||||
```yaml
|
||||
## Extra objects to deploy (value evaluated as a template)
|
||||
##
|
||||
extraDeploy: |-
|
||||
- apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "kafka.fullname" . }}-connect
|
||||
labels: {{- include "kafka.labels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: connector
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: {{- include "kafka.matchLabels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: connector
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "kafka.labels" . | nindent 10 }}
|
||||
app.kubernetes.io/component: connector
|
||||
spec:
|
||||
containers:
|
||||
- name: connect
|
||||
image: KAFKA-CONNECT-IMAGE
|
||||
imagePullPolicy: IfNotPresent
|
||||
ports:
|
||||
- name: connector
|
||||
containerPort: 8083
|
||||
volumeMounts:
|
||||
- name: configuration
|
||||
mountPath: /opt/bitnami/kafka/config
|
||||
volumes:
|
||||
- name: configuration
|
||||
configMap:
|
||||
name: {{ include "kafka.fullname" . }}-connect
|
||||
- apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "kafka.fullname" . }}-connect
|
||||
labels: {{- include "kafka.labels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: connector
|
||||
data:
|
||||
connect-standalone.properties: |-
|
||||
bootstrap.servers = {{ include "kafka.fullname" . }}-0.{{ include "kafka.fullname" . }}-headless.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}:{{ .Values.service.port }}
|
||||
...
|
||||
mongodb.properties: |-
|
||||
connection.uri=mongodb://root:password@mongodb-hostname:27017
|
||||
...
|
||||
- apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "kafka.fullname" . }}-connect
|
||||
labels: {{- include "kafka.labels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: connector
|
||||
spec:
|
||||
ports:
|
||||
- protocol: TCP
|
||||
port: 8083
|
||||
targetPort: connector
|
||||
selector: {{- include "kafka.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: connector
|
||||
```
|
||||
|
||||
You can create the Kafka Connect image using the Dockerfile below:
|
||||
|
||||
```Dockerfile
|
||||
FROM bitnami/kafka:latest
|
||||
# Download MongoDB Connector for Apache Kafka https://www.confluent.io/hub/mongodb/kafka-connect-mongodb
|
||||
RUN mkdir -p /opt/bitnami/kafka/plugins && \
|
||||
cd /opt/bitnami/kafka/plugins && \
|
||||
curl --remote-name --location --silent https://search.maven.org/remotecontent?filepath=org/mongodb/kafka/mongo-kafka-connect/1.2.0/mongo-kafka-connect-1.2.0-all.jar
|
||||
CMD /opt/bitnami/kafka/bin/connect-standalone.sh /opt/bitnami/kafka/config/connect-standalone.properties /opt/bitnami/kafka/config/mongo.properties
|
||||
```
|
||||
|
||||
## Persistence
|
||||
|
||||
The [Bitnami Kafka](https://github.com/bitnami/bitnami-docker-kafka) image stores the Kafka data at the `/bitnami/kafka` path of the container.
|
||||
|
||||
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube. See the [Parameters](#persistence-parameters) 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
|
||||
|
||||
### To 11.8.0
|
||||
|
||||
External access to brokers can now be archived through the cluster's Kafka service.
|
||||
|
||||
- `service.nodePort` -> deprecated in favor of `service.nodePorts.client` and `service.nodePorts.external`
|
||||
|
||||
### To 11.7.0
|
||||
|
||||
The way to configure the users and passwords changed. Now it is allowed to create multiple users during the installation by providing the list of users and passwords.
|
||||
|
||||
- `auth.jaas.clientUser` (string) -> deprecated in favor of `auth.jaas.clientUsers` (array).
|
||||
- `auth.jaas.clientPassword` (string) -> deprecated in favor of `auth.jaas.clientPasswords` (array).
|
||||
|
||||
### To 11.0.0
|
||||
|
||||
The way to configure listeners and authentication on Kafka is totally refactored allowing users to configure different authentication protocols on different listeners. Please check the sections [Listeners Configuration](listeners-configuration) and [Listeners Configuration](enable-kafka-for-kafka-and-zookeeper) for more information.
|
||||
|
||||
Backwards compatibility is not guaranteed you adapt your values.yaml to the new format. Here you can find some parameters that were renamed or disappeared in favor of new ones on this major version:
|
||||
|
||||
- `auth.enabled` -> deprecated in favor of `auth.clientProtocol` and `auth.interBrokerProtocol` parameters.
|
||||
- `auth.ssl` -> deprecated in favor of `auth.clientProtocol` and `auth.interBrokerProtocol` parameters.
|
||||
- `auth.certificatesSecret` -> renamed to `auth.jksSecret`.
|
||||
- `auth.certificatesPassword` -> renamed to `auth.jksPassword`.
|
||||
- `sslEndpointIdentificationAlgorithm` -> renamedo to `auth.tlsEndpointIdentificationAlgorithm`.
|
||||
- `auth.interBrokerUser` -> renamed to `auth.jaas.interBrokerUser`
|
||||
- `auth.interBrokerPassword` -> renamed to `auth.jaas.interBrokerPassword`
|
||||
- `auth.zookeeperUser` -> renamed to `auth.jaas.zookeeperUser`
|
||||
- `auth.zookeeperPassword` -> renamed to `auth.jaas.zookeeperPassword`
|
||||
- `auth.existingSecret` -> renamed to `auth.jaas.existingSecret`
|
||||
- `service.sslPort` -> deprecated in favor of `service.internalPort`
|
||||
- `service.nodePorts.kafka` and `service.nodePorts.ssl` -> deprecated in favor of `service.nodePort`
|
||||
- `metrics.kafka.extraFlag` -> new parameter
|
||||
- `metrics.kafka.certificatesSecret` -> new parameter
|
||||
|
||||
### To 10.0.0
|
||||
|
||||
If you are setting the `config` or `log4j` parameter, backwards compatibility is not guaranteed, because the `KAFKA_MOUNTED_CONFDIR` has moved from `/opt/bitnami/kafka/conf` to `/bitnami/kafka/config`. In order to continue using these parameters, you must also upgrade your image to `docker.io/bitnami/kafka:2.4.1-debian-10-r38` or later.
|
||||
|
||||
### To 9.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed you adapt your values.yaml to the new format. Here you can find some parameters that were renamed on this major version:
|
||||
|
||||
```diff
|
||||
- securityContext.enabled
|
||||
- securityContext.fsGroup
|
||||
- securityContext.fsGroup
|
||||
+ podSecurityContext
|
||||
- externalAccess.service.loadBalancerIP
|
||||
+ externalAccess.service.loadBalancerIPs
|
||||
- externalAccess.service.nodePort
|
||||
+ externalAccess.service.nodePorts
|
||||
- metrics.jmx.configMap.enabled
|
||||
- metrics.jmx.configMap.overrideConfig
|
||||
+ metrics.jmx.config
|
||||
- metrics.jmx.configMap.overrideName
|
||||
+ metrics.jmx.existingConfigmap
|
||||
```
|
||||
|
||||
Ports names were prefixed with the protocol to comply with Istio (see https://istio.io/docs/ops/deployment/requirements/).
|
||||
|
||||
### To 8.0.0
|
||||
|
||||
There is not backwards compatibility since the brokerID changes to the POD_NAME. For more information see [this PR](https://github.com/bitnami/charts/pull/2028).
|
||||
|
||||
### To 7.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed when Kafka metrics are enabled, unless you modify the labels used on the exporter deployments.
|
||||
Use the workaround below to upgrade from versions previous to 7.0.0. The following example assumes that the release name is kafka:
|
||||
|
||||
```console
|
||||
helm upgrade kafka bitnami/kafka --version 6.1.8 --set metrics.kafka.enabled=false
|
||||
helm upgrade kafka bitnami/kafka --version 7.0.0 --set metrics.kafka.enabled=true
|
||||
```
|
||||
|
||||
### To 2.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||
Use the workaround below to upgrade from versions previous to 2.0.0. The following example assumes that the release name is kafka:
|
||||
|
||||
```console
|
||||
kubectl delete statefulset kafka-kafka --cascade=false
|
||||
kubectl delete statefulset kafka-zookeeper --cascade=false
|
||||
```
|
||||
|
||||
### To 1.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||
Use the workaround below to upgrade from versions previous to 1.0.0. The following example assumes that the release name is kafka:
|
||||
|
||||
```console
|
||||
kubectl delete statefulset kafka-kafka --cascade=false
|
||||
kubectl delete statefulset kafka-zookeeper --cascade=false
|
||||
```
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
# Patterns to ignore when building packages.
|
||||
# This supports shell glob matching, relative path matching, and
|
||||
# negation (prefixed with !). Only one pattern per line.
|
||||
.DS_Store
|
||||
# Common VCS dirs
|
||||
.git/
|
||||
.gitignore
|
||||
.bzr/
|
||||
.bzrignore
|
||||
.hg/
|
||||
.hgignore
|
||||
.svn/
|
||||
# Common backup files
|
||||
*.swp
|
||||
*.bak
|
||||
*.tmp
|
||||
*~
|
||||
# Various IDEs
|
||||
.project
|
||||
.idea/
|
||||
*.tmproj
|
||||
|
|
@ -1,20 +0,0 @@
|
|||
annotations:
|
||||
category: Infrastructure
|
||||
apiVersion: v1
|
||||
appVersion: 3.6.2
|
||||
description: A centralized service for maintaining configuration information, naming,
|
||||
providing distributed synchronization, and providing group services for distributed
|
||||
applications.
|
||||
engine: gotpl
|
||||
home: https://github.com/bitnami/charts/tree/master/bitnami/zookeeper
|
||||
icon: https://bitnami.com/assets/stacks/zookeeper/img/zookeeper-stack-110x117.png
|
||||
keywords:
|
||||
- zookeeper
|
||||
maintainers:
|
||||
- email: containers@bitnami.com
|
||||
name: Bitnami
|
||||
name: zookeeper
|
||||
sources:
|
||||
- https://github.com/bitnami/bitnami-docker-zookeeper
|
||||
- https://zookeeper.apache.org/
|
||||
version: 5.21.9
|
||||
|
|
@ -1,297 +0,0 @@
|
|||
# ZooKeeper
|
||||
|
||||
[ZooKeeper](https://zookeeper.apache.org/) is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. All of these kinds of services are used in some form or other by distributed applications.
|
||||
|
||||
## TL;DR
|
||||
|
||||
```console
|
||||
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
$ helm install my-release bitnami/zookeeper
|
||||
```
|
||||
|
||||
## Introduction
|
||||
|
||||
This chart bootstraps a [ZooKeeper](https://github.com/bitnami/bitnami-docker-zookeeper) deployment on a [Kubernetes](http://kubernetes.io) cluster using the [Helm](https://helm.sh) package manager.
|
||||
|
||||
Bitnami charts can be used with [Kubeapps](https://kubeapps.com/) for deployment and management of Helm Charts in clusters. This Helm chart has been tested on top of [Bitnami Kubernetes Production Runtime](https://kubeprod.io/) (BKPR). Deploy BKPR to get automated TLS certificates, logging and monitoring for your applications.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
- Kubernetes 1.12+
|
||||
- Helm 2.12+ or Helm 3.0-beta3+
|
||||
- PV provisioner support in the underlying infrastructure
|
||||
|
||||
## Installing the Chart
|
||||
|
||||
To install the chart with the release name `my-release`:
|
||||
|
||||
```console
|
||||
$ helm repo add bitnami https://charts.bitnami.com/bitnami
|
||||
$ helm install my-release bitnami/zookeeper
|
||||
```
|
||||
|
||||
These commands deploy ZooKeeper on the Kubernetes cluster in the default configuration. The [Parameters](#parameters) section lists the parameters that can be configured during installation.
|
||||
|
||||
> **Tip**: List all releases using `helm list`
|
||||
|
||||
## Uninstalling the Chart
|
||||
|
||||
To uninstall/delete the `my-release` deployment:
|
||||
|
||||
```console
|
||||
$ helm delete my-release
|
||||
```
|
||||
|
||||
The command removes all the Kubernetes components associated with the chart and deletes the release.
|
||||
|
||||
## Parameters
|
||||
|
||||
The following tables lists the configurable parameters of the ZooKeeper chart and their default values per section/component:
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `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.storageClass` | Global storage class for dynamic provisioning | `nil` |
|
||||
|
||||
### Common parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `nameOverride` | String to partially override zookeeper.fullname | `nil` |
|
||||
| `fullnameOverride` | String to fully override zookeeper.fullname | `nil` |
|
||||
| `clusterDomain` | Default Kubernetes cluster domain | `cluster.local` |
|
||||
| `commonLabels` | Labels to add to all deployed objects | `{}` |
|
||||
| `commonAnnotations` | Annotations to add to all deployed objects | `{}` |
|
||||
| `schedulerName` | Kubernetes pod scheduler registry | `nil` (use the default-scheduler) |
|
||||
|
||||
### Zookeeper chart parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `image.registry` | ZooKeeper image registry | `docker.io` |
|
||||
| `image.repository` | ZooKeeper Image name | `bitnami/zookeeper` |
|
||||
| `image.tag` | ZooKeeper Image tag | `{TAG_NAME}` |
|
||||
| `image.pullPolicy` | ZooKeeper image pull policy | `IfNotPresent` |
|
||||
| `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` |
|
||||
| `tickTime` | Basic time unit in milliseconds used by ZooKeeper for heartbeats | `2000` |
|
||||
| `initLimit` | Time the ZooKeeper servers in quorum have to connect to a leader | `10` |
|
||||
| `syncLimit` | How far out of date a server can be from a leader | `5` |
|
||||
| `maxClientCnxns` | Number of concurrent connections that a single client may make to a single member | `60` |
|
||||
| `maxSessionTimeout` | Maximum session timeout in milliseconds that the server will allow the client to negotiate. | `40000` |
|
||||
| `autopurge.snapRetainCount` | Number of retains snapshots for autopurge | `3` |
|
||||
| `autopurge.purgeInterval` | The time interval in hours for which the purge task has to be triggered | `0` |
|
||||
| `fourlwCommandsWhitelist` | A list of comma separated Four Letter Words commands to use | `srvr, mntr` |
|
||||
| `listenOnAllIPs` | Allow Zookeeper to listen for connections from its peers on all available IP addresses. | `false` |
|
||||
| `allowAnonymousLogin` | Allow to accept connections from unauthenticated users | `yes` |
|
||||
| `auth.existingSecret` | Use existing secret (ignores previous password) | `nil` |
|
||||
| `auth.enabled` | Enable ZooKeeper auth | `false` |
|
||||
| `auth.clientUser` | User that will use ZooKeeper clients to auth | `nil` |
|
||||
| `auth.clientPassword` | Password that will use ZooKeeper clients to auth | `nil` |
|
||||
| `auth.serverUsers` | List of user to be created | `nil` |
|
||||
| `auth.serverPasswords` | List of passwords to assign to users when created | `nil` |
|
||||
| `heapSize` | Size in MB for the Java Heap options (Xmx and XMs) | `[]` |
|
||||
| `logLevel` | Log level of ZooKeeper server | `ERROR` |
|
||||
| `jvmFlags` | Default JVMFLAGS for the ZooKeeper process | `nil` |
|
||||
| `config` | Configure ZooKeeper with a custom zoo.conf file | `nil` |
|
||||
| `dataLogDir` | Data log directory | `""` |
|
||||
|
||||
### Statefulset parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `replicaCount` | Number of ZooKeeper nodes | `1` |
|
||||
| `updateStrategy` | Update strategy for the statefulset | `RollingUpdate` |
|
||||
| `rollingUpdatePartition` | Partition update strategy | `nil` |
|
||||
| `podManagementPolicy` | Pod management policy | `Parallel` |
|
||||
| `podLabels` | ZooKeeper pod labels | `{}` (evaluated as a template) |
|
||||
| `podAnnotations` | ZooKeeper Pod annotations | `{}` (evaluated as a template) |
|
||||
| `affinity` | Affinity for pod assignment | `{}` (evaluated as a template) |
|
||||
| `nodeSelector` | Node labels for pod assignment | `{}` (evaluated as a template) |
|
||||
| `tolerations` | Tolerations for pod assignment | `[]` (evaluated as a template) |
|
||||
| `priorityClassName` | Name of the existing priority class to be used by ZooKeeper pods | `""` |
|
||||
| `securityContext.enabled` | Enable security context (ZooKeeper master pod) | `true` |
|
||||
| `securityContext.fsGroup` | Group ID for the container (ZooKeeper master pod) | `1001` |
|
||||
| `securityContext.runAsUser` | User ID for the container (ZooKeeper master pod) | `1001` |
|
||||
| `resources` | CPU/Memory resource requests/limits | Memory: `256Mi`, CPU: `250m` |
|
||||
| `livenessProbe` | Liveness probe configuration for ZooKeeper | Check `values.yaml` file |
|
||||
| `readinessProbe` | Readiness probe configuration for ZooKeeper | Check `values.yaml` file |
|
||||
| `extraVolumes` | Extra volumes | `nil` |
|
||||
| `extraVolumeMounts` | Mount extra volume(s) | `nil` |
|
||||
| `podDisruptionBudget.maxUnavailable` | Max number of pods down simultaneously | `1` |
|
||||
|
||||
### Exposure parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `service.type` | Kubernetes Service type | `ClusterIP` |
|
||||
| `service.port` | ZooKeeper port | `2181` |
|
||||
| `service.followerPort` | ZooKeeper follower port | `2888` |
|
||||
| `service.electionPort` | ZooKeeper election port | `3888` |
|
||||
| `service.publishNotReadyAddresses` | If the ZooKeeper headless service should publish DNS records for not ready pods | `true` |
|
||||
| `serviceAccount.create` | Enable creation of ServiceAccount for zookeeper pod | `false` |
|
||||
| `serviceAccount.name` | The name of the service account to use. If not set and `create` is `true`, a name is generated | Generated using the `zookeeper.fullname` template |
|
||||
| `service.tls.client_enable` | Enable tls for client connections | `false` |
|
||||
| `service.tls.quorum_enable` | Enable tls for quorum protocol | `false` |
|
||||
| `service.tls.disable_base_client_port` | Remove client port from service definitions. | `false` |
|
||||
| `service.tls.client_port` | Service port for tls client connections | `3181` |
|
||||
| `service.tls.client_keystore_path` | KeyStore file path. Refer to extraVolumes and extraVolumeMounts for mounting files into the pods | `/tls_key_store/key_store_file` |
|
||||
| `service.tls.client_keystore_password` | KeyStore password. You can use environment variables. | `nil` |
|
||||
| `service.tls.client_truststore_path` | TrustStore file path. Refer to extraVolumes and extraVolumeMounts for mounting files into the pods | `/tls_trust_store/trust_store_file` |
|
||||
| `service.tls.client_truststore_password` | TrustStore password. You can use environment variables. | `nil` |
|
||||
| `service.tls.quorum_keystore_path` | KeyStore file path. Refer to extraVolumes and extraVolumeMounts for mounting files into the pods | `/tls_key_store/key_store_file` |
|
||||
| `service.tls.quorum_keystore_password` | KeyStore password. You can use environment variables. | `nil` |
|
||||
| `service.tls.quorum_truststore_path` | TrustStore file path. Refer to extraVolumes and extraVolumeMounts for mounting files into the pods | `/tls_trust_store/trust_store_file` |
|
||||
| `service.tls.quorum_truststore_password` | TrustStore password. You can use environment variables. | `nil` |
|
||||
| `service.annotations` | Annotations for the Service | `{}` |
|
||||
| `service.headless.annotations` | Annotations for the Headless Service | `{}` |
|
||||
| `networkPolicy.enabled` | Enable NetworkPolicy | `false` |
|
||||
| `networkPolicy.allowExternal` | Don't require client label for connections | `true` |
|
||||
|
||||
### Persistence parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `persistence.enabled` | Enable Zookeeper data persistence using PVC | `true` |
|
||||
| `persistence.existingClaim` | Provide an existing `PersistentVolumeClaim` | `nil` (evaluated as a template) |
|
||||
| `persistence.storageClass` | PVC Storage Class for ZooKeeper data volume | `nil` |
|
||||
| `persistence.accessMode` | PVC Access Mode for ZooKeeper data volume | `ReadWriteOnce` |
|
||||
| `persistence.size` | PVC Storage Request for ZooKeeper data volume | `8Gi` |
|
||||
| `persistence.annotations` | Annotations for the PVC | `{}` (evaluated as a template) |
|
||||
| `persistence.dataLogDir.size` | PVC Storage Request for ZooKeeper's Data log directory | `8Gi` |
|
||||
| `persistence.dataLogDir.existingClaim` | Provide an existing `PersistentVolumeClaim` for Zookeeper's Data log directory | `nil` (evaluated as a template) |
|
||||
|
||||
### Volume Permissions parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|---------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------|
|
||||
| `volumePermissions.enabled` | Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup` | `false` |
|
||||
| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` |
|
||||
| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/minideb` |
|
||||
| `volumePermissions.image.tag` | Init container volume-permissions image tag | `buster` |
|
||||
| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `Always` |
|
||||
| `volumePermissions.resources` | Init container resource requests/limit | `nil` |
|
||||
|
||||
### Metrics parameters
|
||||
|
||||
| Parameter | Description | Default |
|
||||
|-------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------|
|
||||
| `metrics.enabled` | Enable prometheus to access zookeeper metrics endpoint | `false` |
|
||||
| `metrics.containerPort` | Port where a Jetty server will expose Prometheus metrics | `9141` |
|
||||
| `metrics.service.type` | Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) for Jetty server exposing Prometheus metrics | `ClusterIP` |
|
||||
| `metrics.service.port` | Prometheus metrics service port | `9141` |
|
||||
| `metrics.service.annotations` | Service annotations for Prometheus to auto-discover the metrics endpoint | `{prometheus.io/scrape: "true", prometheus.io/port: "9141"}` |
|
||||
| `metrics.serviceMonitor.enabled` | if `true`, creates a Prometheus Operator ServiceMonitor (also requires `metrics.enabled` to be `true`) | `false` |
|
||||
| `metrics.serviceMonitor.namespace` | Namespace for the ServiceMonitor Resource | The Release Namespace |
|
||||
| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped. | `nil` (Prometheus Operator default value) |
|
||||
| `metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `nil` (Prometheus Operator default value) |
|
||||
| `metrics.serviceMonitor.selector` | Prometheus instance selector labels | `nil` |
|
||||
| `metrics.prometheusRule.enabled` | if `true`, creates a Prometheus Operator PrometheusRule (also requires `metrics.enabled` to be `true` and `metrics.prometheusRule.rules`) | `false` |
|
||||
| `metrics.prometheusRule.namespace` | Namespace for the PrometheusRule Resource | The Release Namespace |
|
||||
| `metrics.prometheusRule.selector` | Prometheus instance selector labels | `nil` |
|
||||
| `metrics.prometheusRule.rules` | Prometheus Rule definitions (see values.yaml for examples) | `[]` |
|
||||
|
||||
Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example,
|
||||
|
||||
```console
|
||||
$ helm install my-release \
|
||||
--set auth.clientUser=newUser \
|
||||
bitnami/zookeeper
|
||||
```
|
||||
|
||||
The above command sets the ZooKeeper user to `newUser`.
|
||||
|
||||
Alternatively, a YAML file that specifies the values for the parameters can be provided while installing the chart. For example,
|
||||
|
||||
```console
|
||||
$ helm install my-release -f values.yaml bitnami/zookeeper
|
||||
```
|
||||
|
||||
> **Tip**: You can use the default [values.yaml](values.yaml)
|
||||
|
||||
## Configuration and installation details
|
||||
|
||||
### [Rolling VS Immutable tags](https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/)
|
||||
|
||||
It is strongly recommended to use immutable tags in a production environment. This ensures your deployment does not change automatically if the same tag is updated with a different image.
|
||||
|
||||
Bitnami will release a new chart updating its containers if a new version of the main container, significant changes, or critical vulnerabilities exist.
|
||||
|
||||
### Production configuration
|
||||
|
||||
This chart includes a `values-production.yaml` file where you can find some parameters oriented to production configuration in comparison to the regular `values.yaml`. You can use this file instead of the default one.
|
||||
|
||||
- Number of ZooKeeper nodes:
|
||||
|
||||
```diff
|
||||
- replicaCount: 1
|
||||
+ replicaCount: 3
|
||||
```
|
||||
|
||||
- Enable prometheus metrics:
|
||||
|
||||
```diff
|
||||
- metrics.enabled: false
|
||||
+ metrics.enabled: true
|
||||
```
|
||||
|
||||
### Log level
|
||||
|
||||
You can configure the ZooKeeper log level using the `ZOO_LOG_LEVEL` environment variable. By default, it is set to `ERROR` because of each readiness probe produce an `INFO` message on connection and a `WARN` message on disconnection.
|
||||
|
||||
## Persistence
|
||||
|
||||
The [Bitnami ZooKeeper](https://github.com/bitnami/bitnami-docker-zookeeper) image stores the ZooKeeper data and configurations at the `/bitnami/zookeeper` path of the container.
|
||||
|
||||
Persistent Volume Claims are used to keep the data across deployments. This is known to work in GCE, AWS, and minikube.
|
||||
See the [Parameters](#parameters) 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`.
|
||||
|
||||
### Data Log Directory
|
||||
|
||||
You can use a dedicated device for logs (instead of using the data directory) to help avoiding competition between logging and snapshots. To do so, set the `dataLogDir` parameter with the path to be used for writing transaction logs. Alternatively, set this parameter with an empty string an it result in the log being written to the data directory (Zookeeper's default behavior).
|
||||
|
||||
When using a dedicated device for logs, you can use a PVC to persist the logs. To do so, set `persistence.enabled` to `true`. See the [Persistence Parameters](#persistence-parameters) section for more information.
|
||||
|
||||
## Upgrading
|
||||
|
||||
### To 5.21.0
|
||||
|
||||
A couple of parameters related to Zookeeper metrics were renamed or disappeared in favor of new ones:
|
||||
|
||||
- `metrics.port` is renamed to `metrics.containerPort`.
|
||||
- `metrics.annotations` is deprecated in favor of `metrics.service.annotations`.
|
||||
|
||||
### To 3.0.0
|
||||
|
||||
This new version of the chart includes the new ZooKeeper major version 3.5.5. Note that to perform an automatic upgrade
|
||||
of the application, each node will need to have at least one snapshot file created in the data directory. If not, the
|
||||
new version of the application won't be able to start the service. Please refer to [ZOOKEEPER-3056](https://issues.apache.org/jira/browse/ZOOKEEPER-3056)
|
||||
in order to find ways to workaround this issue in case you are facing it.
|
||||
|
||||
### To 2.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's statefulsets.
|
||||
Use the workaround below to upgrade from versions previous to 2.0.0. The following example assumes that the release name is `zookeeper`:
|
||||
|
||||
```console
|
||||
$ kubectl delete statefulset zookeeper-zookeeper --cascade=false
|
||||
```
|
||||
|
||||
### To 1.0.0
|
||||
|
||||
Backwards compatibility is not guaranteed unless you modify the labels used on the chart's deployments.
|
||||
Use the workaround below to upgrade from versions previous to 1.0.0. The following example assumes that the release name is zookeeper:
|
||||
|
||||
```console
|
||||
$ kubectl delete statefulset zookeeper-zookeeper --cascade=false
|
||||
```
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
{{- if contains .Values.service.type "LoadBalancer" }}
|
||||
{{- if not .Values.auth.clientPassword }}
|
||||
-------------------------------------------------------------------------------
|
||||
WARNING
|
||||
|
||||
By specifying "serviceType=LoadBalancer" and not specifying "auth.enabled=true"
|
||||
you have most likely exposed the ZooKeeper service externally without any
|
||||
authentication mechanism.
|
||||
|
||||
For security reasons, we strongly suggest that you switch to "ClusterIP" or
|
||||
"NodePort". As alternative, you can also specify a valid password on the
|
||||
"auth.clientPassword" parameter.
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
** Please be patient while the chart is being deployed **
|
||||
|
||||
ZooKeeper can be accessed via port 2181 on the following DNS name from within your cluster:
|
||||
|
||||
{{ template "zookeeper.fullname" . }}.{{ .Release.Namespace }}.svc.{{ .Values.clusterDomain }}
|
||||
|
||||
To connect to your ZooKeeper server run the following commands:
|
||||
|
||||
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "zookeeper.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=zookeeper" -o jsonpath="{.items[0].metadata.name}")
|
||||
kubectl exec -it $POD_NAME -- zkCli.sh
|
||||
|
||||
To connect to your ZooKeeper server from outside the cluster execute the following commands:
|
||||
|
||||
{{- if contains "NodePort" .Values.service.type }}
|
||||
|
||||
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
|
||||
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ template "zookeeper.fullname" . }})
|
||||
zkCli.sh $NODE_IP:$NODE_PORT
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.service.type }}
|
||||
|
||||
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -w {{ template "zookeeper.fullname" . }}'
|
||||
|
||||
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ template "zookeeper.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
|
||||
zkCli.sh $SERVICE_IP:2181
|
||||
|
||||
{{- else if contains "ClusterIP" .Values.service.type }}
|
||||
|
||||
kubectl port-forward --namespace {{ .Release.Namespace }} svc/{{ template "zookeeper.fullname" . }} 2181:2181 &
|
||||
zkCli.sh 127.0.0.1:2181
|
||||
|
||||
{{- end }}
|
||||
|
||||
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
|
||||
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
|
||||
{{- end }}
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "zookeeper.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "zookeeper.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "zookeeper.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "zookeeper.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "zookeeper.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Zookeeper image name
|
||||
*/}}
|
||||
{{- define "zookeeper.image" -}}
|
||||
{{- $registryName := .Values.image.registry -}}
|
||||
{{- $repositoryName := .Values.image.repository -}}
|
||||
{{- $tag := .Values.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "zookeeper.imagePullSecrets" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Also, we can not use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- else if or .Values.image.pullSecrets .Values.volumePermissions.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumePermissions.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- else if or .Values.image.pullSecrets .Values.volumePermissions.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumePermissions.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "zookeeper.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "zookeeper.name" . }}
|
||||
helm.sh/chart: {{ include "zookeeper.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Renders a value that contains template.
|
||||
Usage:
|
||||
{{ include "zookeeper.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||
*/}}
|
||||
{{- define "zookeeper.tplValue" -}}
|
||||
{{- if typeIs "string" .value }}
|
||||
{{- tpl .value .context }}
|
||||
{{- else }}
|
||||
{{- tpl (.value | toYaml) .context }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||
*/}}
|
||||
{{- define "zookeeper.matchLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "zookeeper.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return ZooKeeper Client Password
|
||||
*/}}
|
||||
{{- define "zookeeper.clientPassword" -}}
|
||||
{{- if .Values.auth.clientPassword -}}
|
||||
{{- .Values.auth.clientPassword -}}
|
||||
{{- else -}}
|
||||
{{- randAlphaNum 10 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return ZooKeeper Servers Passwords
|
||||
*/}}
|
||||
{{- define "zookeeper.serverPasswords" -}}
|
||||
{{- if .Values.auth.serverPasswords -}}
|
||||
{{- .Values.auth.serverPasswords -}}
|
||||
{{- else -}}
|
||||
{{- randAlphaNum 10 -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the init container volume-permissions image)
|
||||
*/}}
|
||||
{{- define "zookeeper.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "zookeeper.storageClass" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
{{- if .Values.config }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
zoo.cfg: |-
|
||||
{{ .Values.config | indent 4 }}
|
||||
{{- end -}}
|
||||
|
|
@ -1,29 +0,0 @@
|
|||
{{- if .Values.metrics.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}-metrics
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.metrics.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.metrics.service.annotations }}
|
||||
{{ include "zookeeper.tplValue" ( dict "value" .Values.metrics.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.metrics.service.type }}
|
||||
ports:
|
||||
- name: tcp-metrics
|
||||
port: {{ .Values.metrics.service.port }}
|
||||
targetPort: metrics
|
||||
selector: {{- include "zookeeper.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- end }}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
{{- if .Values.networkPolicy.enabled }}
|
||||
kind: NetworkPolicy
|
||||
apiVersion: networking.k8s.io/v1
|
||||
metadata:
|
||||
name: {{ include "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
podSelector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 6 }}
|
||||
ingress:
|
||||
# Allow inbound connections to zookeeper
|
||||
- ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
from:
|
||||
{{- if not .Values.networkPolicy.allowExternal }}
|
||||
- podSelector:
|
||||
matchLabels:
|
||||
{{ include "zookeeper.fullname" . }}-client: "true"
|
||||
- podSelector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 14 }}
|
||||
{{- else }}
|
||||
- podSelector:
|
||||
matchLabels: {}
|
||||
{{- end }}
|
||||
# Internal ports
|
||||
- ports: &intranodes_ports
|
||||
- port: {{ .Values.service.followerPort }}
|
||||
- port: {{ .Values.service.electionPort }}
|
||||
from:
|
||||
- podSelector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 14 }}
|
||||
egress:
|
||||
- ports: *intranodes_ports
|
||||
# Allow outbound connections from zookeeper nodes
|
||||
|
||||
{{- end }}
|
||||
|
|
@ -1,21 +0,0 @@
|
|||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- if gt $replicaCount 1 }}
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- toYaml .Values.podDisruptionBudget | nindent 2 }}
|
||||
{{- end }}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
{{- if and .Values.metrics.enabled .Values.metrics.prometheusRule.enabled .Values.metrics.prometheusRule.rules }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: PrometheusRule
|
||||
metadata:
|
||||
name: {{ include "zookeeper.fullname" . }}
|
||||
{{- if .Values.metrics.prometheusRule.namespace }}
|
||||
namespace: {{ .Values.metrics.prometheusRule.namespace }}
|
||||
{{- else }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- range $key, $value := .Values.metrics.prometheusRule.selector }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
groups:
|
||||
- name: {{ include "zookeeper.fullname" . }}
|
||||
rules: {{- toYaml .Values.metrics.prometheusRule.rules | nindent 6 }}
|
||||
{{- end }}
|
||||
|
||||
|
|
@ -1,18 +0,0 @@
|
|||
{{- if and .Values.auth.enabled (not .Values.auth.existingSecret) -}}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
client-password: {{ include "zookeeper.clientPassword" . | b64enc | quote }}
|
||||
server-password: {{ include "zookeeper.serverPasswords" . | b64enc | quote }}
|
||||
{{- end }}
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
{{- if .Values.serviceAccount.create }}
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: {{ template "zookeeper.serviceAccountName" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
role: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,38 +0,0 @@
|
|||
{{- if and .Values.metrics.enabled .Values.metrics.serviceMonitor.enabled }}
|
||||
apiVersion: monitoring.coreos.com/v1
|
||||
kind: ServiceMonitor
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
{{- if .Values.metrics.serviceMonitor.namespace }}
|
||||
namespace: {{ .Values.metrics.serviceMonitor.namespace }}
|
||||
{{- else }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- range $key, $value := .Values.metrics.serviceMonitor.selector }}
|
||||
{{ $key }}: {{ $value | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
selector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
endpoints:
|
||||
- port: tcp-metrics
|
||||
path: "/metrics"
|
||||
{{- if .Values.metrics.serviceMonitor.interval }}
|
||||
interval: {{ .Values.metrics.serviceMonitor.interval }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
scrapeTimeout: {{ .Values.metrics.serviceMonitor.scrapeTimeout }}
|
||||
{{- end }}
|
||||
namespaceSelector:
|
||||
matchNames:
|
||||
- {{ .Release.Namespace }}
|
||||
{{- end }}
|
||||
|
|
@ -1,334 +0,0 @@
|
|||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
role: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
serviceName: {{ template "zookeeper.fullname" . }}-headless
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
podManagementPolicy: {{ .Values.podManagementPolicy }}
|
||||
updateStrategy:
|
||||
type: {{ .Values.updateStrategy }}
|
||||
{{- if (eq "Recreate" .Values.updateStrategy) }}
|
||||
rollingUpdate: null
|
||||
{{- else if .Values.rollingUpdatePartition }}
|
||||
rollingUpdate:
|
||||
partition: {{ .Values.rollingUpdatePartition }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "zookeeper.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
template:
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.podLabels }}
|
||||
{{- include "zookeeper.tplValue" (dict "value" .Values.podLabels "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.podAnnotations }}
|
||||
annotations: {{- include "zookeeper.tplValue" ( dict "value" .Values.podAnnotations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.schedulerName }}
|
||||
schedulerName: {{ .Values.schedulerName }}
|
||||
{{- end }}
|
||||
{{- include "zookeeper.imagePullSecrets" . | nindent 6 }}
|
||||
serviceAccountName: {{ template "zookeeper.serviceAccountName" . }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
fsGroup: {{ .Values.securityContext.fsGroup }}
|
||||
{{- end }}
|
||||
{{- if .Values.affinity }}
|
||||
affinity: {{- include "zookeeper.tplValue" (dict "value" .Values.affinity "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.nodeSelector }}
|
||||
nodeSelector: {{- include "zookeeper.tplValue" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.tolerations }}
|
||||
tolerations: {{- include "zookeeper.tplValue" (dict "value" .Values.tolerations "context" $) | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if .Values.priorityClassName }}
|
||||
priorityClassName: {{ .Values.priorityClassName }}
|
||||
{{- end }}
|
||||
{{- if and .Values.volumePermissions.enabled .Values.persistence.enabled }}
|
||||
initContainers:
|
||||
- name: volume-permissions
|
||||
image: {{ template "zookeeper.volumePermissions.image" . }}
|
||||
imagePullPolicy: {{ default "" .Values.volumePermissions.image.pullPolicy | quote }}
|
||||
command:
|
||||
- chown
|
||||
args:
|
||||
- -R
|
||||
- {{ .Values.securityContext.runAsUser }}:{{ .Values.securityContext.fsGroup }}
|
||||
- /bitnami/zookeeper
|
||||
{{- if .Values.dataLogDir }}
|
||||
- {{ .Values.dataLogDir }}
|
||||
{{- end }}
|
||||
securityContext:
|
||||
runAsUser: 0
|
||||
{{- if .Values.volumePermissions.resources }}
|
||||
resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/zookeeper
|
||||
{{- if .Values.dataLogDir }}
|
||||
- name: data-log
|
||||
mountPath: {{ .Values.dataLogDir }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
containers:
|
||||
- name: zookeeper
|
||||
image: {{ template "zookeeper.image" . }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy | quote }}
|
||||
{{- if .Values.securityContext.enabled }}
|
||||
securityContext:
|
||||
runAsUser: {{ .Values.securityContext.runAsUser }}
|
||||
{{- end }}
|
||||
command:
|
||||
- bash
|
||||
- -ec
|
||||
- |
|
||||
# Execute entrypoint as usual after obtaining ZOO_SERVER_ID based on POD hostname
|
||||
HOSTNAME=`hostname -s`
|
||||
if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
|
||||
ORD=${BASH_REMATCH[2]}
|
||||
export ZOO_SERVER_ID=$((ORD+1))
|
||||
else
|
||||
echo "Failed to get index from hostname $HOST"
|
||||
exit 1
|
||||
fi
|
||||
exec /entrypoint.sh /run.sh
|
||||
{{- if .Values.resources }}
|
||||
resources: {{- toYaml .Values.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
env:
|
||||
- name: ZOO_DATA_LOG_DIR
|
||||
value: {{ .Values.dataLogDir | quote }}
|
||||
- name: ZOO_PORT_NUMBER
|
||||
value: {{ .Values.service.port | quote }}
|
||||
- name: ZOO_TICK_TIME
|
||||
value: {{ .Values.tickTime | quote }}
|
||||
- name: ZOO_INIT_LIMIT
|
||||
value: {{ .Values.initLimit | quote }}
|
||||
- name: ZOO_SYNC_LIMIT
|
||||
value: {{ .Values.syncLimit | quote }}
|
||||
- name: ZOO_MAX_CLIENT_CNXNS
|
||||
value: {{ .Values.maxClientCnxns | quote }}
|
||||
- name: ZOO_4LW_COMMANDS_WHITELIST
|
||||
value: {{ .Values.fourlwCommandsWhitelist | quote }}
|
||||
- name: ZOO_LISTEN_ALLIPS_ENABLED
|
||||
value: {{ ternary "yes" "no" .Values.listenOnAllIPs | quote }}
|
||||
- name: ZOO_AUTOPURGE_INTERVAL
|
||||
value: {{ .Values.autopurge.purgeInterval | quote }}
|
||||
- name: ZOO_AUTOPURGE_RETAIN_COUNT
|
||||
value: {{ .Values.autopurge.snapRetainCount | quote }}
|
||||
- name: ZOO_MAX_SESSION_TIMEOUT
|
||||
value: {{ .Values.maxSessionTimeout | quote }}
|
||||
- name: ZOO_SERVERS
|
||||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- $followerPort := int .Values.service.followerPort }}
|
||||
{{- $electionPort := int .Values.service.electionPort }}
|
||||
{{- $releaseNamespace := .Release.Namespace }}
|
||||
{{- $zookeeperFullname := include "zookeeper.fullname" . }}
|
||||
{{- $zookeeperHeadlessServiceName := printf "%s-%s" $zookeeperFullname "headless" | trunc 63 }}
|
||||
{{- $clusterDomain := .Values.clusterDomain }}
|
||||
value: {{ range $i, $e := until $replicaCount }}{{ $zookeeperFullname }}-{{ $e }}.{{ $zookeeperHeadlessServiceName }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ $followerPort }}:{{ $electionPort }} {{ end }}
|
||||
- name: ZOO_ENABLE_AUTH
|
||||
value: {{ ternary "yes" "no" .Values.auth.enabled | quote }}
|
||||
{{- if .Values.auth.enabled }}
|
||||
- name: ZOO_CLIENT_USER
|
||||
value: {{ .Values.auth.clientUser | quote }}
|
||||
- name: ZOO_CLIENT_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ if .Values.auth.existingSecret }}{{ .Values.auth.existingSecret }}{{ else }}{{ template "zookeeper.fullname" . }}{{ end }}
|
||||
key: client-password
|
||||
- name: ZOO_SERVER_USERS
|
||||
value: {{ .Values.auth.serverUsers | quote }}
|
||||
- name: ZOO_SERVER_PASSWORDS
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ if .Values.auth.existingSecret }}{{ .Values.auth.existingSecret }}{{ else }}{{ template "zookeeper.fullname" . }}{{ end }}
|
||||
key: server-password
|
||||
{{- end }}
|
||||
- name: ZOO_HEAP_SIZE
|
||||
value: {{ .Values.heapSize | quote }}
|
||||
- name: ZOO_LOG_LEVEL
|
||||
value: {{ .Values.logLevel | quote }}
|
||||
- name: ALLOW_ANONYMOUS_LOGIN
|
||||
value: {{ ternary "yes" "no" .Values.allowAnonymousLogin | quote }}
|
||||
{{- if .Values.jvmFlags }}
|
||||
- name: JVMFLAGS
|
||||
value: {{ .Values.jvmFlags | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: ZOO_ENABLE_PROMETHEUS_METRICS
|
||||
value: "yes"
|
||||
- name: ZOO_PROMETHEUS_METRICS_PORT_NUMBER
|
||||
value: {{ .Values.metrics.containerPort | quote }}
|
||||
{{- end }}
|
||||
{{- if .Values.service.tls.client_enable }}
|
||||
- name: ZOO_TLS_CLIENT_ENABLE
|
||||
value: {{ .Values.service.tls.client_enable | quote }}
|
||||
- name: ZOO_TLS_CLIENT_KEYSTORE_FILE
|
||||
value: {{ .Values.service.tls.client_keystore_path | quote }}
|
||||
- name: ZOO_TLS_CLIENT_KEYSTORE_PASSWORD
|
||||
value: {{ .Values.service.tls.client_keystore_password | quote }}
|
||||
- name: ZOO_TLS_CLIENT_TRUSTSTORE_FILE
|
||||
value: {{ .Values.service.tls.client_truststore_path | quote }}
|
||||
- name: ZOO_TLS_CLIENT_TRUSTSTORE_PASSWORD
|
||||
value: {{ .Values.service.tls.client_truststore_password | quote }}
|
||||
{{ end }}
|
||||
{{- if .Values.service.tls.quorum_enable }}
|
||||
- name: ZOO_TLS_QUORUM_ENABLE
|
||||
value: {{ .Values.service.tls.quorum_enable | quote }}
|
||||
- name: ZOO_TLS_QUORUM_KEYSTORE_FILE
|
||||
value: {{ .Values.service.tls.quorum_keystore_path | quote }}
|
||||
- name: ZOO_TLS_QUORUM_KEYSTORE_PASSWORD
|
||||
value: {{ .Values.service.tls.quorum_keystore_password | quote }}
|
||||
- name: ZOO_TLS_QUORUM_TRUSTSTORE_FILE
|
||||
value: {{ .Values.service.tls.quorum_truststore_path | quote }}
|
||||
- name: ZOO_TLS_QUORUM_TRUSTSTORE_PASSWORD
|
||||
value: {{ .Values.service.tls.quorum_truststore_password | quote }}
|
||||
{{ end }}
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.name
|
||||
{{- if .Values.extraEnvVars }}
|
||||
{{- toYaml .Values.extraEnvVars | nindent 12 }}
|
||||
{{- end }}
|
||||
ports:
|
||||
{{ if not .Values.service.tls.disable_base_client_port }}
|
||||
- name: client
|
||||
containerPort: {{ .Values.service.port }}
|
||||
{{ end }}
|
||||
{{ if .Values.service.tls.client_enable }}
|
||||
- name: client-tls
|
||||
containerPort: {{ .Values.service.tls.client_port }}
|
||||
{{ end }}
|
||||
- name: follower
|
||||
containerPort: {{ .Values.service.followerPort }}
|
||||
- name: election
|
||||
containerPort: {{ .Values.service.electionPort }}
|
||||
{{- if .Values.metrics.enabled }}
|
||||
- name: metrics
|
||||
containerPort: {{ .Values.metrics.containerPort }}
|
||||
{{- end }}
|
||||
{{- if .Values.livenessProbe.enabled }}
|
||||
livenessProbe:
|
||||
exec:
|
||||
{{- if not .Values.service.tls.disable_base_client_port }}
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout {{ .Values.livenessProbe.probeCommandTimeout }} nc -w {{ .Values.livenessProbe.probeCommandTimeout }} localhost {{ .Values.service.port }} | grep imok']
|
||||
{{- else }}
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout {{ .Values.livenessProbe.probeCommandTimeout }} openssl s_client -quiet -crlf -connect localhost:{{ .Values.service.tls.client_port }} | grep imok']
|
||||
{{- end }}
|
||||
initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.livenessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.livenessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.livenessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
{{- if .Values.readinessProbe.enabled }}
|
||||
readinessProbe:
|
||||
exec:
|
||||
{{- if not .Values.service.tls.disable_base_client_port }}
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout {{ .Values.readinessProbe.probeCommandTimeout }} nc -w {{ .Values.readinessProbe.probeCommandTimeout }} localhost {{ .Values.service.port }} | grep imok']
|
||||
{{- else }}
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout {{ .Values.readinessProbe.probeCommandTimeout }} openssl s_client -quiet -crlf -connect localhost:{{ .Values.service.tls.client_port }} | grep imok']
|
||||
{{- end }}
|
||||
initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.readinessProbe.periodSeconds }}
|
||||
timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }}
|
||||
successThreshold: {{ .Values.readinessProbe.successThreshold }}
|
||||
failureThreshold: {{ .Values.readinessProbe.failureThreshold }}
|
||||
{{- end }}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/zookeeper
|
||||
{{- if .Values.dataLogDir }}
|
||||
- name: data-log
|
||||
mountPath: {{ .Values.dataLogDir }}
|
||||
{{- end }}
|
||||
{{- if .Values.config }}
|
||||
- name: config
|
||||
mountPath: /opt/bitnami/zookeeper/conf/zoo.cfg
|
||||
subPath: zoo.cfg
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumeMounts }}
|
||||
{{- toYaml .Values.extraVolumeMounts | nindent 12 }}
|
||||
{{- end }}
|
||||
volumes:
|
||||
{{- if .Values.config }}
|
||||
- name: config
|
||||
configMap:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
{{- end }}
|
||||
{{- if and .Values.persistence.enabled .Values.persistence.existingClaim }}
|
||||
- name: data
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ printf "%s" (tpl .Values.persistence.existingClaim .) }}
|
||||
{{- else if not .Values.persistence.enabled }}
|
||||
- name: data
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if and .Values.persistence.enabled .Values.persistence.dataLogDir.existingClaim }}
|
||||
- name: data-log
|
||||
persistentVolumeClaim:
|
||||
claimName: {{ printf "%s" (tpl .Values.persistence.dataLogDir.existingClaim .) }}
|
||||
{{- else if and ( not .Values.persistence.enabled ) .Values.dataLogDir }}
|
||||
- name: data-log
|
||||
emptyDir: {}
|
||||
{{- end }}
|
||||
{{- if .Values.extraVolumes }}
|
||||
{{- toYaml .Values.extraVolumes | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and .Values.persistence.enabled (not (and .Values.persistence.existingClaim .Values.persistence.dataLogDir.existingClaim) )}}
|
||||
volumeClaimTemplates:
|
||||
{{- if not .Values.persistence.existingClaim }}
|
||||
- metadata:
|
||||
name: data
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.persistence.annotations }}
|
||||
{{ $key }}: {{ $value }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.size | quote }}
|
||||
{{- include "zookeeper.storageClass" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- if and (not .Values.persistence.dataLogDir.existingClaim) .Values.dataLogDir }}
|
||||
- metadata:
|
||||
name: data-log
|
||||
annotations:
|
||||
{{- range $key, $value := .Values.persistence.annotations }}
|
||||
{{ $key }}: {{ $value }}
|
||||
{{- end }}
|
||||
spec:
|
||||
accessModes:
|
||||
{{- range .Values.persistence.accessModes }}
|
||||
- {{ . | quote }}
|
||||
{{- end }}
|
||||
resources:
|
||||
requests:
|
||||
storage: {{ .Values.persistence.dataLogDir.size | quote }}
|
||||
{{- include "zookeeper.storageClass" . | nindent 8 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,42 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}-headless
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.commonAnnotations .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- if .Values.service.headless.annotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.service.headless.annotations "context" $ ) | nindent 4 }}\
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
publishNotReadyAddresses: {{ .Values.service.publishNotReadyAddresses }}
|
||||
ports:
|
||||
{{ if not .Values.service.tls.disable_base_client_port }}
|
||||
- name: tcp-client
|
||||
port: 2181
|
||||
targetPort: client
|
||||
{{ end }}
|
||||
{{ if .Values.service.tls.client_enable }}
|
||||
- name: tcp-client-tls
|
||||
port: {{ .Values.service.tls.client_port }}
|
||||
targetPort: client-tls
|
||||
{{ end }}
|
||||
- name: follower
|
||||
port: 2888
|
||||
targetPort: follower
|
||||
- name: tcp-election
|
||||
port: 3888
|
||||
targetPort: election
|
||||
selector: {{- include "zookeeper.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
|
|
@ -1,40 +0,0 @@
|
|||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "zookeeper.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels: {{- include "zookeeper.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.commonAnnotations .Values.service.annotations }}
|
||||
annotations:
|
||||
{{- if .Values.service.annotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.service.annotations "context" $ ) | nindent 4 }}\
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "zookeeper.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
{{ if not .Values.service.tls.disable_base_client_port }}
|
||||
- name: tcp-client
|
||||
port: 2181
|
||||
targetPort: client
|
||||
{{ end }}
|
||||
{{ if .Values.service.tls.client_enable }}
|
||||
- name: tcp-client-tls
|
||||
port: {{ .Values.service.tls.client_port }}
|
||||
targetPort: client-tls
|
||||
{{ end }}
|
||||
- name: follower
|
||||
port: 2888
|
||||
targetPort: follower
|
||||
- name: tcp-election
|
||||
port: 3888
|
||||
targetPort: election
|
||||
selector: {{- include "zookeeper.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: zookeeper
|
||||
|
|
@ -1,430 +0,0 @@
|
|||
## Global Docker image parameters
|
||||
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
|
||||
##
|
||||
# global:
|
||||
# imageRegistry: myRegistryName
|
||||
# imagePullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
# storageClass: myStorageClass
|
||||
|
||||
## Bitnami Zookeeper image version
|
||||
## ref: https://hub.docker.com/r/bitnami/zookeeper/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/zookeeper
|
||||
tag: 3.6.2-debian-10-r10
|
||||
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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
|
||||
## Set to true if you would like to see extra information on logs
|
||||
## It turns BASH and NAMI debugging in minideb
|
||||
## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging
|
||||
##
|
||||
debug: false
|
||||
|
||||
## String to partially override zookeeper.fullname template (will maintain the release name)
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override zookeeper.fullname template
|
||||
# fullnameOverride:
|
||||
|
||||
## Kubernetes Cluster Domain
|
||||
##
|
||||
clusterDomain: cluster.local
|
||||
|
||||
## Add labels to all the deployed resources
|
||||
##
|
||||
commonLabels: {}
|
||||
|
||||
## Add annotations to all the deployed resources
|
||||
##
|
||||
commonAnnotations: {}
|
||||
|
||||
## 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: buster
|
||||
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: {}
|
||||
|
||||
## extraVolumes and extraVolumeMounts allows you to mount other volumes
|
||||
## Example Use Cases:
|
||||
## mount certificates to enable tls
|
||||
# extraVolumes:
|
||||
# - name: zookeeper-keystore
|
||||
# secret:
|
||||
# defaultMode: 288
|
||||
# secretName: zookeeper-keystore
|
||||
# - name: zookeeper-trustsore
|
||||
# secret:
|
||||
# defaultMode: 288
|
||||
# secretName: zookeeper-truststore
|
||||
# extraVolumeMounts:
|
||||
# - name: zookeeper-keystore
|
||||
# mountPath: /certs/keystore
|
||||
# readOnly: true
|
||||
# - name: zookeeper-truststore
|
||||
# mountPath: /certs/truststore
|
||||
# readOnly: true
|
||||
|
||||
|
||||
## 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
|
||||
##
|
||||
updateStrategy: RollingUpdate
|
||||
|
||||
## Limits the number of pods of the replicated application that are down simultaneously from voluntary disruptions
|
||||
## The PDB will only be created if replicaCount is greater than 1
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions
|
||||
##
|
||||
podDisruptionBudget:
|
||||
maxUnavailable: 1
|
||||
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
##
|
||||
# rollingUpdatePartition:
|
||||
|
||||
## StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel
|
||||
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy
|
||||
##
|
||||
podManagementPolicy: Parallel
|
||||
|
||||
## Number of ZooKeeper nodes
|
||||
##
|
||||
replicaCount: 3
|
||||
|
||||
## Basic time unit in milliseconds used by ZooKeeper for heartbeats
|
||||
##
|
||||
tickTime: 2000
|
||||
|
||||
## ZooKeeper uses to limit the length of time the ZooKeeper servers in quorum have to connect to a leader
|
||||
##
|
||||
initLimit: 10
|
||||
|
||||
## How far out of date a server can be from a leader
|
||||
##
|
||||
syncLimit: 5
|
||||
|
||||
## Limits the number of concurrent connections that a single client may make to a single member of the ZooKeeper ensemble
|
||||
##
|
||||
maxClientCnxns: 60
|
||||
|
||||
## Maximum session timeout in milliseconds that the server will allow the client to negotiate. Defaults to 20 times the tickTime.
|
||||
##
|
||||
maxSessionTimeout: 40000
|
||||
|
||||
## A list of comma separated Four Letter Words commands to use
|
||||
##
|
||||
fourlwCommandsWhitelist: srvr, mntr, ruok
|
||||
|
||||
## Allow zookeeper to listen for peers on all IPs
|
||||
##
|
||||
listenOnAllIPs: false
|
||||
|
||||
## Allow to accept connections from unauthenticated users
|
||||
##
|
||||
allowAnonymousLogin: true
|
||||
|
||||
autopurge:
|
||||
## Retains the snapRetainCount most recent snapshots and the corresponding transaction logs and deletes the rest
|
||||
##
|
||||
snapRetainCount: 3
|
||||
## The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging.
|
||||
##
|
||||
purgeInterval: 0
|
||||
|
||||
auth:
|
||||
## Use existing secret (ignores previous password)
|
||||
##
|
||||
# existingSecret:
|
||||
## Enable Zookeeper auth. It uses SASL/Digest-MD5
|
||||
##
|
||||
enabled: false
|
||||
## User that will use Zookeeper clients to auth
|
||||
##
|
||||
clientUser:
|
||||
## Password that will use Zookeeper clients to auth
|
||||
##
|
||||
clientPassword:
|
||||
## Comma, semicolon or whitespace separated list of user to be created. Specify them as a string, for example: "user1,user2,admin"
|
||||
##
|
||||
serverUsers:
|
||||
## Comma, semicolon or whitespace separated list of passwords to assign to users when created. Specify them as a string, for example: "pass4user1, pass4user2, pass4admin"
|
||||
##
|
||||
serverPasswords:
|
||||
|
||||
## Size in MB for the Java Heap options (Xmx and XMs). This env var is ignored if Xmx an Xms are configured via JVMFLAGS
|
||||
##
|
||||
heapSize: 1024
|
||||
|
||||
## Log level for the Zookeeper server. ERROR by default. Have in mind if you set it to INFO or WARN the ReadinessProve will produce a lot of logs.
|
||||
##
|
||||
logLevel: ERROR
|
||||
|
||||
## Data log directory. Specifying this option will direct zookeeper to write the transaction log to the dataLogDir rather than the dataDir.
|
||||
## This allows a dedicated log device to be used, and helps avoid competition between logging and snaphots.
|
||||
## Example:
|
||||
## dataLogDir: /bitnami/zookeeper/dataLog
|
||||
##
|
||||
dataLogDir: ""
|
||||
|
||||
## Default JVMFLAGS for the ZooKeeper process
|
||||
##
|
||||
# jvmFlags:
|
||||
|
||||
## Configure ZooKeeper with a custom zoo.cfg file
|
||||
##
|
||||
# config:
|
||||
|
||||
## Kubernetes configuration
|
||||
## For minikube, set this to NodePort, elsewhere use LoadBalancer
|
||||
##
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 2181
|
||||
followerPort: 2888
|
||||
electionPort: 3888
|
||||
publishNotReadyAddresses: true
|
||||
tls:
|
||||
client_enable: true
|
||||
quorum_enable: true
|
||||
disable_base_client_port: true
|
||||
|
||||
client_port: 3181
|
||||
|
||||
client_keystore_path: /tls_key_store/key_store_file
|
||||
client_keystore_password: ""
|
||||
client_truststore_path: /tls_trust_store/trust_store_file
|
||||
client_truststore_password: ""
|
||||
|
||||
quorum_keystore_path: /tls_key_store/key_store_file
|
||||
quorum_keystore_password: ""
|
||||
quorum_truststore_path: /tls_trust_store/trust_store_file
|
||||
quorum_truststore_password: ""
|
||||
annotations: {}
|
||||
headless:
|
||||
annotations: {}
|
||||
|
||||
## Service account for Zookeeper to use.
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||
##
|
||||
serviceAccount:
|
||||
## Specifies whether a ServiceAccount should be created
|
||||
##
|
||||
create: false
|
||||
## The name of the ServiceAccount to use.
|
||||
## If not set and create is true, a name is generated using the zookeeper.fullname template
|
||||
# name:
|
||||
|
||||
## Zookeeper Pod Security Context
|
||||
securityContext:
|
||||
enabled: true
|
||||
fsGroup: 1001
|
||||
runAsUser: 1001
|
||||
|
||||
## Zookeeper data Persistent Volume Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||
## GKE, AWS & OpenStack)
|
||||
##
|
||||
persistence:
|
||||
enabled: true
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
|
||||
# storageClass: "-"
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
size: 8Gi
|
||||
annotations: {}
|
||||
dataLogDir:
|
||||
size: 8Gi
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
|
||||
## Node labels for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
## Labels
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
podLabels: {}
|
||||
|
||||
## Annotations
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
podAnnotations: {}
|
||||
|
||||
## Name of the priority class to be used by zookeeper pods, priority class needs to be created beforehand
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
priorityClassName: ""
|
||||
|
||||
## Affinity for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Scheduler name
|
||||
## https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||
##
|
||||
# schedulerName: stork
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 250m
|
||||
|
||||
## Configure extra options for liveness and readiness probes
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
|
||||
##
|
||||
livenessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
probeCommandTimeout: 2
|
||||
|
||||
readinessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
probeCommandTimeout: 2
|
||||
|
||||
## Network policies
|
||||
## Ref: https://kubernetes.io/docs/concepts/services-networking/network-policies/
|
||||
##
|
||||
networkPolicy:
|
||||
## Specifies whether a NetworkPolicy should be created
|
||||
##
|
||||
enabled: true
|
||||
|
||||
## The Policy model to apply. When set to false, only pods with the correct
|
||||
## client label will have network access to the port Redis is listening
|
||||
## on. When true, zookeeper accept connections from any source
|
||||
## (with the correct destination port).
|
||||
##
|
||||
allowExternal: true
|
||||
|
||||
## Zookeeper Prometheus Exporter configuration
|
||||
##
|
||||
metrics:
|
||||
enabled: false
|
||||
|
||||
## Zookeeper Prometheus Exporter container port
|
||||
##
|
||||
containerPort: 9141
|
||||
|
||||
## Service configuration
|
||||
##
|
||||
service:
|
||||
## Zookeeper Prometheus Exporter service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## Zookeeper Prometheus Exporter service port
|
||||
##
|
||||
port: 9141
|
||||
## Annotations for the Zookeeper Prometheus Exporter metrics service
|
||||
##
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "{{ .Values.metrics.service.port }}"
|
||||
prometheus.io/path: "/metrics"
|
||||
|
||||
## Prometheus Operator ServiceMonitor configuration
|
||||
##
|
||||
serviceMonitor:
|
||||
enabled: false
|
||||
## Namespace for the ServiceMonitor Resource (defaults to the Release Namespace)
|
||||
##
|
||||
namespace:
|
||||
|
||||
## Interval at which metrics should be scraped.
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# interval: 10s
|
||||
|
||||
## Timeout after which the scrape is ended
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# scrapeTimeout: 10s
|
||||
|
||||
## ServiceMonitor selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
## Prometheus Operator PrometheusRule configuration
|
||||
##
|
||||
prometheusRule:
|
||||
enabled: false
|
||||
## Namespace for the PrometheusRule Resource (defaults to the Release Namespace)
|
||||
##
|
||||
namespace:
|
||||
|
||||
## PrometheusRule selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
## Some example rules.
|
||||
rules: []
|
||||
# - alert: ZookeeperSyncedFollowers
|
||||
# annotations:
|
||||
# message: The number of synced followers for the leader node in Zookeeper deployment my-release is less than 2. This usually means that some of the Zookeeper nodes aren't communicating properly. If it doesn't resolve itself you can try killing the pods (one by one).
|
||||
# expr: max(synced_followers{service="my-release-metrics"}) < 2
|
||||
# for: 5m
|
||||
# labels:
|
||||
# severity: critical
|
||||
# - alert: ZookeeperOutstandingRequests
|
||||
# annotations:
|
||||
# message: The number of outstanding requests for Zookeeper pod {{ $labels.pod }} is greater than 10. This can indicate a performance issue with the Pod or cluster a whole.
|
||||
# expr: outstanding_requests{service="my-release-metrics"} > 10
|
||||
# for: 5m
|
||||
# labels:
|
||||
# severity: critical
|
||||
|
|
@ -1,430 +0,0 @@
|
|||
## Global Docker image parameters
|
||||
## Please, note that this will override the image parameters, including dependencies, configured to use the global value
|
||||
## Current available global Docker image parameters: imageRegistry and imagePullSecrets
|
||||
##
|
||||
# global:
|
||||
# imageRegistry: myRegistryName
|
||||
# imagePullSecrets:
|
||||
# - myRegistryKeySecretName
|
||||
# storageClass: myStorageClass
|
||||
|
||||
## Bitnami Zookeeper image version
|
||||
## ref: https://hub.docker.com/r/bitnami/zookeeper/tags/
|
||||
##
|
||||
image:
|
||||
registry: docker.io
|
||||
repository: bitnami/zookeeper
|
||||
tag: 3.6.2-debian-10-r10
|
||||
|
||||
## Specify a imagePullPolicy
|
||||
## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent'
|
||||
## ref: http://kubernetes.io/docs/user-guide/images/#pre-pulling-images
|
||||
##
|
||||
pullPolicy: IfNotPresent
|
||||
## 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
|
||||
## Set to true if you would like to see extra information on logs
|
||||
## It turns BASH and NAMI debugging in minideb
|
||||
## ref: https://github.com/bitnami/minideb-extras/#turn-on-bash-debugging
|
||||
##
|
||||
debug: false
|
||||
|
||||
## String to partially override zookeeper.fullname template (will maintain the release name)
|
||||
# nameOverride:
|
||||
|
||||
## String to fully override zookeeper.fullname template
|
||||
# fullnameOverride:
|
||||
|
||||
## Kubernetes Cluster Domain
|
||||
##
|
||||
clusterDomain: cluster.local
|
||||
|
||||
## Add labels to all the deployed resources
|
||||
##
|
||||
commonLabels: {}
|
||||
|
||||
## Add annotations to all the deployed resources
|
||||
##
|
||||
commonAnnotations: {}
|
||||
|
||||
## 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: buster
|
||||
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: {}
|
||||
|
||||
## extraVolumes and extraVolumeMounts allows you to mount other volumes
|
||||
## Example Use Cases:
|
||||
## mount certificates to enable tls
|
||||
# extraVolumes:
|
||||
# - name: zookeeper-keystore
|
||||
# secret:
|
||||
# defaultMode: 288
|
||||
# secretName: zookeeper-keystore
|
||||
# - name: zookeeper-trustsore
|
||||
# secret:
|
||||
# defaultMode: 288
|
||||
# secretName: zookeeper-truststore
|
||||
# extraVolumeMounts:
|
||||
# - name: zookeeper-keystore
|
||||
# mountPath: /certs/keystore
|
||||
# readOnly: true
|
||||
# - name: zookeeper-truststore
|
||||
# mountPath: /certs/truststore
|
||||
# readOnly: true
|
||||
|
||||
## 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
|
||||
##
|
||||
updateStrategy: RollingUpdate
|
||||
|
||||
## Limits the number of pods of the replicated application that are down simultaneously from voluntary disruptions
|
||||
## The PDB will only be created if replicaCount is greater than 1
|
||||
## ref: https://kubernetes.io/docs/concepts/workloads/pods/disruptions
|
||||
##
|
||||
podDisruptionBudget:
|
||||
maxUnavailable: 1
|
||||
|
||||
## Partition update strategy
|
||||
## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions
|
||||
##
|
||||
# rollingUpdatePartition:
|
||||
|
||||
## StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel
|
||||
## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#pod-management-policy
|
||||
##
|
||||
podManagementPolicy: Parallel
|
||||
|
||||
## Number of ZooKeeper nodes
|
||||
##
|
||||
replicaCount: 1
|
||||
|
||||
## Basic time unit in milliseconds used by ZooKeeper for heartbeats
|
||||
##
|
||||
tickTime: 2000
|
||||
|
||||
## ZooKeeper uses to limit the length of time the ZooKeeper servers in quorum have to connect to a leader
|
||||
##
|
||||
initLimit: 10
|
||||
|
||||
## How far out of date a server can be from a leader
|
||||
##
|
||||
syncLimit: 5
|
||||
|
||||
## Limits the number of concurrent connections that a single client may make to a single member of the ZooKeeper ensemble
|
||||
##
|
||||
maxClientCnxns: 60
|
||||
|
||||
## A list of comma separated Four Letter Words commands to use
|
||||
##
|
||||
fourlwCommandsWhitelist: srvr, mntr, ruok
|
||||
|
||||
## Allow zookeeper to listen for peers on all IPs
|
||||
##
|
||||
listenOnAllIPs: false
|
||||
|
||||
## Allow to accept connections from unauthenticated users
|
||||
##
|
||||
allowAnonymousLogin: true
|
||||
|
||||
autopurge:
|
||||
## Retains the snapRetainCount most recent snapshots and the corresponding transaction logs and deletes the rest
|
||||
##
|
||||
snapRetainCount: 3
|
||||
## The time interval in hours for which the purge task has to be triggered. Set to a positive integer (1 and above) to enable the auto purging.
|
||||
##
|
||||
purgeInterval: 0
|
||||
|
||||
## Maximum session timeout in milliseconds that the server will allow the client to negotiate. Defaults to 20 times the tickTime.
|
||||
##
|
||||
maxSessionTimeout: 40000
|
||||
|
||||
auth:
|
||||
## Use existing secret (ignores previous password)
|
||||
##
|
||||
# existingSecret:
|
||||
## Enable Zookeeper auth. It uses SASL/Digest-MD5
|
||||
##
|
||||
enabled: false
|
||||
## User that will use Zookeeper clients to auth
|
||||
##
|
||||
clientUser:
|
||||
## Password that will use Zookeeper clients to auth
|
||||
##
|
||||
clientPassword:
|
||||
## Comma, semicolon or whitespace separated list of user to be created. Specify them as a string, for example: "user1,user2,admin"
|
||||
##
|
||||
serverUsers:
|
||||
## Comma, semicolon or whitespace separated list of passwords to assign to users when created. Specify them as a string, for example: "pass4user1, pass4user2, pass4admin"
|
||||
##
|
||||
serverPasswords:
|
||||
|
||||
## Size in MB for the Java Heap options (Xmx and XMs). This env var is ignored if Xmx an Xms are configured via JVMFLAGS
|
||||
##
|
||||
heapSize: 1024
|
||||
|
||||
## Log level for the Zookeeper server. ERROR by default. Have in mind if you set it to INFO or WARN the ReadinessProve will produce a lot of logs.
|
||||
##
|
||||
logLevel: ERROR
|
||||
|
||||
## Data log directory. Specifying this option will direct zookeeper to write the transaction log to the dataLogDir rather than the dataDir.
|
||||
## This allows a dedicated log device to be used, and helps avoid competition between logging and snaphots.
|
||||
## Example:
|
||||
## dataLogDir: /bitnami/zookeeper/dataLog
|
||||
##
|
||||
dataLogDir: ""
|
||||
|
||||
## Default JVMFLAGS for the ZooKeeper process
|
||||
##
|
||||
# jvmFlags:
|
||||
|
||||
## Configure ZooKeeper with a custom zoo.cfg file
|
||||
##
|
||||
# config:
|
||||
|
||||
## Kubernetes configuration
|
||||
## For minikube, set this to NodePort, elsewhere use LoadBalancer
|
||||
##
|
||||
service:
|
||||
type: ClusterIP
|
||||
port: 2181
|
||||
followerPort: 2888
|
||||
electionPort: 3888
|
||||
publishNotReadyAddresses: true
|
||||
tls:
|
||||
client_enable: false
|
||||
quorum_enable: false
|
||||
disable_base_client_port: false
|
||||
|
||||
client_port: 3181
|
||||
|
||||
client_keystore_path: /tls_key_store/key_store_file
|
||||
client_keystore_password: ""
|
||||
client_truststore_path: /tls_trust_store/trust_store_file
|
||||
client_truststore_password: ""
|
||||
|
||||
quorum_keystore_path: /tls_key_store/key_store_file
|
||||
quorum_keystore_password: ""
|
||||
quorum_truststore_path: /tls_trust_store/trust_store_file
|
||||
quorum_truststore_password: ""
|
||||
annotations: {}
|
||||
headless:
|
||||
annotations: {}
|
||||
|
||||
## Service account for Zookeeper to use.
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/
|
||||
##
|
||||
serviceAccount:
|
||||
## Specifies whether a ServiceAccount should be created
|
||||
##
|
||||
create: false
|
||||
## The name of the ServiceAccount to use.
|
||||
## If not set and create is true, a name is generated using the zookeeper.fullname template
|
||||
# name:
|
||||
|
||||
## Zookeeper Pod Security Context
|
||||
securityContext:
|
||||
enabled: true
|
||||
fsGroup: 1001
|
||||
runAsUser: 1001
|
||||
|
||||
## Zookeeper data Persistent Volume Storage Class
|
||||
## If defined, storageClassName: <storageClass>
|
||||
## If set to "-", storageClassName: "", which disables dynamic provisioning
|
||||
## If undefined (the default) or set to null, no storageClassName spec is
|
||||
## set, choosing the default provisioner. (gp2 on AWS, standard on
|
||||
## GKE, AWS & OpenStack)
|
||||
##
|
||||
persistence:
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
|
||||
enabled: true
|
||||
# storageClass: "-"
|
||||
accessModes:
|
||||
- ReadWriteOnce
|
||||
size: 8Gi
|
||||
annotations: {}
|
||||
dataLogDir:
|
||||
size: 8Gi
|
||||
## A manually managed Persistent Volume and Claim
|
||||
## If defined, PVC must be created manually before volume will be bound
|
||||
## The value is evaluated as a template
|
||||
##
|
||||
# existingClaim:
|
||||
|
||||
|
||||
## Node labels for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/user-guide/node-selection/
|
||||
##
|
||||
nodeSelector: {}
|
||||
|
||||
## Tolerations for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
|
||||
##
|
||||
tolerations: []
|
||||
|
||||
## Labels
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
|
||||
podLabels: {}
|
||||
|
||||
## Annotations
|
||||
## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/
|
||||
podAnnotations: {}
|
||||
|
||||
## Name of the priority class to be used by zookeeper pods, priority class needs to be created beforehand
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/
|
||||
priorityClassName: ""
|
||||
|
||||
## Affinity for pod assignment
|
||||
## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity
|
||||
##
|
||||
affinity: {}
|
||||
|
||||
## Scheduler name
|
||||
## https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/
|
||||
##
|
||||
# schedulerName: stork
|
||||
|
||||
## Configure resource requests and limits
|
||||
## ref: http://kubernetes.io/docs/user-guide/compute-resources/
|
||||
##
|
||||
resources:
|
||||
requests:
|
||||
memory: 256Mi
|
||||
cpu: 250m
|
||||
|
||||
## Configure extra options for liveness and readiness probes
|
||||
## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/#configure-probes)
|
||||
##
|
||||
livenessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
probeCommandTimeout: 2
|
||||
|
||||
readinessProbe:
|
||||
enabled: true
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
successThreshold: 1
|
||||
probeCommandTimeout: 2
|
||||
|
||||
## Network policies
|
||||
## Ref: https://kubernetes.io/docs/concepts/services-networking/network-policies/
|
||||
##
|
||||
networkPolicy:
|
||||
## Specifies whether a NetworkPolicy should be created
|
||||
##
|
||||
enabled: false
|
||||
|
||||
## The Policy model to apply. When set to false, only pods with the correct
|
||||
## client label will have network access to the port Redis is listening
|
||||
## on. When true, zookeeper accept connections from any source
|
||||
## (with the correct destination port).
|
||||
##
|
||||
# allowExternal: true
|
||||
|
||||
## Zookeeper Prometheus Exporter configuration
|
||||
##
|
||||
metrics:
|
||||
enabled: false
|
||||
|
||||
## Zookeeper Prometheus Exporter container port
|
||||
##
|
||||
containerPort: 9141
|
||||
|
||||
## Service configuration
|
||||
##
|
||||
service:
|
||||
## Zookeeper Prometheus Exporter service type
|
||||
##
|
||||
type: ClusterIP
|
||||
## Zookeeper Prometheus Exporter service port
|
||||
##
|
||||
port: 9141
|
||||
## Annotations for the Zookeeper Prometheus Exporter metrics service
|
||||
##
|
||||
annotations:
|
||||
prometheus.io/scrape: "true"
|
||||
prometheus.io/port: "{{ .Values.metrics.service.port }}"
|
||||
prometheus.io/path: "/metrics"
|
||||
|
||||
## Prometheus Operator ServiceMonitor configuration
|
||||
##
|
||||
serviceMonitor:
|
||||
enabled: false
|
||||
## Namespace for the ServiceMonitor Resource (defaults to the Release Namespace)
|
||||
##
|
||||
namespace:
|
||||
|
||||
## Interval at which metrics should be scraped.
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# interval: 10s
|
||||
|
||||
## Timeout after which the scrape is ended
|
||||
## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint
|
||||
##
|
||||
# scrapeTimeout: 10s
|
||||
|
||||
## ServiceMonitor selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
## Prometheus Operator PrometheusRule configuration
|
||||
##
|
||||
prometheusRule:
|
||||
enabled: false
|
||||
## Namespace for the PrometheusRule Resource (defaults to the Release Namespace)
|
||||
##
|
||||
namespace:
|
||||
|
||||
## PrometheusRule selector labels
|
||||
## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration
|
||||
##
|
||||
# selector:
|
||||
# prometheus: my-prometheus
|
||||
|
||||
## Some example rules.
|
||||
rules: []
|
||||
# - alert: ZookeeperSyncedFollowers
|
||||
# annotations:
|
||||
# message: The number of synced followers for the leader node in Zookeeper deployment my-release is less than 2. This usually means that some of the Zookeeper nodes aren't communicating properly. If it doesn't resolve itself you can try killing the pods (one by one).
|
||||
# expr: max(synced_followers{service="my-release-metrics"}) < 2
|
||||
# for: 5m
|
||||
# labels:
|
||||
# severity: critical
|
||||
# - alert: ZookeeperOutstandingRequests
|
||||
# annotations:
|
||||
# message: The number of outstanding requests for Zookeeper pod {{ $labels.pod }} is greater than 10. This can indicate a performance issue with the Pod or cluster a whole.
|
||||
# expr: outstanding_requests{service="my-release-metrics"} > 10
|
||||
# for: 5m
|
||||
# labels:
|
||||
# severity: critical
|
||||
|
|
@ -1,10 +0,0 @@
|
|||
# Java Key Stores
|
||||
|
||||
You can copy here your Java Key Stores (JKS) files so a secret is created including them. Remember to use a truststore (`kafka.truststore.jks`) and one keystore (`kafka.keystore.jks`) per Kafka broker you have in the cluster. For instance, if you have 3 brokers you need to copy here the following files:
|
||||
|
||||
- kafka.truststore.jks
|
||||
- kafka-0.keystore.jks
|
||||
- kafka-1.keystore.jks
|
||||
- kafka-2.keystore.jks
|
||||
|
||||
Find more info in [this section](https://github.com/bitnami/charts/tree/master/bitnami/kafka#enable-security-for-kafka-and-zookeeper) of the README.md file.
|
||||
|
|
@ -1,521 +0,0 @@
|
|||
---
|
||||
# Source: kafka/templates/serviceaccount.yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: kafka
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
---
|
||||
# Source: kafka/templates/scripts-configmap.yaml
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: kafka-scripts
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
data:
|
||||
setup.sh: |-
|
||||
#!/bin/bash
|
||||
|
||||
ID="${MY_POD_NAME#"kafka-"}"
|
||||
export KAFKA_CFG_BROKER_ID="$ID"
|
||||
|
||||
exec /entrypoint.sh /run.sh
|
||||
---
|
||||
# Source: kafka/charts/zookeeper/templates/svc-headless.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-zookeeper-headless
|
||||
namespace: db
|
||||
labels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
helm.sh/chart: zookeeper-5.21.9
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: zookeeper
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
publishNotReadyAddresses: true
|
||||
ports:
|
||||
|
||||
- name: tcp-client
|
||||
port: 2181
|
||||
targetPort: client
|
||||
|
||||
|
||||
- name: follower
|
||||
port: 2888
|
||||
targetPort: follower
|
||||
- name: tcp-election
|
||||
port: 3888
|
||||
targetPort: election
|
||||
selector:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: zookeeper
|
||||
---
|
||||
# Source: kafka/charts/zookeeper/templates/svc.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-zookeeper
|
||||
namespace: db
|
||||
labels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
helm.sh/chart: zookeeper-5.21.9
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: zookeeper
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
|
||||
- name: tcp-client
|
||||
port: 2181
|
||||
targetPort: client
|
||||
|
||||
|
||||
- name: follower
|
||||
port: 2888
|
||||
targetPort: follower
|
||||
- name: tcp-election
|
||||
port: 3888
|
||||
targetPort: election
|
||||
selector:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: zookeeper
|
||||
---
|
||||
# Source: kafka/templates/kafka-metrics-svc.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-metrics
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: metrics
|
||||
annotations:
|
||||
|
||||
prometheus.io/path: /metrics
|
||||
prometheus.io/port: '9308'
|
||||
prometheus.io/scrape: "true"
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: 9308
|
||||
protocol: TCP
|
||||
targetPort: metrics
|
||||
nodePort: null
|
||||
selector:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: metrics
|
||||
---
|
||||
# Source: kafka/templates/svc-headless.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka-headless
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
spec:
|
||||
type: ClusterIP
|
||||
clusterIP: None
|
||||
ports:
|
||||
- name: tcp-client
|
||||
port: 9092
|
||||
protocol: TCP
|
||||
targetPort: kafka-client
|
||||
- name: tcp-internal
|
||||
port: 9093
|
||||
protocol: TCP
|
||||
targetPort: kafka-internal
|
||||
selector:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: kafka
|
||||
---
|
||||
# Source: kafka/templates/svc.yaml
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: kafka
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
- name: tcp-client
|
||||
port: 9092
|
||||
protocol: TCP
|
||||
targetPort: kafka-client
|
||||
nodePort: null
|
||||
selector:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: kafka
|
||||
---
|
||||
# Source: kafka/templates/kafka-metrics-deployment.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kafka-exporter
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: metrics
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: metrics
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: metrics
|
||||
spec:
|
||||
containers:
|
||||
- name: kafka-exporter
|
||||
image: docker.io/bitnami/kafka-exporter:1.2.0-debian-10-r220
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
read -r -a sasl_passwords <<< "$(tr ',;' ' ' <<< "${SASL_USER_PASSWORD}")"
|
||||
kafka_exporter \
|
||||
--kafka.server=kafka-0.kafka-headless.db.svc.cluster.local:9092 \
|
||||
--kafka.server=kafka-1.kafka-headless.db.svc.cluster.local:9092 \
|
||||
--web.listen-address=:9308
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9308
|
||||
resources:
|
||||
limits: {}
|
||||
requests: {}
|
||||
---
|
||||
# Source: kafka/charts/zookeeper/templates/statefulset.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: kafka-zookeeper
|
||||
namespace: db
|
||||
labels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
helm.sh/chart: zookeeper-5.21.9
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: zookeeper
|
||||
role: zookeeper
|
||||
spec:
|
||||
serviceName: kafka-zookeeper-headless
|
||||
replicas: 1
|
||||
podManagementPolicy: Parallel
|
||||
updateStrategy:
|
||||
type: RollingUpdate
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: zookeeper
|
||||
template:
|
||||
metadata:
|
||||
name: kafka-zookeeper
|
||||
labels:
|
||||
app.kubernetes.io/name: zookeeper
|
||||
helm.sh/chart: zookeeper-5.21.9
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: zookeeper
|
||||
spec:
|
||||
|
||||
serviceAccountName: default
|
||||
securityContext:
|
||||
fsGroup: 1001
|
||||
containers:
|
||||
- name: zookeeper
|
||||
image: docker.io/bitnami/zookeeper:3.6.2-debian-10-r10
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
securityContext:
|
||||
runAsUser: 1001
|
||||
command:
|
||||
- bash
|
||||
- -ec
|
||||
- |
|
||||
# Execute entrypoint as usual after obtaining ZOO_SERVER_ID based on POD hostname
|
||||
HOSTNAME=`hostname -s`
|
||||
if [[ $HOSTNAME =~ (.*)-([0-9]+)$ ]]; then
|
||||
ORD=${BASH_REMATCH[2]}
|
||||
export ZOO_SERVER_ID=$((ORD+1))
|
||||
else
|
||||
echo "Failed to get index from hostname $HOST"
|
||||
exit 1
|
||||
fi
|
||||
exec /entrypoint.sh /run.sh
|
||||
resources:
|
||||
requests:
|
||||
cpu: 250m
|
||||
memory: 256Mi
|
||||
env:
|
||||
- name: ZOO_DATA_LOG_DIR
|
||||
value: ""
|
||||
- name: ZOO_PORT_NUMBER
|
||||
value: "2181"
|
||||
- name: ZOO_TICK_TIME
|
||||
value: "2000"
|
||||
- name: ZOO_INIT_LIMIT
|
||||
value: "10"
|
||||
- name: ZOO_SYNC_LIMIT
|
||||
value: "5"
|
||||
- name: ZOO_MAX_CLIENT_CNXNS
|
||||
value: "60"
|
||||
- name: ZOO_4LW_COMMANDS_WHITELIST
|
||||
value: "srvr, mntr, ruok"
|
||||
- name: ZOO_LISTEN_ALLIPS_ENABLED
|
||||
value: "no"
|
||||
- name: ZOO_AUTOPURGE_INTERVAL
|
||||
value: "0"
|
||||
- name: ZOO_AUTOPURGE_RETAIN_COUNT
|
||||
value: "3"
|
||||
- name: ZOO_MAX_SESSION_TIMEOUT
|
||||
value: "40000"
|
||||
- name: ZOO_SERVERS
|
||||
value: kafka-zookeeper-0.kafka-zookeeper-headless.db.svc.cluster.local:2888:3888
|
||||
- name: ZOO_ENABLE_AUTH
|
||||
value: "no"
|
||||
- name: ZOO_HEAP_SIZE
|
||||
value: "1024"
|
||||
- name: ZOO_LOG_LEVEL
|
||||
value: "ERROR"
|
||||
- name: ALLOW_ANONYMOUS_LOGIN
|
||||
value: "yes"
|
||||
- name: POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: metadata.name
|
||||
ports:
|
||||
|
||||
- name: client
|
||||
containerPort: 2181
|
||||
|
||||
|
||||
- name: follower
|
||||
containerPort: 2888
|
||||
- name: election
|
||||
containerPort: 3888
|
||||
livenessProbe:
|
||||
exec:
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok']
|
||||
initialDelaySeconds: 30
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
successThreshold: 1
|
||||
failureThreshold: 6
|
||||
readinessProbe:
|
||||
exec:
|
||||
command: ['/bin/bash', '-c', 'echo "ruok" | timeout 2 nc -w 2 localhost 2181 | grep imok']
|
||||
initialDelaySeconds: 5
|
||||
periodSeconds: 10
|
||||
timeoutSeconds: 5
|
||||
successThreshold: 1
|
||||
failureThreshold: 6
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/zookeeper
|
||||
volumes:
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
annotations:
|
||||
spec:
|
||||
accessModes:
|
||||
- "ReadWriteOnce"
|
||||
resources:
|
||||
requests:
|
||||
storage: "8Gi"
|
||||
---
|
||||
# Source: kafka/templates/statefulset.yaml
|
||||
apiVersion: apps/v1
|
||||
kind: StatefulSet
|
||||
metadata:
|
||||
name: kafka
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
spec:
|
||||
podManagementPolicy: Parallel
|
||||
replicas: 2
|
||||
selector:
|
||||
matchLabels:
|
||||
app.kubernetes.io/name: kafka
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/component: kafka
|
||||
serviceName: kafka-headless
|
||||
updateStrategy:
|
||||
type: "RollingUpdate"
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
app.kubernetes.io/name: kafka
|
||||
helm.sh/chart: kafka-11.8.6
|
||||
app.kubernetes.io/instance: kafka
|
||||
app.kubernetes.io/managed-by: Helm
|
||||
app.kubernetes.io/component: kafka
|
||||
spec:
|
||||
securityContext:
|
||||
fsGroup: 1001
|
||||
runAsUser: 1001
|
||||
serviceAccountName: kafka
|
||||
containers:
|
||||
- name: kafka
|
||||
image: docker.io/bitnami/kafka:2.6.0-debian-10-r30
|
||||
imagePullPolicy: "IfNotPresent"
|
||||
command:
|
||||
- /scripts/setup.sh
|
||||
env:
|
||||
- name: BITNAMI_DEBUG
|
||||
value: "false"
|
||||
- name: MY_POD_IP
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: status.podIP
|
||||
- name: MY_POD_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
fieldPath: metadata.name
|
||||
- name: KAFKA_CFG_ZOOKEEPER_CONNECT
|
||||
value: "kafka-zookeeper"
|
||||
- name: KAFKA_INTER_BROKER_LISTENER_NAME
|
||||
value: "INTERNAL"
|
||||
- name: KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP
|
||||
value: "INTERNAL:PLAINTEXT,CLIENT:PLAINTEXT"
|
||||
- name: KAFKA_CFG_LISTENERS
|
||||
value: "INTERNAL://:9093,CLIENT://:9092"
|
||||
- name: KAFKA_CFG_ADVERTISED_LISTENERS
|
||||
value: "INTERNAL://$(MY_POD_NAME).kafka-headless.db.svc.cluster.local:9093,CLIENT://$(MY_POD_NAME).kafka-headless.db.svc.cluster.local:9092"
|
||||
- name: ALLOW_PLAINTEXT_LISTENER
|
||||
value: "yes"
|
||||
- name: KAFKA_CFG_DELETE_TOPIC_ENABLE
|
||||
value: "false"
|
||||
- name: KAFKA_CFG_AUTO_CREATE_TOPICS_ENABLE
|
||||
value: "true"
|
||||
- name: KAFKA_HEAP_OPTS
|
||||
value: "-Xmx1024m -Xms1024m"
|
||||
- name: KAFKA_CFG_LOG_FLUSH_INTERVAL_MESSAGES
|
||||
value: "10000"
|
||||
- name: KAFKA_CFG_LOG_FLUSH_INTERVAL_MS
|
||||
value: "1000"
|
||||
- name: KAFKA_CFG_LOG_RETENTION_BYTES
|
||||
value: "1073741824"
|
||||
- name: KAFKA_CFG_LOG_RETENTION_CHECK_INTERVALS_MS
|
||||
value: "300000"
|
||||
- name: KAFKA_CFG_LOG_RETENTION_HOURS
|
||||
value: "168"
|
||||
- name: KAFKA_CFG_MESSAGE_MAX_BYTES
|
||||
value: "1000012"
|
||||
- name: KAFKA_CFG_LOG_SEGMENT_BYTES
|
||||
value: "1073741824"
|
||||
- name: KAFKA_CFG_LOG_DIRS
|
||||
value: "/bitnami/kafka/data"
|
||||
- name: KAFKA_CFG_DEFAULT_REPLICATION_FACTOR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_TRANSACTION_STATE_LOG_REPLICATION_FACTOR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_NUM_IO_THREADS
|
||||
value: "8"
|
||||
- name: KAFKA_CFG_NUM_NETWORK_THREADS
|
||||
value: "3"
|
||||
- name: KAFKA_CFG_NUM_PARTITIONS
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_NUM_RECOVERY_THREADS_PER_DATA_DIR
|
||||
value: "1"
|
||||
- name: KAFKA_CFG_SOCKET_RECEIVE_BUFFER_BYTES
|
||||
value: "102400"
|
||||
- name: KAFKA_CFG_SOCKET_REQUEST_MAX_BYTES
|
||||
value: "104857600"
|
||||
- name: KAFKA_CFG_SOCKET_SEND_BUFFER_BYTES
|
||||
value: "102400"
|
||||
- name: KAFKA_CFG_ZOOKEEPER_CONNECTION_TIMEOUT_MS
|
||||
value: "6000"
|
||||
ports:
|
||||
- name: kafka-client
|
||||
containerPort: 9092
|
||||
- name: kafka-internal
|
||||
containerPort: 9093
|
||||
livenessProbe:
|
||||
tcpSocket:
|
||||
port: kafka-client
|
||||
initialDelaySeconds: 10
|
||||
timeoutSeconds: 5
|
||||
failureThreshold:
|
||||
periodSeconds:
|
||||
successThreshold:
|
||||
readinessProbe:
|
||||
tcpSocket:
|
||||
port: kafka-client
|
||||
initialDelaySeconds: 5
|
||||
timeoutSeconds: 5
|
||||
failureThreshold: 6
|
||||
periodSeconds:
|
||||
successThreshold:
|
||||
resources:
|
||||
limits: {}
|
||||
requests: {}
|
||||
volumeMounts:
|
||||
- name: data
|
||||
mountPath: /bitnami/kafka
|
||||
- name: scripts
|
||||
mountPath: /scripts/setup.sh
|
||||
subPath: setup.sh
|
||||
volumes:
|
||||
- name: scripts
|
||||
configMap:
|
||||
name: kafka-scripts
|
||||
defaultMode: 0755
|
||||
volumeClaimTemplates:
|
||||
- metadata:
|
||||
name: data
|
||||
spec:
|
||||
accessModes:
|
||||
- "ReadWriteOnce"
|
||||
resources:
|
||||
requests:
|
||||
storage: "8Gi"
|
||||
|
|
@ -1,6 +0,0 @@
|
|||
dependencies:
|
||||
- name: zookeeper
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
version: 5.21.9
|
||||
digest: sha256:2f3c43ce02e3966648b8c89be121fe39537f62ea1d161ad908f51ddc90e4243e
|
||||
generated: "2020-09-29T07:43:56.483358254Z"
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
dependencies:
|
||||
- name: zookeeper
|
||||
version: 5.x.x
|
||||
repository: https://charts.bitnami.com/bitnami
|
||||
condition: zookeeper.enabled
|
||||
|
|
@ -1,181 +0,0 @@
|
|||
{{- $replicaCount := int .Values.replicaCount -}}
|
||||
{{- $releaseNamespace := .Release.Namespace -}}
|
||||
{{- $clusterDomain := .Values.clusterDomain -}}
|
||||
{{- $fullname := include "kafka.fullname" . -}}
|
||||
{{- $clientProtocol := include "kafka.listenerType" ( dict "protocol" .Values.auth.clientProtocol ) -}}
|
||||
{{- $servicePort := int .Values.service.port -}}
|
||||
{{- $loadBalancerIPListLength := len .Values.externalAccess.service.loadBalancerIPs -}}
|
||||
{{- if and .Values.externalAccess.enabled (not .Values.externalAccess.autoDiscovery.enabled) (not (eq $replicaCount $loadBalancerIPListLength )) (eq .Values.externalAccess.service.type "LoadBalancer") }}
|
||||
|
||||
###############################################################################
|
||||
### ERROR: You enabled external access to Kafka brokers without specifying ###
|
||||
### the array of load balancer IPs for Kafka brokers. ###
|
||||
###############################################################################
|
||||
|
||||
This deployment will be incomplete until you configure the array of load balancer
|
||||
IPs for Kafka brokers. To complete your deployment follow the steps below:
|
||||
|
||||
1. Wait for the load balancer IPs (it may take a few minutes for them to be available):
|
||||
|
||||
kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka,pod" -w
|
||||
|
||||
2. Obtain the load balancer IPs and upgrade your chart:
|
||||
|
||||
{{- range $i, $e := until $replicaCount }}
|
||||
LOAD_BALANCER_IP_{{ add $i 1 }}="$(kubectl get svc --namespace {{ $releaseNamespace }} {{ $fullname }}-{{ $i }}-external -o jsonpath='{.status.loadBalancer.ingress[0].ip}')"
|
||||
{{- end }}
|
||||
|
||||
3. Upgrade you chart:
|
||||
|
||||
helm upgrade {{ .Release.Name }} bitnami/{{ .Chart.Name }} \
|
||||
--set replicaCount={{ $replicaCount }} \
|
||||
--set externalAccess.enabled=true \
|
||||
{{- range $i, $e := until $replicaCount }}
|
||||
--set externalAccess.service.loadBalancerIPs[{{ $i }}]=$LOAD_BALANCER_IP_{{ add $i 1 }} \
|
||||
{{- end }}
|
||||
--set externalAccess.service.type=LoadBalancer
|
||||
|
||||
{{- else }}
|
||||
|
||||
{{- if and (or (eq .Values.service.type "LoadBalancer") .Values.externalAccess.enabled) (eq .Values.auth.clientProtocol "plaintext") }}
|
||||
---------------------------------------------------------------------------------------------
|
||||
WARNING
|
||||
|
||||
By specifying "serviceType=LoadBalancer" and not configuring the authentication
|
||||
you have most likely exposed the Kafka service externally without any
|
||||
authentication mechanism.
|
||||
|
||||
For security reasons, we strongly suggest that you switch to "ClusterIP" or
|
||||
"NodePort". As alternative, you can also configure the Kafka authentication.
|
||||
|
||||
---------------------------------------------------------------------------------------------
|
||||
{{- end }}
|
||||
|
||||
** Please be patient while the chart is being deployed **
|
||||
|
||||
Kafka can be accessed by consumers via port {{ $servicePort }} on the following DNS name from within your cluster:
|
||||
|
||||
{{ $fullname }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}
|
||||
|
||||
Each Kafka broker can be accessed by producers via port {{ $servicePort }} on the following DNS name(s) from within your cluster:
|
||||
|
||||
{{- $brokerList := list }}
|
||||
{{- range $e, $i := until $replicaCount }}
|
||||
{{- $brokerList = append $brokerList (printf "%s-%d.%s-headless.%s.svc.%s:%d" $fullname $i $fullname $releaseNamespace $clusterDomain $servicePort) }}
|
||||
{{- end }}
|
||||
{{ join "\n" $brokerList | nindent 4 }}
|
||||
|
||||
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
|
||||
You need to configure your Kafka client to access using SASL authentication. To do so, you need to create the 'kafka_jaas.conf' and 'client.properties' configuration files by executing these commands:
|
||||
|
||||
- kafka_jaas.conf:
|
||||
|
||||
cat > kafka_jaas.conf <<EOF
|
||||
KafkaClient {
|
||||
{{- if .Values.auth.saslMechanisms | regexFind "scram" }}
|
||||
org.apache.kafka.common.security.scram.ScramLoginModule required
|
||||
{{- else }}
|
||||
org.apache.kafka.common.security.plain.PlainLoginModule required
|
||||
{{- end }}
|
||||
username="{{ index .Values.auth.jaas.clientUsers 0 }}"
|
||||
password="$(kubectl get secret {{ $fullname }}-jaas -n {{ $releaseNamespace }} -o jsonpath='{.data.client-passwords}' | base64 --decode | cut -d , -f 1)";
|
||||
};
|
||||
EOF
|
||||
|
||||
- client.properties:
|
||||
|
||||
cat > client.properties <<EOF
|
||||
security.protocol={{ $clientProtocol }}
|
||||
{{- if .Values.auth.saslMechanisms | regexFind "scram-sha-256" }}
|
||||
sasl.mechanism=SCRAM-SHA-256
|
||||
{{- else if .Values.auth.saslMechanisms | regexFind "scram-sha-512" }}
|
||||
sasl.mechanism=SCRAM-SHA-512
|
||||
{{- else -}}
|
||||
sasl.mechanism=PLAIN
|
||||
{{- end }}
|
||||
{{- if eq .Values.auth.clientProtocol "sasl_tls" }}
|
||||
ssl.truststore.location=/tmp/kafka.truststore.jks
|
||||
{{- if .Values.auth.jksPassword }}
|
||||
ssl.truststore.password={{ .Values.auth.jksPassword }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if eq .Values.auth.tlsEndpointIdentificationAlgorithm "" }}
|
||||
ssl.endpoint.identification.algorithm=
|
||||
{{- end }}
|
||||
EOF
|
||||
{{- end }}
|
||||
|
||||
To create a pod that you can use as a Kafka client run the following commands:
|
||||
|
||||
kubectl run {{ $fullname }}-client --restart='Never' --image {{ template "kafka.image" . }} --namespace {{ $releaseNamespace }} --command -- sleep infinity
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
kubectl cp --namespace {{ $releaseNamespace }} /path/to/client.properties {{ $fullname }}-client:/tmp/client.properties
|
||||
kubectl cp --namespace {{ $releaseNamespace }} /path/to/kafka_jaas.conf {{ $fullname }}-client:/tmp/kafka_jaas.conf
|
||||
{{- if eq .Values.auth.clientProtocol "sasl_tls" }}
|
||||
kubectl cp --namespace {{ $releaseNamespace }} ./kafka.truststore.jks {{ $fullname }}-client:/tmp/kafka.truststore.jks
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
kubectl exec --tty -i {{ $fullname }}-client --namespace {{ $releaseNamespace }} -- bash
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
export KAFKA_OPTS="-Djava.security.auth.login.config=/tmp/kafka_jaas.conf"
|
||||
{{- end }}
|
||||
|
||||
PRODUCER:
|
||||
kafka-console-producer.sh \
|
||||
{{ if (include "kafka.client.saslAuthentication" .) }}--producer.config /tmp/client.properties \{{ end }}
|
||||
--broker-list {{ join "," $brokerList }} \
|
||||
--topic test
|
||||
|
||||
CONSUMER:
|
||||
kafka-console-consumer.sh \
|
||||
{{ if (include "kafka.client.saslAuthentication" .) }}--consumer.config /tmp/client.properties \{{ end }}
|
||||
--bootstrap-server {{ $fullname }}.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ .Values.service.port }} \
|
||||
--topic test \
|
||||
--from-beginning
|
||||
|
||||
{{- if .Values.externalAccess.enabled }}
|
||||
|
||||
To connect to your Kafka server from outside the cluster, follow the instructions below:
|
||||
|
||||
{{- if eq "NodePort" .Values.externalAccess.service.type }}
|
||||
{{- if .Values.externalAccess.service.domain }}
|
||||
|
||||
Kafka brokers domain: Use your provided hostname to reach Kafka brokers, {{ .Values.externalAccess.service.domain }}
|
||||
|
||||
{{- else }}
|
||||
|
||||
Kafka brokers domain: You can get the external node IP from the Kafka configuration file with the following commands (Check the EXTERNAL listener)
|
||||
|
||||
1. Obtain the pod name:
|
||||
|
||||
kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka"
|
||||
|
||||
2. Obtain pod configuration:
|
||||
|
||||
kubectl exec -it KAFKA_POD -- cat /opt/bitnami/kafka/config/server.properties | grep advertised.listeners
|
||||
|
||||
{{- end }}
|
||||
|
||||
Kafka brokers port: You will have a different node port for each Kafka broker. You can get the list of configured node ports using the command below:
|
||||
|
||||
echo "$(kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka,pod" -o jsonpath='{.items[*].spec.ports[0].nodePort}' | tr ' ' '\n')"
|
||||
|
||||
{{- else if contains "LoadBalancer" .Values.externalAccess.service.type }}
|
||||
|
||||
NOTE: It may take a few minutes for the LoadBalancer IPs to be available.
|
||||
Watch the status with: 'kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka,pod" -w'
|
||||
|
||||
Kafka Brokers domain: You will have a different external IP for each Kafka broker. You can get the list of external IPs using the command below:
|
||||
|
||||
echo "$(kubectl get svc --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ template "kafka.name" . }},app.kubernetes.io/instance={{ .Release.Name }},app.kubernetes.io/component=kafka,pod" -o jsonpath='{.items[*].status.loadBalancer.ingress[0].ip}' | tr ' ' '\n')"
|
||||
|
||||
Kafka Brokers port: {{ .Values.externalAccess.service.port }}
|
||||
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
||||
{{- include "kafka.checkRollingTags" . }}
|
||||
{{- include "kafka.validateValues" . }}
|
||||
|
|
@ -1,556 +0,0 @@
|
|||
{{/* vim: set filetype=mustache: */}}
|
||||
{{/*
|
||||
Expand the name of the chart.
|
||||
*/}}
|
||||
{{- define "kafka.name" -}}
|
||||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified app name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
If release name contains chart name it will be used as a full name.
|
||||
*/}}
|
||||
{{- define "kafka.fullname" -}}
|
||||
{{- if .Values.fullnameOverride -}}
|
||||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default .Chart.Name .Values.nameOverride -}}
|
||||
{{- if contains $name .Release.Name -}}
|
||||
{{- .Release.Name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create chart name and version as used by the chart label.
|
||||
*/}}
|
||||
{{- define "kafka.chart" -}}
|
||||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Common labels
|
||||
*/}}
|
||||
{{- define "kafka.labels" -}}
|
||||
app.kubernetes.io/name: {{ include "kafka.name" . }}
|
||||
helm.sh/chart: {{ include "kafka.chart" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Labels to use on deploy.spec.selector.matchLabels and svc.spec.selector
|
||||
*/}}
|
||||
{{- define "kafka.matchLabels" -}}
|
||||
app.kubernetes.io/name: {{ include "kafka.name" . }}
|
||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create a default fully qualified zookeeper name.
|
||||
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
|
||||
*/}}
|
||||
{{- define "kafka.zookeeper.fullname" -}}
|
||||
{{- if .Values.zookeeper.fullnameOverride -}}
|
||||
{{- .Values.zookeeper.fullnameOverride | trunc 63 | trimSuffix "-" -}}
|
||||
{{- else -}}
|
||||
{{- $name := default "zookeeper" .Values.zookeeper.nameOverride -}}
|
||||
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Create the name of the service account to use
|
||||
*/}}
|
||||
{{- define "kafka.serviceAccountName" -}}
|
||||
{{- if .Values.serviceAccount.create -}}
|
||||
{{ default (include "kafka.fullname" .) .Values.serviceAccount.name }}
|
||||
{{- else -}}
|
||||
{{ default "default" .Values.serviceAccount.name }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Kafka image name
|
||||
*/}}
|
||||
{{- define "kafka.image" -}}
|
||||
{{- $registryName := .Values.image.registry -}}
|
||||
{{- $repositoryName := .Values.image.repository -}}
|
||||
{{- $tag := .Values.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper image name (for the init container auto-discovery image)
|
||||
*/}}
|
||||
{{- define "kafka.externalAccess.autoDiscovery.image" -}}
|
||||
{{- $registryName := .Values.externalAccess.autoDiscovery.image.registry -}}
|
||||
{{- $repositoryName := .Values.externalAccess.autoDiscovery.image.repository -}}
|
||||
{{- $tag := .Values.externalAccess.autoDiscovery.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 -}}
|
||||
|
||||
{{/*
|
||||
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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Kafka exporter image name
|
||||
*/}}
|
||||
{{- define "kafka.metrics.kafka.image" -}}
|
||||
{{- $registryName := .Values.metrics.kafka.image.registry -}}
|
||||
{{- $repositoryName := .Values.metrics.kafka.image.repository -}}
|
||||
{{- $tag := .Values.metrics.kafka.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper JMX exporter image name
|
||||
*/}}
|
||||
{{- define "kafka.metrics.jmx.image" -}}
|
||||
{{- $registryName := .Values.metrics.jmx.image.registry -}}
|
||||
{{- $repositoryName := .Values.metrics.jmx.image.repository -}}
|
||||
{{- $tag := .Values.metrics.jmx.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 -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Docker Image Registry Secret Names
|
||||
*/}}
|
||||
{{- define "kafka.imagePullSecrets" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
Also, we can not use a single if because lazy evaluation is not an option
|
||||
*/}}
|
||||
{{- if .Values.global }}
|
||||
{{- if .Values.global.imagePullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.global.imagePullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- else if or .Values.image.pullSecrets .Values.externalAccess.autoDiscovery.image.pullSecrets .Values.volumePermissions.image.pullSecrets .Values.metrics.kafka.image.pullSecrets .Values.metrics.jmx.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.externalAccess.autoDiscovery.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumePermissions.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.metrics.kafka.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.metrics.jmx.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- else if or .Values.image.pullSecrets .Values.externalAccess.autoDiscovery.image.pullSecrets .Values.volumePermissions.image.pullSecrets .Values.metrics.kafka.image.pullSecrets .Values.metrics.jmx.image.pullSecrets }}
|
||||
imagePullSecrets:
|
||||
{{- range .Values.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.externalAccess.autoDiscovery.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.volumePermissions.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.metrics.kafka.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- range .Values.metrics.jmx.image.pullSecrets }}
|
||||
- name: {{ . }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the proper Storage Class
|
||||
*/}}
|
||||
{{- define "kafka.storageClass" -}}
|
||||
{{/*
|
||||
Helm 2.11 supports the assignment of a value to a variable defined in a different scope,
|
||||
but Helm 2.9 and 2.10 does not support it, so we need to implement this if-else logic.
|
||||
*/}}
|
||||
{{- if .Values.global -}}
|
||||
{{- if .Values.global.storageClass -}}
|
||||
{{- if (eq "-" .Values.global.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.global.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- else -}}
|
||||
{{- if .Values.persistence.storageClass -}}
|
||||
{{- if (eq "-" .Values.persistence.storageClass) -}}
|
||||
{{- printf "storageClassName: \"\"" -}}
|
||||
{{- else }}
|
||||
{{- printf "storageClassName: %s" .Values.persistence.storageClass -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if authentication via SASL should be configured for client communications
|
||||
*/}}
|
||||
{{- define "kafka.client.saslAuthentication" -}}
|
||||
{{- $saslProtocols := list "sasl" "sasl_tls" -}}
|
||||
{{- if has .Values.auth.clientProtocol $saslProtocols -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if authentication via SASL should be configured for inter-broker communications
|
||||
*/}}
|
||||
{{- define "kafka.interBroker.saslAuthentication" -}}
|
||||
{{- $saslProtocols := list "sasl" "sasl_tls" -}}
|
||||
{{- if has .Values.auth.interBrokerProtocol $saslProtocols -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if encryption via TLS should be configured
|
||||
*/}}
|
||||
{{- define "kafka.tlsEncryption" -}}
|
||||
{{- $tlsProtocols := list "tls" "mtls" "sasl_tls" -}}
|
||||
{{- if or (has .Values.auth.clientProtocol $tlsProtocols) (has .Values.auth.interBrokerProtocol $tlsProtocols) -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the type of listener
|
||||
Usage:
|
||||
{{ include "kafka.listenerType" ( dict "protocol" .Values.path.to.the.Value ) }}
|
||||
*/}}
|
||||
{{- define "kafka.listenerType" -}}
|
||||
{{- if eq .protocol "plaintext" -}}
|
||||
PLAINTEXT
|
||||
{{- else if or (eq .protocol "tls") (eq .protocol "mtls") -}}
|
||||
SSL
|
||||
{{- else if eq .protocol "sasl_tls" -}}
|
||||
SASL_SSL
|
||||
{{- else if eq .protocol "sasl" -}}
|
||||
SASL_PLAINTEXT
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the SASL type
|
||||
Usage:
|
||||
{{ include "kafka.auth.saslMechanisms" ( dict "type" .Values.path.to.the.Value ) }}
|
||||
*/}}
|
||||
{{- define "kafka.auth.saslMechanisms" -}}
|
||||
{{- $mechanisms := list -}}
|
||||
{{- if .type | regexFind "plain" -}}
|
||||
{{- $mechanisms = append $mechanisms "PLAIN" -}}
|
||||
{{- end -}}
|
||||
{{- if .type | regexFind "scram-sha-256" -}}
|
||||
{{- $mechanisms = append $mechanisms "SCRAM-SHA-256" -}}
|
||||
{{- end -}}
|
||||
{{- if .type | regexFind "scram-sha-512" -}}
|
||||
{{- $mechanisms = append $mechanisms "SCRAM-SHA-512" -}}
|
||||
{{- end -}}
|
||||
{{- $mechanisms = join "," $mechanisms -}}
|
||||
{{- printf "%s" $mechanisms -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka JAAS credentials secret
|
||||
*/}}
|
||||
{{- define "kafka.jaasSecretName" -}}
|
||||
{{- if .Values.auth.jaas.existingSecret -}}
|
||||
{{- printf "%s" (tpl .Values.auth.jaas.existingSecret $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-jaas" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a JAAS credentials secret object should be created
|
||||
*/}}
|
||||
{{- define "kafka.createJaasSecret" -}}
|
||||
{{- if and (or (include "kafka.client.saslAuthentication" .) (include "kafka.interBroker.saslAuthentication" .) .Values.auth.jaas.zookeeperUser) (not .Values.auth.jaas.existingSecret) -}}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka JKS credentials secret
|
||||
*/}}
|
||||
{{- define "kafka.jksSecretName" -}}
|
||||
{{- if .Values.auth.jksSecret -}}
|
||||
{{- printf "%s" (tpl .Values.auth.jksSecret $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-jks" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a JAAS credentials secret object should be created
|
||||
*/}}
|
||||
{{- define "kafka.createJksSecret" -}}
|
||||
{{- if and (.Files.Glob "files/jks/*.jks") (not .Values.auth.jksSecret) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka configuration configmap
|
||||
*/}}
|
||||
{{- define "kafka.configmapName" -}}
|
||||
{{- if .Values.existingConfigmap -}}
|
||||
{{- printf "%s" (tpl .Values.existingConfigmap $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-configuration" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a configmap object should be created
|
||||
*/}}
|
||||
{{- define "kafka.createConfigmap" -}}
|
||||
{{- if and .Values.config (not .Values.existingConfigmap) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka log4j ConfigMap name.
|
||||
*/}}
|
||||
{{- define "kafka.log4j.configMapName" -}}
|
||||
{{- if .Values.existingLog4jConfigMap -}}
|
||||
{{- printf "%s" (tpl .Values.existingLog4jConfigMap $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-log4j-configuration" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a log4j ConfigMap object should be created.
|
||||
*/}}
|
||||
{{- define "kafka.log4j.createConfigMap" -}}
|
||||
{{- if and .Values.log4j (not .Values.existingLog4jConfigMap) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return the Kafka configuration configmap
|
||||
*/}}
|
||||
{{- define "kafka.metrics.jmx.configmapName" -}}
|
||||
{{- if .Values.metrics.jmx.existingConfigmap -}}
|
||||
{{- printf "%s" (tpl .Values.metrics.jmx.existingConfigmap $) -}}
|
||||
{{- else -}}
|
||||
{{- printf "%s-jmx-configuration" (include "kafka.fullname" .) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Return true if a configmap object should be created
|
||||
*/}}
|
||||
{{- define "kafka.metrics.jmx.createConfigmap" -}}
|
||||
{{- if and .Values.metrics.jmx.enabled .Values.metrics.jmx.config (not .Values.metrics.jmx.existingConfigmap) }}
|
||||
{{- true -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Renders a value that contains template.
|
||||
Usage:
|
||||
{{ include "kafka.tplValue" ( dict "value" .Values.path.to.the.Value "context" $) }}
|
||||
*/}}
|
||||
{{- define "kafka.tplValue" -}}
|
||||
{{- if typeIs "string" .value }}
|
||||
{{- tpl .value .context }}
|
||||
{{- else }}
|
||||
{{- tpl (.value | toYaml) .context }}
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Check if there are rolling tags in the images
|
||||
*/}}
|
||||
{{- define "kafka.checkRollingTags" -}}
|
||||
{{- if and (contains "bitnami/" .Values.image.repository) (not (.Values.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.image.repository }}:{{ .Values.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- if and (contains "bitnami/" .Values.externalAccess.autoDiscovery.image.repository) (not (.Values.externalAccess.autoDiscovery.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.externalAccess.autoDiscovery.image.repository }}:{{ .Values.externalAccess.autoDiscovery.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- if and (contains "bitnami/" .Values.metrics.kafka.image.repository) (not (.Values.metrics.kafka.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.metrics.kafka.image.repository }}:{{ .Values.metrics.kafka.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- if and (contains "bitnami/" .Values.metrics.jmx.image.repository) (not (.Values.metrics.jmx.image.tag | toString | regexFind "-r\\d+$|sha256:")) }}
|
||||
WARNING: Rolling tag detected ({{ .Values.metrics.jmx.image.repository }}:{{ .Values.metrics.jmx.image.tag }}), please note that it is strongly recommended to avoid using rolling tags in a production environment.
|
||||
+info https://docs.bitnami.com/containers/how-to/understand-rolling-tags-containers/
|
||||
{{- end }}
|
||||
{{- end -}}
|
||||
|
||||
{{/*
|
||||
Compile all warnings into a single message, and call fail.
|
||||
*/}}
|
||||
{{- define "kafka.validateValues" -}}
|
||||
{{- $messages := list -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.authProtocols" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.nodePortListLength" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.externalAccessServiceType" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.externalAccessAutoDiscoveryRBAC" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.jksSecret" .) -}}
|
||||
{{- $messages := append $messages (include "kafka.validateValues.saslMechanisms" .) -}}
|
||||
{{- $messages := without $messages "" -}}
|
||||
{{- $message := join "\n" $messages -}}
|
||||
|
||||
{{- if $message -}}
|
||||
{{- printf "\nVALUES VALIDATION:\n%s" $message | fail -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - Authentication protocols for Kafka */}}
|
||||
{{- define "kafka.validateValues.authProtocols" -}}
|
||||
{{- $authProtocols := list "plaintext" "tls" "mtls" "sasl" "sasl_tls" -}}
|
||||
{{- if or (not (has .Values.auth.clientProtocol $authProtocols)) (not (has .Values.auth.interBrokerProtocol $authProtocols)) -}}
|
||||
kafka: auth.clientProtocol auth.interBrokerProtocol
|
||||
Available authentication protocols are "plaintext", "tls", "mtls", "sasl" and "sasl_tls"
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - number of replicas must be the same than NodePort list */}}
|
||||
{{- define "kafka.validateValues.nodePortListLength" -}}
|
||||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- $nodePortListLength := len .Values.externalAccess.service.nodePorts }}
|
||||
{{- if and .Values.externalAccess.enabled (not .Values.externalAccess.autoDiscovery.enabled) (not (eq $replicaCount $nodePortListLength )) (eq .Values.externalAccess.service.type "NodePort") -}}
|
||||
kafka: .Values.externalAccess.service.nodePorts
|
||||
Number of replicas and nodePort array length must be the same. Currently: replicaCount = {{ $replicaCount }} and nodePorts = {{ $nodePortListLength }}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - service type for external access */}}
|
||||
{{- define "kafka.validateValues.externalAccessServiceType" -}}
|
||||
{{- if and (not (eq .Values.externalAccess.service.type "NodePort")) (not (eq .Values.externalAccess.service.type "LoadBalancer")) -}}
|
||||
kafka: externalAccess.service.type
|
||||
Available servive type for external access are NodePort or LoadBalancer.
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - RBAC should be enabled when autoDiscovery is enabled */}}
|
||||
{{- define "kafka.validateValues.externalAccessAutoDiscoveryRBAC" -}}
|
||||
{{- if and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled (not .Values.rbac.create )}}
|
||||
kafka: rbac.create
|
||||
By specifying "externalAccess.enabled=true" and "externalAccess.autoDiscovery.enabled=true"
|
||||
an initContainer will be used to autodetect the external IPs/ports by querying the
|
||||
K8s API. Please note this initContainer requires specific RBAC resources. You can create them
|
||||
by specifying "--set rbac.create=true".
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - A secret containing JKS files must be provided when TLS authentication is enabled */}}
|
||||
{{- define "kafka.validateValues.jksSecret" -}}
|
||||
{{- if and (include "kafka.tlsEncryption" .) (not .Values.auth.jksSecret) (not (.Files.Glob "files/jks/*.jks")) }}
|
||||
kafka: auth.jksSecret
|
||||
A secret containing the Kafka JKS files is required when TLS encryption in enabled
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{/* Validate values of Kafka - SASL mechanisms must be provided when using SASL */}}
|
||||
{{- define "kafka.validateValues.saslMechanisms" -}}
|
||||
{{- if and (or (.Values.auth.clientProtocol | regexFind "sasl") (.Values.auth.interBrokerProtocol | regexFind "sasl") .Values.auth.jaas.zookeeperUser) (not .Values.auth.saslMechanisms) }}
|
||||
kafka: auth.saslMechanisms
|
||||
The SASL mechanisms are required when either auth.clientProtocol or auth.interBrokerProtocol use SASL or Zookeeper user is provided.
|
||||
{{- end }}
|
||||
{{- if not (contains .Values.auth.saslInterBrokerMechanism .Values.auth.saslMechanisms) }}
|
||||
kafka: auth.saslMechanisms
|
||||
auth.saslInterBrokerMechanism must be provided and it should be one of the specified mechanisms at auth.saslMechanisms
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{{- if (include "kafka.createConfigmap" .) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-configuration
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
server.properties: |-
|
||||
{{ .Values.config | nindent 4 }}
|
||||
{{- end -}}
|
||||
|
|
@ -1,5 +0,0 @@
|
|||
{{- if .Values.extraDeploy }}
|
||||
apiVersion: v1
|
||||
kind: List
|
||||
items: {{- include "kafka.tplValue" (dict "value" .Values.extraDeploy "context" $) | nindent 2 }}
|
||||
{{- end }}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
{{- if (include "kafka.createJaasSecret" .) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-jaas
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
{{- if .Values.auth.jaas.clientPasswords }}
|
||||
client-passwords: {{ join "," .Values.auth.jaas.clientPasswords | b64enc | quote }}
|
||||
{{- else }}
|
||||
{{- $passwords := list }}
|
||||
{{- range .Values.auth.jaas.clientUsers }}
|
||||
{{- $passwords = append $passwords (randAlphaNum 10) }}
|
||||
{{- end }}
|
||||
client-passwords: {{ join "," $passwords | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.auth.jaas.zookeeperUser }}
|
||||
zookeeper-password: {{ ternary (randAlphaNum 10) .Values.auth.jaas.zookeeperPassword (empty .Values.auth.jaas.zookeeperPassword) | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- if (include "kafka.interBroker.saslAuthentication" .) }}
|
||||
inter-broker-password: {{ ternary (randAlphaNum 10) .Values.auth.jaas.interBrokerPassword (empty .Values.auth.jaas.interBrokerPassword) | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,19 +0,0 @@
|
|||
{{- if (include "kafka.createJksSecret" .) }}
|
||||
apiVersion: v1
|
||||
kind: Secret
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-jks
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
type: Opaque
|
||||
data:
|
||||
{{- $root := . }}
|
||||
{{- range $path, $bytes := .Files.Glob "files/jks/*.jks" }}
|
||||
{{ base $path }}: {{ $root.Files.Get $path | b64enc | quote }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,59 +0,0 @@
|
|||
{{- if (include "kafka.metrics.jmx.createConfigmap" .) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-jmx-configuration
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
jmx-kafka-prometheus.yml: |-
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.metrics.jmx.config "context" $ ) | nindent 4 }}
|
||||
rules:
|
||||
- pattern: kafka.controller<type=(ControllerChannelManager), name=(QueueSize), broker-id=(\d+)><>(Value)
|
||||
name: kafka_controller_$1_$2_$4
|
||||
labels:
|
||||
broker_id: "$3"
|
||||
- pattern: kafka.controller<type=(ControllerChannelManager), name=(TotalQueueSize)><>(Value)
|
||||
name: kafka_controller_$1_$2_$3
|
||||
- pattern: kafka.controller<type=(KafkaController), name=(.+)><>(Value)
|
||||
name: kafka_controller_$1_$2_$3
|
||||
- pattern: kafka.controller<type=(ControllerStats), name=(.+)><>(Count)
|
||||
name: kafka_controller_$1_$2_$3
|
||||
- pattern: kafka.server<type=(ReplicaFetcherManager), name=(.+), clientId=(.+)><>(Value)
|
||||
name: kafka_server_$1_$2_$4
|
||||
labels:
|
||||
client_id: "$3"
|
||||
- pattern : kafka.network<type=(Processor), name=(IdlePercent), networkProcessor=(.+)><>(Value)
|
||||
name: kafka_network_$1_$2_$4
|
||||
labels:
|
||||
network_processor: $3
|
||||
- pattern : kafka.network<type=(RequestMetrics), name=(RequestsPerSec), request=(.+)><>(Count)
|
||||
name: kafka_network_$1_$2_$4
|
||||
labels:
|
||||
request: $3
|
||||
- pattern: kafka.server<type=(.+), name=(.+), topic=(.+)><>(Count|OneMinuteRate)
|
||||
name: kafka_server_$1_$2_$4
|
||||
labels:
|
||||
topic: $3
|
||||
- pattern: kafka.server<type=(DelayedOperationPurgatory), name=(.+), delayedOperation=(.+)><>(Value)
|
||||
name: kafka_server_$1_$2_$3_$4
|
||||
- pattern: kafka.server<type=(.+), name=(.+)><>(Count|Value|OneMinuteRate)
|
||||
name: kafka_server_$1_total_$2_$3
|
||||
- pattern: kafka.server<type=(.+)><>(queue-size)
|
||||
name: kafka_server_$1_$2
|
||||
- pattern: java.lang<type=(.+), name=(.+)><(.+)>(\w+)
|
||||
name: java_lang_$1_$4_$3_$2
|
||||
- pattern: java.lang<type=(.+), name=(.+)><>(\w+)
|
||||
name: java_lang_$1_$3_$2
|
||||
- pattern : java.lang<type=(.*)>
|
||||
- pattern: kafka.log<type=(.+), name=(.+), topic=(.+), partition=(.+)><>Value
|
||||
name: kafka_log_$1_$2
|
||||
labels:
|
||||
topic: $3
|
||||
partition: $4
|
||||
{{- end -}}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
{{- if .Values.metrics.jmx.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-jmx-metrics
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.metrics.jmx.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.metrics.jmx.service.annotations }}
|
||||
{{ include "kafka.tplValue" ( dict "value" .Values.metrics.jmx.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.metrics.jmx.service.type }}
|
||||
{{- if eq .Values.metrics.jmx.service.type "LoadBalancer" }}
|
||||
{{- if .Values.metrics.jmx.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.metrics.jmx.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.jmx.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{- toYaml .Values.metrics.jmx.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.metrics.jmx.service.type "ClusterIP") .Values.metrics.jmx.service.clusterIP }}
|
||||
clusterIP: {{ .Values.metrics.jmx.service.clusterIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: {{ .Values.metrics.jmx.service.port }}
|
||||
protocol: TCP
|
||||
targetPort: metrics
|
||||
{{- if and (or (eq .Values.metrics.jmx.service.type "NodePort") (eq .Values.metrics.jmx.service.type "LoadBalancer")) (not (empty .Values.metrics.jmx.service.nodePort)) }}
|
||||
nodePort: {{ .Values.metrics.jmx.service.nodePort }}
|
||||
{{- else if eq .Values.metrics.jmx.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
selector: {{- include "kafka.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- end }}
|
||||
|
|
@ -1,87 +0,0 @@
|
|||
{{- if .Values.metrics.kafka.enabled }}
|
||||
{{- $replicaCount := int .Values.replicaCount -}}
|
||||
{{- $releaseNamespace := .Release.Namespace -}}
|
||||
{{- $clusterDomain := .Values.clusterDomain -}}
|
||||
{{- $fullname := include "kafka.fullname" . -}}
|
||||
{{- $servicePort := int .Values.service.port -}}
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-exporter
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
replicas: 1
|
||||
selector:
|
||||
matchLabels: {{- include "kafka.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
template:
|
||||
metadata:
|
||||
labels: {{- include "kafka.labels" . | nindent 8 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
spec:
|
||||
{{- include "kafka.imagePullSecrets" . | indent 6 }}
|
||||
containers:
|
||||
- name: kafka-exporter
|
||||
image: {{ include "kafka.metrics.kafka.image" . }}
|
||||
imagePullPolicy: {{ .Values.metrics.kafka.image.pullPolicy | quote }}
|
||||
command:
|
||||
- /bin/bash
|
||||
- -ec
|
||||
- |
|
||||
read -r -a sasl_passwords <<< "$(tr ',;' ' ' <<< "${SASL_USER_PASSWORD}")"
|
||||
kafka_exporter \
|
||||
{{- range $i, $e := until $replicaCount }}
|
||||
--kafka.server={{ $fullname }}-{{ $i }}.{{ $fullname }}-headless.{{ $releaseNamespace }}.svc.{{ $clusterDomain }}:{{ $servicePort }} \
|
||||
{{- end }}
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
--sasl.enabled \
|
||||
--sasl.username="$SASL_USERNAME" \
|
||||
--sasl.password="${sasl_passwords[0]}" \
|
||||
{{- end }}
|
||||
{{- if (include "kafka.tlsEncryption" .) }}
|
||||
--tls.enabled \
|
||||
{{- if .Values.metrics.kafka.certificatesSecret }}
|
||||
--tls.ca-file="/opt/bitnami/kafka-exporter/certs/ca-file" \
|
||||
--tls.cert-file="/opt/bitnami/kafka-exporter/certs/cert-file" \
|
||||
--tls.key-file="/opt/bitnami/kafka-exporter/certs/key-file" \
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- range $key, $value := .Values.metrics.kafka.extraFlags }}
|
||||
--{{ $key }}{{ if $value }}={{ $value }}{{ end }} \
|
||||
{{- end }}
|
||||
--web.listen-address=:9308
|
||||
{{- if (include "kafka.client.saslAuthentication" .) }}
|
||||
env:
|
||||
- name: SASL_USERNAME
|
||||
value: {{ index .Values.auth.jaas.clientUsers 0 | quote }}
|
||||
- name: SASL_USER_PASSWORD
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ include "kafka.jaasSecretName" . }}
|
||||
key: client-passwords
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: metrics
|
||||
containerPort: 9308
|
||||
{{- if .Values.metrics.kafka.resources }}
|
||||
resources: {{ toYaml .Values.metrics.kafka.resources | nindent 12 }}
|
||||
{{- end }}
|
||||
{{- if and (include "kafka.tlsEncryption" .) .Values.metrics.kafka.certificatesSecret }}
|
||||
volumeMounts:
|
||||
- name: kafka-exporter-certificates
|
||||
mountPath: /opt/bitnami/kafka-exporter/certs/
|
||||
readOnly: true
|
||||
volumes:
|
||||
- name: kafka-exporter-certificates
|
||||
secret:
|
||||
secretName: {{ .Values.metrics.kafka.certificatesSecret }}
|
||||
defaultMode: 0440
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
|
|
@ -1,45 +0,0 @@
|
|||
{{- if .Values.metrics.kafka.enabled }}
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}-metrics
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if or .Values.metrics.kafka.service.annotations .Values.commonAnnotations }}
|
||||
annotations:
|
||||
{{- if .Values.metrics.kafka.service.annotations }}
|
||||
{{ include "kafka.tplValue" ( dict "value" .Values.metrics.kafka.service.annotations "context" $) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.metrics.kafka.service.type }}
|
||||
{{- if eq .Values.metrics.kafka.service.type "LoadBalancer" }}
|
||||
{{- if .Values.metrics.kafka.service.loadBalancerIP }}
|
||||
loadBalancerIP: {{ .Values.metrics.kafka.service.loadBalancerIP }}
|
||||
{{- end }}
|
||||
{{- if .Values.metrics.kafka.service.loadBalancerSourceRanges }}
|
||||
loadBalancerSourceRanges: {{- toYaml .Values.metrics.kafka.service.loadBalancerSourceRanges | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if and (eq .Values.metrics.kafka.service.type "ClusterIP") .Values.metrics.kafka.service.clusterIP }}
|
||||
clusterIP: {{ .Values.metrics.kafka.service.clusterIP }}
|
||||
{{- end }}
|
||||
ports:
|
||||
- name: http-metrics
|
||||
port: {{ .Values.metrics.kafka.service.port }}
|
||||
protocol: TCP
|
||||
targetPort: metrics
|
||||
{{- if and (or (eq .Values.metrics.kafka.service.type "NodePort") (eq .Values.metrics.kafka.service.type "LoadBalancer")) (not (empty .Values.metrics.kafka.service.nodePort)) }}
|
||||
nodePort: {{ .Values.metrics.kafka.service.nodePort }}
|
||||
{{- else if eq .Values.metrics.kafka.service.type "ClusterIP" }}
|
||||
nodePort: null
|
||||
{{- end }}
|
||||
selector: {{- include "kafka.matchLabels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: metrics
|
||||
{{- end }}
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
{{- if (include "kafka.log4j.createConfigMap" .) }}
|
||||
apiVersion: v1
|
||||
kind: ConfigMap
|
||||
metadata:
|
||||
name: {{ include "kafka.log4j.configMapName" . }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
data:
|
||||
log4j.properties: |-
|
||||
{{ .Values.log4j | nindent 4 }}
|
||||
{{- end -}}
|
||||
|
|
@ -1,25 +0,0 @@
|
|||
{{- $replicaCount := int .Values.replicaCount }}
|
||||
{{- if and .Values.pdb.create (gt $replicaCount 1) }}
|
||||
apiVersion: policy/v1beta1
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
name: {{ template "kafka.fullname" . }}
|
||||
labels: {{- include "kafka.labels" . | nindent 4 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- if .Values.commonLabels }}
|
||||
{{- include "kafka.tplValue" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
{{- if .Values.commonAnnotations }}
|
||||
annotations: {{- include "kafka.tplValue" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
|
||||
{{- end }}
|
||||
spec:
|
||||
{{- if .Values.pdb.minAvailable }}
|
||||
minAvailable: {{ .Values.pdb.minAvailable }}
|
||||
{{- end }}
|
||||
{{- if .Values.pdb.maxUnavailable }}
|
||||
maxUnavailable: {{ .Values.pdb.maxUnavailable }}
|
||||
{{- end }}
|
||||
selector:
|
||||
matchLabels: {{- include "kafka.matchLabels" . | nindent 6 }}
|
||||
app.kubernetes.io/component: kafka
|
||||
{{- end }}
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Reference in a new issue