From 7074b002ed4dbede073c743fcae2f2852aac41ac Mon Sep 17 00:00:00 2001 From: dellnoantechnp Date: Tue, 16 May 2023 13:35:48 +0800 Subject: [PATCH] feature: add Bitnami/common-1.10.3 chart, dependency for kafka. add Bitnami/zookeeper-7.6.1 chart, dependency for kafka. add Bitnami/kafka 2.8.1 AppVersion. the last kafka-14.9.3 use Kafka appVersion 2.8.1. Source from Bitnami/charts. --- charts/kafka/.helmignore | 21 - charts/kafka/Chart.yaml | 32 - charts/kafka/README.md | 880 ----------- charts/kafka/files/tls/README.md | 26 - charts/kafka/templates/NOTES.txt | 256 --- charts/kafka/templates/_helpers.tpl | 407 ----- charts/kafka/templates/configmap.yaml | 16 - charts/kafka/templates/extra-list.yaml | 4 - charts/kafka/templates/jaas-secret.yaml | 37 - charts/kafka/templates/jmx-configmap.yaml | 59 - charts/kafka/templates/jmx-metrics-svc.yaml | 45 - .../templates/kafka-metrics-deployment.yaml | 137 -- .../kafka-metrics-serviceaccount.yaml | 15 - charts/kafka/templates/kafka-metrics-svc.yaml | 45 - .../kafka/templates/kafka-provisioning.yaml | 164 -- charts/kafka/templates/log4j-configmap.yaml | 16 - .../kafka/templates/networkpolicy-egress.yaml | 22 - .../templates/networkpolicy-ingress.yaml | 54 - .../kafka/templates/poddisruptionbudget.yaml | 25 - charts/kafka/templates/role.yaml | 23 - charts/kafka/templates/rolebinding.yaml | 22 - charts/kafka/templates/scripts-configmap.yaml | 160 -- charts/kafka/templates/serviceaccount.yaml | 15 - .../templates/servicemonitor-jmx-metrics.yaml | 42 - .../templates/servicemonitor-metrics.yaml | 42 - charts/kafka/templates/statefulset.yaml | 577 ------- .../kafka/templates/svc-external-access.yaml | 53 - charts/kafka/templates/svc-headless.yaml | 26 - charts/kafka/templates/svc.yaml | 49 - charts/kafka/templates/tls-secret.yaml | 49 - charts/kafka/values.yaml | 1380 ----------------- 31 files changed, 4699 deletions(-) delete mode 100644 charts/kafka/.helmignore delete mode 100644 charts/kafka/Chart.yaml delete mode 100644 charts/kafka/README.md delete mode 100644 charts/kafka/files/tls/README.md delete mode 100644 charts/kafka/templates/NOTES.txt delete mode 100644 charts/kafka/templates/_helpers.tpl delete mode 100644 charts/kafka/templates/configmap.yaml delete mode 100644 charts/kafka/templates/extra-list.yaml delete mode 100644 charts/kafka/templates/jaas-secret.yaml delete mode 100644 charts/kafka/templates/jmx-configmap.yaml delete mode 100644 charts/kafka/templates/jmx-metrics-svc.yaml delete mode 100644 charts/kafka/templates/kafka-metrics-deployment.yaml delete mode 100644 charts/kafka/templates/kafka-metrics-serviceaccount.yaml delete mode 100644 charts/kafka/templates/kafka-metrics-svc.yaml delete mode 100644 charts/kafka/templates/kafka-provisioning.yaml delete mode 100644 charts/kafka/templates/log4j-configmap.yaml delete mode 100644 charts/kafka/templates/networkpolicy-egress.yaml delete mode 100644 charts/kafka/templates/networkpolicy-ingress.yaml delete mode 100644 charts/kafka/templates/poddisruptionbudget.yaml delete mode 100644 charts/kafka/templates/role.yaml delete mode 100644 charts/kafka/templates/rolebinding.yaml delete mode 100644 charts/kafka/templates/scripts-configmap.yaml delete mode 100644 charts/kafka/templates/serviceaccount.yaml delete mode 100644 charts/kafka/templates/servicemonitor-jmx-metrics.yaml delete mode 100644 charts/kafka/templates/servicemonitor-metrics.yaml delete mode 100644 charts/kafka/templates/statefulset.yaml delete mode 100644 charts/kafka/templates/svc-external-access.yaml delete mode 100644 charts/kafka/templates/svc-headless.yaml delete mode 100644 charts/kafka/templates/svc.yaml delete mode 100644 charts/kafka/templates/tls-secret.yaml delete mode 100644 charts/kafka/values.yaml diff --git a/charts/kafka/.helmignore b/charts/kafka/.helmignore deleted file mode 100644 index f0c1319..0000000 --- a/charts/kafka/.helmignore +++ /dev/null @@ -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 diff --git a/charts/kafka/Chart.yaml b/charts/kafka/Chart.yaml deleted file mode 100644 index 3fe2fd9..0000000 --- a/charts/kafka/Chart.yaml +++ /dev/null @@ -1,32 +0,0 @@ -annotations: - category: Infrastructure -apiVersion: v2 -appVersion: 2.8.1 -dependencies: - - name: common - repository: https://dellnoantechnp.github.io/helm-chart-xxl-job-admin/ - tags: - - bitnami-common - version: 1.x.x - - condition: zookeeper.enabled - name: zookeeper - repository: https://dellnoantechnp.github.io/helm-chart-xxl-job-admin/ - version: 7.x.x -description: "[OpenSource by Bitnami] 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-220x234.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: 14.9.3 \ No newline at end of file diff --git a/charts/kafka/README.md b/charts/kafka/README.md deleted file mode 100644 index 363aa41..0000000 --- a/charts/kafka/README.md +++ /dev/null @@ -1,880 +0,0 @@ - - -# Kafka - -[Kafka](https://kafka.apache.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](https://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.19+ -- Helm 3.2.0+ -- 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 - -### Global parameters - -| Name | Description | Value | -| ------------------------- | ----------------------------------------------- | ----- | -| `global.imageRegistry` | Global Docker image registry | `""` | -| `global.imagePullSecrets` | Global Docker registry secret names as an array | `[]` | -| `global.storageClass` | Global StorageClass for Persistent Volume(s) | `""` | - - -### Common parameters - -| Name | Description | Value | -| ------------------------ | --------------------------------------------------------------------------------------- | --------------- | -| `nameOverride` | String to partially override kafka.fullname | `""` | -| `fullnameOverride` | String to fully override kafka.fullname | `""` | -| `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 | `[]` | -| `diagnosticMode.enabled` | Enable diagnostic mode (all probes will be disabled and the command will be overridden) | `false` | -| `diagnosticMode.command` | Command to override all containers in the deployment | `["sleep"]` | -| `diagnosticMode.args` | Args to override all containers in the deployment | `["infinity"]` | - - -### Kafka parameters - -| Name | Description | Value | -| ------------------------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------- | -| `image.registry` | Kafka image registry | `docker.io` | -| `image.repository` | Kafka image repository | `bitnami/kafka` | -| `image.tag` | Kafka image tag (immutable tags are recommended) | `2.8.1-debian-10-r99` | -| `image.pullPolicy` | Kafka image pull policy | `IfNotPresent` | -| `image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `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 (see [below]( | `""` | -| `existingConfigmap` | ConfigMap with Kafka Configuration | `""` | -| `log4j` | An optional log4j.properties file to overwrite the default of the Kafka brokers. | `""` | -| `existingLog4jConfigMap` | The name of an existing ConfigMap containing a log4j.properties file. | `""` | -| `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 | `true` | -| `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` | -| `zookeeperChrootPath` | Path which puts data under some path in the global ZooKeeper namespace | `""` | -| `authorizerClassName` | The Authorizer is configured by setting authorizer.class.name=kafka.security.authorizer.AclAuthorizer in server.properties. | `""` | -| `allowEveryoneIfNoAclFound` | By default, if a resource has no associated ACLs, then no one is allowed to access that resource except super users. | `true` | -| `superUsers` | You can add super users in server.properties | `User:admin` | -| `command` | Override kafka container command | `["/scripts/setup.sh"]` | -| `args` | Override kafka container arguments | `[]` | -| `extraEnvVars` | Extra environment variables to add to kafka pods (see [below]({KEY} | `[]` | -| `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.sasl.mechanisms` | 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.sasl.interBrokerMechanism` | SASL mechanism for inter broker communication. | `plain` | -| `auth.sasl.jaas.clientUsers` | Kafka client user list | `["user"]` | -| `auth.sasl.jaas.clientPasswords` | Kafka client passwords. This is mandatory if more than one user is specified in clientUsers | `[]` | -| `auth.sasl.jaas.interBrokerUser` | Kafka inter broker communication user for SASL authentication | `admin` | -| `auth.sasl.jaas.interBrokerPassword` | Kafka inter broker communication password for SASL authentication | `""` | -| `auth.sasl.jaas.zookeeperUser` | Kafka Zookeeper user for SASL authentication | `""` | -| `auth.sasl.jaas.zookeeperPassword` | Kafka Zookeeper password for SASL authentication | `""` | -| `auth.sasl.jaas.existingSecret` | Name of the existing secret containing credentials for clientUsers, interBrokerUser and zookeeperUser | `""` | -| `auth.saslMechanisms` | DEPRECATED: use `auth.sasl.mechanisms` instead. | `plain,scram-sha-256,scram-sha-512` | -| `auth.saslInterBrokerMechanism` | DEPRECATED: use `auth.sasl.interBrokerMechanism` instead. | `plain` | -| `auth.jaas` | DEPRECATED: use `auth.sasl.jaas` instead. | `{}` | -| `auth.tls.type` | Format to use for TLS certificates. Allowed types: `jks` and `pem` | `jks` | -| `auth.tls.existingSecrets` | Array existing secrets containing the TLS certificates for the Kafka brokers | `[]` | -| `auth.tls.existingSecret` | DEPRECATED: use `auth.tls.existingSecrets` instead. | `""` | -| `auth.tls.autoGenerated` | Generate automatically self-signed TLS certificates for Kafka brokers. Currently only supported if `auth.tls.type` is `pem` | `false` | -| `auth.tls.password` | Password to access the JKS files or PEM key when they are password-protected. | `""` | -| `auth.tls.jksTruststoreSecret` | Name of the existing secret containing your truststore if truststore not existing or different from the ones in the `auth.tls.existingSecrets` | `""` | -| `auth.tls.jksKeystoreSAN` | The secret key from the `auth.tls.existingSecret` containing the keystore with a SAN certificate | `""` | -| `auth.tls.jksTruststore` | The secret key from the `auth.tls.existingSecret` or `auth.tls.jksTruststoreSecret` containing the truststore | `""` | -| `auth.tls.endpointIdentificationAlgorithm` | The endpoint identification algorithm to validate server hostname using server certificate | `https` | -| `auth.jksSecret` | DEPRECATED: use `auth.tls.existingSecrets` instead. | `""` | -| `auth.jksTruststoreSecret` | DEPRECATED: use `auth.tls.jksTruststoreSecret` instead. | `""` | -| `auth.jksKeystoreSAN` | DEPRECATED: use `auth.tls.jksKeystoreSAN` instead. | `""` | -| `auth.jksTruststore` | DEPRECATED: use `auth.tls.jksTruststore` instead. | `""` | -| `auth.jksPassword` | DEPRECATED: use `auth.tls.password` instead. | `""` | -| `auth.tlsEndpointIdentificationAlgorithm` | DEPRECATED: use `auth.tls.endpointIdentificationAlgorithm` instead. | `https` | -| `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 | `""` | -| `allowPlaintextListener` | Allow to use the PLAINTEXT listener | `true` | -| `interBrokerListenerName` | The listener that the brokers should communicate on | `INTERNAL` | - - -### Statefulset parameters - -| Name | Description | Value | -| ------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------- | -| `replicaCount` | Number of Kafka nodes | `1` | -| `minBrokerId` | Minimal broker.id value, nodes increment their `broker.id` respectively | `0` | -| `updateStrategy` | Update strategy for the stateful set | `RollingUpdate` | -| `rollingUpdatePartition` | Partition update strategy | `""` | -| `hostAliases` | Add deployment host aliases | `[]` | -| `podManagementPolicy` | StatefulSet controller supports relax its ordering guarantees while preserving its uniqueness and identity guarantees. There are two valid pod management policies: OrderedReady and Parallel | `Parallel` | -| `schedulerName` | Name of the k8s scheduler (other than default) | `""` | -| `podLabels` | Kafka pod labels | `{}` | -| `podAnnotations` | Kafka Pod annotations | `{}` | -| `priorityClassName` | Name of the existing priority class to be used by kafka pods | `""` | -| `podAffinityPreset` | Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `podAntiAffinityPreset` | Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `soft` | -| `nodeAffinityPreset.type` | Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` | `""` | -| `nodeAffinityPreset.key` | Node label key to match Ignored if `affinity` is set. | `""` | -| `nodeAffinityPreset.values` | Node label values to match. Ignored if `affinity` is set. | `[]` | -| `affinity` | Affinity for pod assignment | `{}` | -| `nodeSelector` | Node labels for pod assignment | `{}` | -| `tolerations` | Tolerations for pod assignment | `[]` | -| `topologySpreadConstraints` | Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template | `{}` | -| `terminationGracePeriodSeconds` | Seconds the pod needs to gracefully terminate | `""` | -| `podSecurityContext.enabled` | Enable security context for the pods | `true` | -| `podSecurityContext.fsGroup` | Group ID for the filesystem used by the containers | `1001` | -| `podSecurityContext.runAsUser` | User ID for the service user running the pod | `1001` | -| `containerSecurityContext.enabled` | Enable Kafka containers' Security Context | `false` | -| `resources.limits` | The resources limits for Kafka containers | `{}` | -| `resources.requests` | The requested resources for Kafka containers | `{}` | -| `livenessProbe.enabled` | Enable livenessProbe | `true` | -| `livenessProbe.initialDelaySeconds` | Initial delay seconds for livenessProbe | `10` | -| `livenessProbe.periodSeconds` | Period seconds for livenessProbe | `10` | -| `livenessProbe.timeoutSeconds` | Timeout seconds for livenessProbe | `5` | -| `livenessProbe.failureThreshold` | Failure threshold for livenessProbe | `3` | -| `livenessProbe.successThreshold` | Success threshold for livenessProbe | `1` | -| `readinessProbe.enabled` | Enable readinessProbe | `true` | -| `readinessProbe.initialDelaySeconds` | Initial delay seconds for readinessProbe | `5` | -| `readinessProbe.periodSeconds` | Period seconds for readinessProbe | `10` | -| `readinessProbe.timeoutSeconds` | Timeout seconds for readinessProbe | `5` | -| `readinessProbe.failureThreshold` | Failure threshold for readinessProbe | `6` | -| `readinessProbe.successThreshold` | Success threshold for readinessProbe | `1` | -| `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 | `""` | -| `pdb.maxUnavailable` | Maximum number/percentage of pods that may be made unavailable | `1` | -| `sidecars` | Attach additional sidecar containers to the Kafka pod | `[]` | -| `initContainers` | Add extra init containers | `[]` | - - -### Exposure parameters - -| Name | Description | Value | -| ------------------------------------------------- | ---------------------------------------------------------------------------------------------- | ---------------------- | -| `networkPolicy.enabled` | Enable creation of NetworkPolicy resources. | `false` | -| `networkPolicy.allowExternal` | Don't require client label for connections | `true` | -| `networkPolicy.explicitNamespacesSelector` | A Kubernetes LabelSelector to explicitly select namespaces from which traffic could be allowed | `{}` | -| `networkPolicy.externalAccess.from` | customize the from section for External Access on tcp-external port | `[]` | -| `networkPolicy.egressRules.customRules` | Custom network policy rule | `{}` | -| `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` | Specify the nodePort value for the LoadBalancer and NodePort service types. | `{}` | -| `service.loadBalancerIP` | loadBalancerIP for Kafka Service | `""` | -| `service.loadBalancerSourceRanges` | Address(es) that are allowed when service is LoadBalancer | `[]` | -| `service.annotations` | Service annotations | `{}` | -| `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 | `docker.io` | -| `externalAccess.autoDiscovery.image.repository` | Init container auto-discovery image repository | `bitnami/kubectl` | -| `externalAccess.autoDiscovery.image.tag` | Init container auto-discovery image tag (immutable tags are recommended) | `1.23.1-debian-10-r26` | -| `externalAccess.autoDiscovery.image.pullPolicy` | Init container auto-discovery image pull policy | `IfNotPresent` | -| `externalAccess.autoDiscovery.image.pullSecrets` | Init container auto-discovery image pull secrets | `[]` | -| `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 each Kafka broker. Length must be the same as replicaCount | `[]` | -| `externalAccess.service.loadBalancerSourceRanges` | Address(es) that are allowed when service is LoadBalancer | `[]` | -| `externalAccess.service.nodePorts` | Array of node ports used for each Kafka broker. Length must be the same as replicaCount | `[]` | -| `externalAccess.service.useHostIPs` | Use service host IPs to configure Kafka external listener when service type is NodePort | `false` | -| `externalAccess.service.domain` | Domain or external ip used to configure Kafka external listener when service type is NodePort | `""` | -| `externalAccess.service.annotations` | Service annotations for external access | `{}` | -| `externalAccess.service.usePodIPs` | using the MY_POD_IP address for external access. | `false` | - - -### Persistence parameters - -| Name | Description | Value | -| --------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------- | ------------------------- | -| `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 | `""` | -| `persistence.storageClass` | PVC Storage Class for Kafka data volume | `""` | -| `persistence.accessModes` | PV Access Mode | `["ReadWriteOnce"]` | -| `persistence.size` | PVC Storage Request for Kafka data volume | `8Gi` | -| `persistence.annotations` | Annotations for the PVC | `{}` | -| `persistence.selector` | Selector to match an existing Persistent Volume for Kafka's data PVC. If set, the PVC can't have a PV dynamically provisioned for it | `{}` | -| `persistence.mountPath` | Mount path of the Kafka data volume | `/bitnami/kafka` | -| `logPersistence.enabled` | Enable Kafka logs persistence using PVC, note that Zookeeper persistence is unaffected | `false` | -| `logPersistence.existingClaim` | A manually managed Persistent Volume and Claim | `""` | -| `logPersistence.existingLogClaim` | PV Storage Class | `""` | -| `logPersistence.accessModes` | PV Access Mode | `["ReadWriteOnce"]` | -| `logPersistence.size` | PVC Storage Request for Kafka logs volume | `8Gi` | -| `logPersistence.annotations` | Annotations for the PVC | `{}` | -| `logPersistence.selector` | Selector to match an existing Persistent Volume for Kafka's log data PVC. If set, the PVC can't have a PV dynamically provisioned for it | `{}` | -| `logPersistence.mountPath` | Mount path of the Kafka logs volume | `/opt/bitnami/kafka/logs` | - - -### RBAC parameters - -| Name | Description | Value | -| --------------------------------------------- | ---------------------------------------------------------------------------------------------- | ------- | -| `serviceAccount.create` | Enable creation of ServiceAccount for Kafka pods | `true` | -| `serviceAccount.name` | The name of the service account to use. If not set and `create` is `true`, a name is generated | `""` | -| `serviceAccount.automountServiceAccountToken` | Allows auto mount of ServiceAccountToken on the serviceAccount created | `true` | -| `rbac.create` | Whether to create & use RBAC resources or not | `false` | - - -### Volume Permissions parameters - -| Name | Description | Value | -| --------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ----------------------- | -| `volumePermissions.enabled` | Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup` | `false` | -| `volumePermissions.securityContext.runAsUser` | User ID for the container. | `0` | -| `volumePermissions.image.registry` | Init container volume-permissions image registry | `docker.io` | -| `volumePermissions.image.repository` | Init container volume-permissions image name | `bitnami/bitnami-shell` | -| `volumePermissions.image.tag` | Init container volume-permissions image tag | `10-debian-10-r307` | -| `volumePermissions.image.pullPolicy` | Init container volume-permissions image pull policy | `IfNotPresent` | -| `volumePermissions.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `volumePermissions.resources.limits` | Init container volume-permissions resource limits | `{}` | -| `volumePermissions.resources.requests` | Init container volume-permissions resource requests | `{}` | - - -### Metrics parameters - -| Name | Description | Value | -| ----------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------- | -| `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 repository | `bitnami/kafka-exporter` | -| `metrics.kafka.image.tag` | Kafka exporter image tag (immutable tags are recommended) | `1.4.2-debian-10-r115` | -| `metrics.kafka.image.pullPolicy` | Kafka exporter image pull policy | `IfNotPresent` | -| `metrics.kafka.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `metrics.kafka.serviceAccount.create` | Enable creation of ServiceAccount for Kafka exporter pods | `true` | -| `metrics.kafka.serviceAccount.name` | The name of the service account to use. If not set and `create` is `true`, a name is generated | `""` | -| `metrics.kafka.serviceAccount.automountServiceAccountToken` | Allows auto mount of ServiceAccountToken on the serviceAccount created | `true` | -| `metrics.kafka.schedulerName` | Name of the k8s scheduler (other than default) for Kafka Exporter | `""` | -| `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 | `""` | -| `metrics.kafka.tlsCert` | The secret key from the certificatesSecret if 'client-cert' key different from the default (cert-file) | `cert-file` | -| `metrics.kafka.tlsKey` | The secret key from the certificatesSecret if 'client-key' key different from the default (key-file) | `key-file` | -| `metrics.kafka.tlsCaSecret` | Name of the existing secret containing the optional ca certificate for Kafka Exporter client authentication | `""` | -| `metrics.kafka.tlsCaCert` | The secret key from the certificatesSecret or tlsCaSecret if 'ca-cert' key different from the default (ca-file) | `ca-file` | -| `metrics.kafka.podLabels` | Kafka exporter pod labels | `{}` | -| `metrics.kafka.podAnnotations` | Kafka exporter pod annotations | `{}` | -| `metrics.kafka.containerSecurityContext.enabled` | Enable Prometheus Kafka Exporter containers' Security Context | `false` | -| `metrics.kafka.resources.limits` | Kafka Exporter container resource limits | `{}` | -| `metrics.kafka.resources.requests` | Kafka Exporter container resource requests | `{}` | -| `metrics.kafka.affinity` | Affinity for Kafka Exporter pod assignment | `{}` | -| `metrics.kafka.nodeSelector` | Node labels for Kafka Exporter pod assignment | `{}` | -| `metrics.kafka.tolerations` | Tolerations for Kafka Exporter pod assignment | `[]` | -| `metrics.kafka.initContainers` | Add init containers to the Kafka exporter pods | `[]` | -| `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.loadBalancerIP` | loadBalancerIP if service type is `LoadBalancer` | `""` | -| `metrics.kafka.service.loadBalancerSourceRanges` | Load Balancer sources | `[]` | -| `metrics.kafka.service.clusterIP` | Static clusterIP or None for headless services | `""` | -| `metrics.kafka.service.annotations` | Annotations for the Kafka Exporter Prometheus metrics service | `{}` | -| `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 repository | `bitnami/jmx-exporter` | -| `metrics.jmx.image.tag` | JMX exporter image tag (immutable tags are recommended) | `0.16.1-debian-10-r177` | -| `metrics.jmx.image.pullPolicy` | JMX exporter image pull policy | `IfNotPresent` | -| `metrics.jmx.image.pullSecrets` | Specify docker-registry secret names as an array | `[]` | -| `metrics.jmx.containerSecurityContext.enabled` | Enable Prometheus JMX Exporter Containers' Security Context | `false` | -| `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.loadBalancerIP` | loadBalancerIP if service type is `LoadBalancer` | `""` | -| `metrics.jmx.service.loadBalancerSourceRanges` | Load Balancer sources | `[]` | -| `metrics.jmx.service.clusterIP` | Static clusterIP or None for headless services | `""` | -| `metrics.jmx.service.annotations` | Annotations for the JMX Exporter Prometheus metrics service | `{}` | -| `metrics.jmx.whitelistObjectNames` | Allows setting which JMX objects you want to expose to via JMX stats to JMX Exporter | `["kafka.controller:*","kafka.server:*","java.lang:*","kafka.network:*","kafka.log:*"]` | -| `metrics.jmx.config` | Configuration file for JMX exporter | `""` | -| `metrics.jmx.existingConfigmap` | Name of existing ConfigMap with JMX exporter configuration | `""` | -| `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 in which Prometheus is running | `""` | -| `metrics.serviceMonitor.interval` | Interval at which metrics should be scraped | `""` | -| `metrics.serviceMonitor.scrapeTimeout` | Timeout after which the scrape is ended | `""` | -| `metrics.serviceMonitor.selector` | ServiceMonitor selector labels | `{}` | -| `metrics.serviceMonitor.relabelings` | Relabel configuration for the metrics | `[]` | -| `metrics.serviceMonitor.metricRelabelings` | MetricRelabelConfigs to apply to samples before ingestion | `[]` | - - -### Kafka provisioning parameters - -| Name | Description | Value | -| --------------------------------- | --------------------------------------------------------------------- | ------- | -| `provisioning.enabled` | Enable kafka provisioning Job | `false` | -| `provisioning.numPartitions` | Default number of partitions for topics when unspecified. | `1` | -| `provisioning.replicationFactor` | Default replication factor for topics when unspecified. | `1` | -| `provisioning.schedulerName` | Name of the k8s scheduler (other than default) for kafka provisioning | `""` | -| `provisioning.podAnnotations` | Provisioning Pod annotations. | `{}` | -| `provisioning.resources.limits` | The resources limits for the container | `{}` | -| `provisioning.resources.requests` | The requested resources for the container | `{}` | -| `provisioning.command` | Override provisioning container command | `[]` | -| `provisioning.args` | Override provisioning container arguments | `[]` | -| `provisioning.topics` | Kafka provisioning topics | `[]` | - - -### Zookeeper chart parameters - -| Name | Description | Value | -| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | -| `zookeeper.enabled` | Switch to enable or disable the Zookeeper helm chart | `true` | -| `zookeeper.auth.enabled` | Enable Zookeeper auth | `false` | -| `zookeeper.auth.clientUser` | User that will use Zookeeper clients to auth | `""` | -| `zookeeper.auth.clientPassword` | Password that will use Zookeeper clients to auth | `""` | -| `zookeeper.auth.serverUsers` | Comma, semicolon or whitespace separated list of user to be created. Specify them as a string, for example: "user1,user2,admin" | `""` | -| `zookeeper.auth.serverPasswords` | Comma, semicolon or whitespace separated list of passwords to assign to users when created. Specify them as a string, for example: "pass4user1, pass4user2, pass4admin" | `""` | -| `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. - -### 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. - -Using `extraEnvVars` with `KAFKA_CFG_` is the preferred and simplest way to add custom Kafka parameters not otherwise specified in this chart. Alternatively, you can provide a *full* Kafka configuration using `config` or `existingConfigmap`. -Setting either `config` or `existingConfigmap` will cause the chart to disregard `KAFKA_CFG_` settings, which are used by many other Kafka-related chart values described above, as well as dynamically generated parameters such as `zookeeper.connect`. This can cause unexpected behavior. - -### 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 | - -Learn more about how to configure Kafka to use the different authentication protocols in the [chart documentation](https://docs.bitnami.com/kubernetes/infrastructure/kafka/administration/enable-security/). - -If you enabled SASL authentication on any listener, you can set the SASL credentials using the parameters below: - -- `auth.sasl.jaas.clientUsers`/`auth.sasl.jaas.clientPasswords`: when enabling SASL authentication for communications with clients. -- `auth.sasl.jaas.interBrokerUser`/`auth.sasl.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 **can** create a secret per Kafka broker you have in the cluster containing the Java Key Stores (JKS) files: the truststore (`kafka.truststore.jks`) and the keystore (`kafka.keystore.jks`). Then, you need pass the secret names with the `auth.tls.existingSecrets` 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.tls.password` parameter to provide your password. - -For instance, to configure TLS authentication on a Kafka cluster with 2 Kafka brokers use the commands below to create the secrets: - -```console -kubectl create secret generic kafka-jks-0 --from-file=kafka.truststore.jks=./kafka.truststore.jks --from-file=kafka.keystore.jks=./kafka-0.keystore.jks -kubectl create secret generic kafka-jks-1 --from-file=kafka.truststore.jks=./kafka.truststore.jks --from-file=kafka.keystore.jks=./kafka-1.keystore.jks -``` - -> **Note**: the command above assumes you already created the truststore 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. - -If, for some reason (like using Cert-Manager) you can not use the default JKS secret scheme, you can use the additional parameters: - -- `auth.tls.jksTruststoreSecret` to define additional secret, where the `kafka.truststore.jks` is being kept. The truststore password **must** be the same as in `auth.tls.password` -- `auth.tls.jksTruststore` to overwrite the default value of the truststore key (`kafka.truststore.jks`). -- `auth.tls.jksKeystoreSAN` if you want to use a SAN certificate for your brokers. Setting this parameter would mean that the chart expects a existing key in the `auth.tls.jksTruststoreSecret` with the `auth.tls.jksKeystoreSAN` value and use this as a keystore for **all** brokers - -> **Note**: The truststore/keystore from above **must** be protected with the same password as in `auth.tls.password` - -You can deploy the chart with authentication using the following parameters: - -```console -replicaCount=2 -auth.clientProtocol=sasl -auth.interBrokerProtocol=tls -auth.tls.existingSecrets[0]=kafka-jks-0 -auth.tls.existingSecrets[1]=kafka-jks-1 -auth.tls.password=jksPassword -auth.sasl.jaas.clientUsers[0]=brokerUser -auth.sasl.jaas.clientPasswords[0]=brokerPassword -auth.sasl.jaas.zookeeperUser=zookeeperUser -auth.sasl.jaas.zookeeperPassword=zookeeperPassword -zookeeper.auth.enabled=true -zookeeper.auth.serverUsers=zookeeperUser -zookeeper.auth.serverPasswords=zookeeperPassword -zookeeper.auth.clientUser=zookeeperUser -zookeeper.auth.clientPassword=zookeeperPassword -``` - -You can deploy the chart with AclAuthorizer using the following parameters: - -```console -replicaCount=2 -auth.clientProtocol=sasl -auth.interBrokerProtocol=sasl_tls -auth.tls.existingSecrets[0]=kafka-jks-0 -auth.tls.existingSecrets[1]=kafka-jks-1 -auth.tls.password=jksPassword -auth.sasl.jaas.clientUsers[0]=brokerUser -auth.sasl.jaas.clientPasswords[0]=brokerPassword -auth.sasl.jaas.zookeeperUser=zookeeperUser -auth.sasl.jaas.zookeeperPassword=zookeeperPassword -zookeeper.auth.enabled=true -zookeeper.auth.serverUsers=zookeeperUser -zookeeper.auth.serverPasswords=zookeeperPassword -zookeeper.auth.clientUser=zookeeperUser -zookeeper.auth.clientPassword=zookeeperPassword -authorizerClassName=kafka.security.authorizer.AclAuthorizer -allowEveryoneIfNoAclFound=false -superUsers=User:admin -``` - -If you also enable exposing metrics using the Kafka exporter, 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. - -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. - -#### 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.service.nodePorts[0]='node-port-1' -externalAccess.service.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` or `externalAccess.service.useHostIPs` is provided. - -#### Name resolution with External-DNS - -You can use the following values to generate External-DNS annotations which automatically creates DNS records for each ReplicaSet pod: - -```yaml -externalAccess: - service: - annotations: - external-dns.alpha.kubernetes.io/hostname: "{{ .targetPod }}.example.com" -``` -### 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 -``` - -### Setting Pod's affinity - -This chart allows you to set your custom affinity using the `affinity` parameter. Find more information about Pod's affinity in the [kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity). - -As an alternative, you can use of the preset configurations for pod affinity, pod anti-affinity, and node affinity available at the [bitnami/common](https://github.com/bitnami/charts/tree/master/bitnami/common#affinities) chart. To do so, set the `podAffinityPreset`, `podAntiAffinityPreset`, or `nodeAffinityPreset` parameters. - -### 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 "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: connector - spec: - replicas: 1 - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - app.kubernetes.io/component: connector - template: - metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - app.kubernetes.io/component: connector - spec: - containers: - - name: connect - image: KAFKA-CONNECT-IMAGE - imagePullPolicy: IfNotPresent - ports: - - name: connector - containerPort: 8083 - volumeMounts: - - name: configuration - mountPath: /bitnami/kafka/config - volumes: - - name: configuration - configMap: - name: {{ include "kafka.fullname" . }}-connect - - | - apiVersion: v1 - kind: ConfigMap - metadata: - name: {{ include "kafka.fullname" . }}-connect - labels: {{- include "common.labels.standard" . | nindent 4 }} - 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 "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: connector - spec: - ports: - - protocol: TCP - port: 8083 - targetPort: connector - selector: {{- include "common.labels.matchLabels" . | nindent 4 }} - 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`. - -## Troubleshooting - -Find more information about how to deal with common errors related to Bitnami’s Helm charts in [this troubleshooting guide](https://docs.bitnami.com/general/how-to/troubleshoot-helm-chart-issues). - -## Upgrading - -### To 14.0.0 - -In this version, the `image` block is defined once and is used in the different templates, while in the previous version, the `image` block was duplicated for the main container and the provisioning one - -```yaml -image: - registry: docker.io - repository: bitnami/kafka - tag: 2.8.0 -``` -VS -```yaml -image: - registry: docker.io - repository: bitnami/kafka - tag: 2.8.0 -... -provisioning: - image: - registry: docker.io - repository: bitnami/kafka - tag: 2.8.0 -``` - -See [PR#7114](https://github.com/bitnami/charts/pull/7114) for more info about the implemented changes - -### To 13.0.0 - -This major updates the Zookeeper subchart to it newest major, 7.0.0, which renames all TLS-related settings. For more information on this subchart's major, please refer to [zookeeper upgrade notes](https://github.com/bitnami/charts/tree/master/bitnami/zookeeper#to-700). - -### To 12.2.0 - -This version also introduces `bitnami/common`, a [library chart](https://helm.sh/docs/topics/library_charts/#helm) as a dependency. More documentation about this new utility could be found [here](https://github.com/bitnami/charts/tree/master/bitnami/common#bitnami-common-library-chart). Please, make sure that you have updated the chart dependencies before executing any upgrade. - -### To 12.0.0 - -[On November 13, 2020, Helm v2 support was formally finished](https://github.com/helm/charts#status-of-the-project), this major version is the result of the required changes applied to the Helm Chart to be able to incorporate the different features added in Helm v3 and to be consistent with the Helm project itself regarding the Helm v2 EOL. - -**What changes were introduced in this major version?** - -- Previous versions of this Helm Chart use `apiVersion: v1` (installable by both Helm 2 and 3), this Helm Chart was updated to `apiVersion: v2` (installable by Helm 3 only). [Here](https://helm.sh/docs/topics/charts/#the-apiversion-field) you can find more information about the `apiVersion` field. -- Move dependency information from the *requirements.yaml* to the *Chart.yaml* -- After running `helm dependency update`, a *Chart.lock* file is generated containing the same structure used in the previous *requirements.lock* -- The different fields present in the *Chart.yaml* file has been ordered alphabetically in a homogeneous way for all the Bitnami Helm Charts - -**Considerations when upgrading to this version** - -- If you want to upgrade to this version from a previous one installed with Helm v3, you shouldn't face any issues -- If you want to upgrade to this version using Helm v2, this scenario is not supported as this version doesn't support Helm v2 anymore -- If you installed the previous version with Helm v2 and wants to upgrade to this version with Helm v3, please refer to the [official Helm documentation](https://helm.sh/docs/topics/v2_v3_migration/#migration-use-cases) about migrating from Helm v2 to v3 - -**Useful links** - -- https://docs.bitnami.com/tutorials/resolve-helm2-helm3-post-migration-issues/ -- https://helm.sh/docs/topics/v2_v3_migration/ -- https://helm.sh/blog/migrate-from-helm-v2-to-helm-v3/ - -### To 11.8.0 - -External access to brokers can now be achieved 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 athentication on Kafka is totally refactored allowing users to configure different authentication protocols on different listeners. Please check the [Listeners Configuration](#listeners-configuration) section 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 -``` - -## License - -Copyright © 2022 Bitnami - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. diff --git a/charts/kafka/files/tls/README.md b/charts/kafka/files/tls/README.md deleted file mode 100644 index e36b910..0000000 --- a/charts/kafka/files/tls/README.md +++ /dev/null @@ -1,26 +0,0 @@ -# TLS certificates - -You can copy here your JKS or PEM certificates. 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. - -> Note: DEPRECATED!! Please create a secret following the instructions available in the values.yaml instead of copying here your JKS or PEM certificates. - -## 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 - -## PEM certificates - -You can copy here your PEM certificates so a secret is created including them. Remember to use a CA (`kafka.truststore.pem`) and one certificate (`kafka.keystore.pem`) and key (`kafka.keystore.key`) 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.pem -- kafka-0.keystore.pem -- kafka-0.keystore.key -- kafka-1.keystore.pem -- kafka-1.keystore.key -- kafka-2.keystore.pem -- kafka-2.keystore.key diff --git a/charts/kafka/templates/NOTES.txt b/charts/kafka/templates/NOTES.txt deleted file mode 100644 index ed93cdf..0000000 --- a/charts/kafka/templates/NOTES.txt +++ /dev/null @@ -1,256 +0,0 @@ -CHART NAME: {{ .Chart.Name }} -CHART VERSION: {{ .Chart.Version }} -APP VERSION: {{ .Chart.AppVersion }} - -{{- if .Values.diagnosticMode.enabled }} -The chart has been deployed in diagnostic mode. All probes have been disabled and the command has been overwritten with: - - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 4 }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 4 }} - -Get the list of pods by executing: - - kubectl get pods --namespace {{ .Release.Namespace }} -l app.kubernetes.io/instance={{ .Release.Name }} - -Access the pod you want to debug by executing - - kubectl exec --namespace {{ .Release.Namespace }} -ti -- bash - -In order to replicate the container startup scripts execute this command: - - /opt/bitnami/scripts/kafka/entrypoint.sh /opt/bitnami/scripts/kafka/run.sh - -{{- else }} - -{{- $replicaCount := int .Values.replicaCount -}} -{{- $releaseNamespace := .Release.Namespace -}} -{{- $clusterDomain := .Values.clusterDomain -}} -{{- $fullname := include "kafka.fullname" . -}} -{{- $clientProtocol := include "kafka.listenerType" (dict "protocol" .Values.auth.clientProtocol) -}} -{{- $saslMechanisms := coalesce .Values.auth.sasl.mechanisms .Values.auth.saslMechanisms -}} -{{- $tlsEndpointIdentificationAlgorithm := default "" (coalesce .Values.auth.tls.endpointIdentificationAlgorithm .Values.auth.tlsEndpointIdentificationAlgorithm) -}} -{{- $tlsPassword := coalesce .Values.auth.tls.password .Values.auth.jksPassword -}} -{{- $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 --namespace {{ .Release.Namespace }} {{ .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 $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 with the content below: - - - kafka_jaas.conf: - -KafkaClient { -{{- if $saslMechanisms | regexFind "scram" }} -org.apache.kafka.common.security.scram.ScramLoginModule required -{{- else }} -org.apache.kafka.common.security.plain.PlainLoginModule required -{{- end }} -username="{{ index (coalesce .Values.auth.sasl.jaas.clientUsers .Values.auth.jaas.clientUsers) 0 }}" -password="$(kubectl get secret {{ $fullname }}-jaas --namespace {{ $releaseNamespace }} -o jsonpath='{.data.client-passwords}' | base64 --decode | cut -d , -f 1)"; -}; - - - client.properties: - -security.protocol={{ $clientProtocol }} -{{- if $saslMechanisms | regexFind "scram-sha-256" }} -sasl.mechanism=SCRAM-SHA-256 -{{- else if $saslMechanisms | regexFind "scram-sha-512" }} -sasl.mechanism=SCRAM-SHA-512 -{{- else }} -sasl.mechanism=PLAIN -{{- end }} -{{- if eq $clientProtocol "SASL_SSL" }} -ssl.truststore.type={{ upper .Values.auth.tls.type }} - {{- if eq .Values.auth.tls.type "jks" }} -ssl.truststore.location=/tmp/kafka.truststore.jks - {{- if not (empty $tlsPassword) }} -ssl.truststore.password={{ $tlsPassword }} - {{- end }} - {{- else if eq .Values.auth.tls.type "pem" }} -ssl.truststore.certificates=-----BEGIN CERTIFICATE----- \ -... \ ------END CERTIFICATE----- - {{- end }} - {{- if eq $tlsEndpointIdentificationAlgorithm "" }} -ssl.endpoint.identification.algorithm= - {{- end }} -{{- end }} - -{{- else if (include "kafka.client.tlsEncryption" .) }} - -You need to configure your Kafka client to access using TLS authentication. To do so, you need to create the 'client.properties' configuration file with the content below: - -security.protocol={{ $clientProtocol }} -ssl.truststore.type={{ upper .Values.auth.tls.type }} -{{- if eq .Values.auth.tls.type "jks" }} -ssl.truststore.location=/tmp/kafka.truststore.{{ .Values.auth.tls.type }} - {{- if not (empty $tlsPassword) }} -ssl.truststore.password={{ $tlsPassword }} - {{- end }} -{{- else if eq .Values.auth.tls.type "pem" }} -ssl.truststore.certificates=-----BEGIN CERTIFICATE----- \ -... \ ------END CERTIFICATE----- -{{- end }} -{{- if eq .Values.auth.clientProtocol "mtls" }} -ssl.keystore.type={{ upper .Values.auth.tls.type }} - {{- if eq .Values.auth.tls.type "jks" }} -ssl.keystore.location=/tmp/client.keystore.jks - {{- if not (empty $tlsPassword) }} -ssl.keystore.password={{ $tlsPassword }} - {{- end }} - {{- else if eq .Values.auth.tls.type "pem" }} -ssl.keystore.certificate.chain=-----BEGIN CERTIFICATE----- \ -... \ ------END CERTIFICATE----- -ssl.keystore.key=-----BEGIN ENCRYPTED PRIVATE KEY----- \ -... \ ------END ENCRYPTED PRIVATE KEY----- - {{- end }} -{{- end }} -{{- if eq $tlsEndpointIdentificationAlgorithm "" }} -ssl.endpoint.identification.algorithm= -{{- end }} - -{{- 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 or (include "kafka.client.saslAuthentication" .) (include "kafka.client.tlsEncryption" .) }} - kubectl cp --namespace {{ $releaseNamespace }} /path/to/client.properties {{ $fullname }}-client:/tmp/client.properties - {{- end }} - {{- if (include "kafka.client.saslAuthentication" .) }} - kubectl cp --namespace {{ $releaseNamespace }} /path/to/kafka_jaas.conf {{ $fullname }}-client:/tmp/kafka_jaas.conf - {{- end }} - {{- if and (include "kafka.client.tlsEncryption" .) (eq .Values.auth.tls.type "jks") }} - kubectl cp --namespace {{ $releaseNamespace }} ./kafka.truststore.jks {{ $fullname }}-client:/tmp/kafka.truststore.jks - {{- if eq .Values.auth.clientProtocol "mtls" }} - kubectl cp --namespace {{ $releaseNamespace }} ./client.keystore.jks {{ $fullname }}-client:/tmp/client.keystore.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 or (include "kafka.client.saslAuthentication" .) (include "kafka.client.tlsEncryption" .) }}--producer.config /tmp/client.properties \{{ end }} - --broker-list {{ join "," $brokerList }} \ - --topic test - - CONSUMER: - kafka-console-consumer.sh \ - {{ if or (include "kafka.client.saslAuthentication" .) (include "kafka.client.tlsEncryption" .) }}--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 }} -{{- end }} - -{{- include "common.warnings.rollingTag" .Values.image }} -{{- include "common.warnings.rollingTag" .Values.externalAccess.autoDiscovery.image }} -{{- include "common.warnings.rollingTag" .Values.metrics.kafka.image }} -{{- include "common.warnings.rollingTag" .Values.metrics.jmx.image }} -{{- include "common.warnings.rollingTag" .Values.volumePermissions.image }} -{{- include "kafka.validateValues" . }} diff --git a/charts/kafka/templates/_helpers.tpl b/charts/kafka/templates/_helpers.tpl deleted file mode 100644 index 926eb3a..0000000 --- a/charts/kafka/templates/_helpers.tpl +++ /dev/null @@ -1,407 +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" -}} -{{- include "common.names.fullname" . -}} -{{- 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" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper image name (for the init container auto-discovery image) -*/}} -{{- define "kafka.externalAccess.autoDiscovery.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.externalAccess.autoDiscovery.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper image name (for the init container volume-permissions image) -*/}} -{{- define "kafka.volumePermissions.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.volumePermissions.image "global" .Values.global) }} -{{- end -}} - -{{/* -Create a default fully qualified Kafka exporter name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -*/}} -{{- define "kafka.metrics.kafka.fullname" -}} - {{- printf "%s-exporter" (include "kafka.fullname" .) | trunc 63 | trimSuffix "-" }} -{{- end -}} - -{{/* - Create the name of the service account to use for Kafka exporer pods - */}} -{{- define "kafka.metrics.kafka.serviceAccountName" -}} -{{- if .Values.metrics.kafka.serviceAccount.create -}} - {{ default (include "kafka.metrics.kafka.fullname" .) .Values.metrics.kafka.serviceAccount.name }} -{{- else -}} - {{ default "default" .Values.metrics.kafka.serviceAccount.name }} -{{- end -}} -{{- end -}} - -{{/* -Return the proper Kafka exporter image name -*/}} -{{- define "kafka.metrics.kafka.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.metrics.kafka.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper JMX exporter image name -*/}} -{{- define "kafka.metrics.jmx.image" -}} -{{ include "common.images.image" (dict "imageRoot" .Values.metrics.jmx.image "global" .Values.global) }} -{{- end -}} - -{{/* -Return the proper Docker Image Registry Secret Names -*/}} -{{- define "kafka.imagePullSecrets" -}} -{{ include "common.images.pullSecrets" (dict "images" (list .Values.image .Values.externalAccess.autoDiscovery.image .Values.volumePermissions.image .Values.metrics.kafka.image .Values.metrics.jmx.image) "global" .Values.global) }} -{{- 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 for client connections should be configured -*/}} -{{- define "kafka.client.tlsEncryption" -}} -{{- $tlsProtocols := list "tls" "mtls" "sasl_tls" -}} -{{- if (has .Values.auth.clientProtocol $tlsProtocols) -}} - {{- true -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if encryption via TLS for inter broker communication connections should be configured -*/}} -{{- define "kafka.interBroker.tlsEncryption" -}} -{{- $tlsProtocols := list "tls" "mtls" "sasl_tls" -}} -{{- if (has .Values.auth.interBrokerProtocol $tlsProtocols) -}} - {{- true -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if encryption via TLS should be configured -*/}} -{{- define "kafka.tlsEncryption" -}} -{{- if or (include "kafka.client.tlsEncryption" .) (include "kafka.interBroker.tlsEncryption" .) -}} - {{- 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 Kafka JAAS credentials secret -*/}} -{{- define "kafka.jaasSecretName" -}} -{{- $secretName := coalesce .Values.auth.sasl.jaas.existingSecret .Values.auth.jaas.existingSecret -}} -{{- if $secretName -}} - {{- printf "%s" (tpl $secretName $) -}} -{{- else -}} - {{- printf "%s-jaas" (include "kafka.fullname" .) -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if a JAAS credentials secret object should be created -*/}} -{{- define "kafka.createJaasSecret" -}} -{{- $secretName := coalesce .Values.auth.sasl.jaas.existingSecret .Values.auth.jaas.existingSecret -}} -{{- if and (or (include "kafka.client.saslAuthentication" .) (include "kafka.interBroker.saslAuthentication" .) (and .Values.zookeeper.auth.enabled .Values.auth.jaas.zookeeperUser)) (empty $secretName) -}} - {{- true -}} -{{- end -}} -{{- end -}} - -{{/* -Return true if a TLS credentials secret object should be created -*/}} -{{- define "kafka.createTlsSecret" -}} -{{- $secretName := coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret -}} -{{- if and (include "kafka.tlsEncryption" .) (empty .Values.auth.tls.existingSecrets) (empty $secretName) (eq .Values.auth.tls.type "jks") (.Files.Glob "files/tls/*.jks") }} - {{- true -}} -{{- else if and (include "kafka.tlsEncryption" .) (empty .Values.auth.tls.existingSecrets) (empty $secretName) (eq .Values.auth.tls.type "pem") (or (.Files.Glob "files/tls/*.{crt,pem}") .Values.auth.tls.autoGenerated) }} - {{- 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 SASL mechanism to use for the Kafka exporter to access Kafka -The exporter uses a different nomenclature so we need to do this hack -*/}} -{{- define "kafka.metrics.kafka.saslMechanism" -}} -{{- $saslMechanisms := coalesce .Values.auth.sasl.mechanisms .Values.auth.saslMechanisms }} -{{- if contains "scram-sha-512" $saslMechanisms }} - {{- printf "scram-sha512" -}} -{{- else if contains "scram-sha-256" $saslMechanisms }} - {{- printf "scram-sha256" -}} -{{- else -}} - {{- printf "plain" -}} -{{- 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 -}} - -{{/* -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.saslMechanisms" .) -}} -{{- $messages := append $messages (include "kafka.validateValues.tlsSecrets" .) -}} -{{- $messages := append $messages (include "kafka.validateValues.tlsSecrets.length" .) -}} -{{- $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 service 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 auto-detect 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 - 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") (and .Values.zookeeper.auth.enabled .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 -}} - -{{/* Validate values of Kafka - Secrets containing TLS certs must be provided when TLS authentication is enabled */}} -{{- define "kafka.validateValues.tlsSecrets" -}} -{{- $secretName := coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret -}} -{{- if and (include "kafka.tlsEncryption" .) (eq .Values.auth.tls.type "jks") (empty .Values.auth.tls.existingSecrets) (empty $secretName) (not (.Files.Glob "files/tls/*.jks}")) }} -kafka: auth.tls.existingSecret - A secret containing the Kafka JKS keystores and truststore is required - when TLS encryption in enabled and TLS format is "JKS" -{{- else if and (include "kafka.tlsEncryption" .) (eq .Values.auth.tls.type "pem") (empty .Values.auth.tls.existingSecrets) (empty $secretName) (not (.Files.Glob "files/tls/*.{crt,pem}")) (not .Values.auth.tls.autoGenerated) }} -kafka: auth.tls.existingSecret - A secret containing the Kafka TLS certificates and keys is required - when TLS encryption in enabled and TLS format is "PEM" -{{- end -}} -{{- end -}} - -{{/* Validate values of Kafka - The number of secrets containing TLS certs should be equal to the number of replicas */}} -{{- define "kafka.validateValues.tlsSecrets.length" -}} -{{- $replicaCount := int .Values.replicaCount }} -{{- if and (include "kafka.tlsEncryption" .) (not (empty .Values.auth.tls.existingSecrets)) }} -{{- $existingSecretsLength := len .Values.auth.tls.existingSecrets }} -{{- if ne $replicaCount $existingSecretsLength }} -kafka: .Values.auth.tls.existingSecrets - Number of replicas and existingSecrets array length must be the same. Currently: replicaCount = {{ $replicaCount }} and existingSecrets = {{ $existingSecretsLength }} -{{- end -}} -{{- end -}} -{{- end -}} diff --git a/charts/kafka/templates/configmap.yaml b/charts/kafka/templates/configmap.yaml deleted file mode 100644 index 717c0c7..0000000 --- a/charts/kafka/templates/configmap.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if (include "kafka.createConfigmap" .) }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "kafka.fullname" . }}-configuration - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -data: - server.properties: |- - {{ .Values.config | nindent 4 }} -{{- end -}} diff --git a/charts/kafka/templates/extra-list.yaml b/charts/kafka/templates/extra-list.yaml deleted file mode 100644 index 9ac65f9..0000000 --- a/charts/kafka/templates/extra-list.yaml +++ /dev/null @@ -1,4 +0,0 @@ -{{- range .Values.extraDeploy }} ---- -{{ include "common.tplvalues.render" (dict "value" . "context" $) }} -{{- end }} diff --git a/charts/kafka/templates/jaas-secret.yaml b/charts/kafka/templates/jaas-secret.yaml deleted file mode 100644 index 7fa3a92..0000000 --- a/charts/kafka/templates/jaas-secret.yaml +++ /dev/null @@ -1,37 +0,0 @@ -{{- if (include "kafka.createJaasSecret" .) }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ template "kafka.fullname" . }}-jaas - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -type: Opaque -data: - {{- if (include "kafka.client.saslAuthentication" .) }} - {{- $clientUsers := coalesce .Values.auth.sasl.jaas.clientUsers .Values.auth.jaas.clientUsers }} - {{- $clientPasswords := coalesce .Values.auth.sasl.jaas.clientPasswords .Values.auth.jaas.clientPasswords }} - {{- if $clientPasswords }} - client-passwords: {{ join "," $clientPasswords | b64enc | quote }} - {{- else }} - {{- $passwords := list }} - {{- range $clientUsers }} - {{- $passwords = append $passwords (randAlphaNum 10) }} - {{- end }} - client-passwords: {{ join "," $passwords | b64enc | quote }} - {{- end }} - {{- end }} - {{- $zookeeperUser := coalesce .Values.auth.sasl.jaas.zookeeperUser .Values.auth.jaas.zookeeperUser }} - {{- if and .Values.zookeeper.auth.enabled $zookeeperUser }} - {{- $zookeeperPassword := coalesce .Values.auth.sasl.jaas.zookeeperPassword .Values.auth.jaas.zookeeperPassword }} - zookeeper-password: {{ default (randAlphaNum 10) $zookeeperPassword | b64enc | quote }} - {{- end }} - {{- if (include "kafka.interBroker.saslAuthentication" .) }} - {{- $interBrokerPassword := coalesce .Values.auth.sasl.jaas.interBrokerPassword .Values.auth.jaas.interBrokerPassword }} - inter-broker-password: {{ default (randAlphaNum 10) $interBrokerPassword | b64enc | quote }} - {{- end }} -{{- end }} diff --git a/charts/kafka/templates/jmx-configmap.yaml b/charts/kafka/templates/jmx-configmap.yaml deleted file mode 100644 index 9a24a94..0000000 --- a/charts/kafka/templates/jmx-configmap.yaml +++ /dev/null @@ -1,59 +0,0 @@ -{{- if (include "kafka.metrics.jmx.createConfigmap" .) }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "kafka.fullname" . }}-jmx-configuration - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -data: - jmx-kafka-prometheus.yml: |- - {{- include "common.tplvalues.render" ( dict "value" .Values.metrics.jmx.config "context" $ ) | nindent 4 }} - rules: - - pattern: kafka.controller<>(Value) - name: kafka_controller_$1_$2_$4 - labels: - broker_id: "$3" - - pattern: kafka.controller<>(Value) - name: kafka_controller_$1_$2_$3 - - pattern: kafka.controller<>(Value) - name: kafka_controller_$1_$2_$3 - - pattern: kafka.controller<>(Count) - name: kafka_controller_$1_$2_$3 - - pattern: kafka.server<>(Value) - name: kafka_server_$1_$2_$4 - labels: - client_id: "$3" - - pattern : kafka.network<>(Value) - name: kafka_network_$1_$2_$4 - labels: - network_processor: $3 - - pattern : kafka.network<>(Count) - name: kafka_network_$1_$2_$4 - labels: - request: $3 - - pattern: kafka.server<>(Count|OneMinuteRate) - name: kafka_server_$1_$2_$4 - labels: - topic: $3 - - pattern: kafka.server<>(Value) - name: kafka_server_$1_$2_$3_$4 - - pattern: kafka.server<>(Count|Value|OneMinuteRate) - name: kafka_server_$1_total_$2_$3 - - pattern: kafka.server<>(queue-size) - name: kafka_server_$1_$2 - - pattern: java.lang<(.+)>(\w+) - name: java_lang_$1_$4_$3_$2 - - pattern: java.lang<>(\w+) - name: java_lang_$1_$3_$2 - - pattern : java.lang - - pattern: kafka.log<>Value - name: kafka_log_$1_$2 - labels: - topic: $3 - partition: $4 -{{- end -}} diff --git a/charts/kafka/templates/jmx-metrics-svc.yaml b/charts/kafka/templates/jmx-metrics-svc.yaml deleted file mode 100644 index 9f70d66..0000000 --- a/charts/kafka/templates/jmx-metrics-svc.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- if .Values.metrics.jmx.enabled }} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "kafka.fullname" . }}-jmx-metrics - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( 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 "common.tplvalues.render" ( dict "value" .Values.metrics.jmx.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( 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 "common.labels.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: kafka -{{- end }} diff --git a/charts/kafka/templates/kafka-metrics-deployment.yaml b/charts/kafka/templates/kafka-metrics-deployment.yaml deleted file mode 100644 index 3a79bf1..0000000 --- a/charts/kafka/templates/kafka-metrics-deployment.yaml +++ /dev/null @@ -1,137 +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: {{ include "common.capabilities.deployment.apiVersion" . }} -kind: Deployment -metadata: - name: {{ template "kafka.metrics.kafka.fullname" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - replicas: 1 - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - app.kubernetes.io/component: metrics - template: - metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - app.kubernetes.io/component: metrics - {{- if .Values.metrics.kafka.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.kafka.podLabels "context" $) | nindent 8 }} - {{- end }} - annotations: - {{- if .Values.metrics.kafka.podAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.kafka.podAnnotations "context" $) | nindent 8 }} - {{- end }} - spec: - {{- include "kafka.imagePullSecrets" . | nindent 6 }} - {{- if .Values.metrics.kafka.schedulerName }} - schedulerName: {{ .Values.metrics.kafka.schedulerName | quote }} - {{- end }} - serviceAccountName: {{ template "kafka.metrics.kafka.serviceAccountName" . }} - {{- if .Values.metrics.kafka.initContainers }} - initContainers: {{- include "common.tplvalues.render" (dict "value" .Values.metrics.kafka.initContainers "context" $) | nindent 8 }} - {{- end }} - containers: - - name: kafka-exporter - image: {{ include "kafka.metrics.kafka.image" . }} - imagePullPolicy: {{ .Values.metrics.kafka.image.pullPolicy | quote }} - {{- if .Values.metrics.kafka.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.metrics.kafka.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.diagnosticMode.enabled }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} - {{- else }} - command: - - /bin/bash - - -ec - - | - 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_USER_PASSWORD%%,*}" \ - --sasl.mechanism="{{ include "kafka.metrics.kafka.saslMechanism" . }}" \ - {{- end }} - {{- if (include "kafka.client.tlsEncryption" .) }} - --tls.enabled \ - {{- if .Values.metrics.kafka.certificatesSecret }} - --tls.key-file="/opt/bitnami/kafka-exporter/certs/{{ .Values.metrics.kafka.tlsKey }}" \ - --tls.cert-file="/opt/bitnami/kafka-exporter/certs/{{ .Values.metrics.kafka.tlsCert }}" \ - {{- if .Values.metrics.kafka.tlsCaSecret }} - --tls.ca-file="/opt/bitnami/kafka-exporter/cacert/{{ .Values.metrics.kafka.tlsCaCert }}" \ - {{- else }} - --tls.ca-file="/opt/bitnami/kafka-exporter/certs/{{ .Values.metrics.kafka.tlsCaCert }}" \ - {{- end }} - {{- end }} - {{- end }} - {{- range $key, $value := .Values.metrics.kafka.extraFlags }} - --{{ $key }}{{ if $value }}={{ $value }}{{ end }} \ - {{- end }} - --web.listen-address=:9308 - {{- if (include "kafka.client.saslAuthentication" .) }} - {{- $clientUsers := coalesce .Values.auth.sasl.jaas.clientUsers .Values.auth.jaas.clientUsers }} - env: - - name: SASL_USERNAME - value: {{ index $clientUsers 0 | quote }} - - name: SASL_USER_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "kafka.jaasSecretName" . }} - key: client-passwords - {{- end }} - {{- end }} - ports: - - name: metrics - containerPort: 9308 - {{- if .Values.metrics.kafka.resources }} - resources: {{ toYaml .Values.metrics.kafka.resources | nindent 12 }} - {{- end }} - {{- if and (include "kafka.client.tlsEncryption" .) .Values.metrics.kafka.certificatesSecret }} - volumeMounts: - - name: kafka-exporter-certificates - mountPath: /opt/bitnami/kafka-exporter/certs/ - readOnly: true - {{- if .Values.metrics.kafka.tlsCaSecret }} - - name: kafka-exporter-ca-certificate - mountPath: /opt/bitnami/kafka-exporter/cacert/ - readOnly: true - {{- end }} - volumes: - - name: kafka-exporter-certificates - secret: - secretName: {{ .Values.metrics.kafka.certificatesSecret }} - defaultMode: 0440 - {{- if .Values.metrics.kafka.tlsCaSecret }} - - name: kafka-exporter-ca-certificate - secret: - secretName: {{ .Values.metrics.kafka.tlsCaSecret }} - defaultMode: 0440 - {{- end }} - {{- end }} - {{- if .Values.metrics.kafka.affinity }} - affinity: - {{ toYaml .Values.metrics.kafka.affinity | nindent 8 }} - {{- end }} - {{- if .Values.metrics.kafka.tolerations }} - tolerations: - {{ toYaml .Values.metrics.kafka.tolerations | nindent 8 }} - {{- end }} - {{- if .Values.metrics.kafka.nodeSelector }} - nodeSelector: - {{ toYaml .Values.metrics.kafka.nodeSelector | nindent 8 }} - {{- end }} -{{- end }} diff --git a/charts/kafka/templates/kafka-metrics-serviceaccount.yaml b/charts/kafka/templates/kafka-metrics-serviceaccount.yaml deleted file mode 100644 index 7dc4e20..0000000 --- a/charts/kafka/templates/kafka-metrics-serviceaccount.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if and .Values.metrics.kafka.enabled .Values.metrics.kafka.serviceAccount.create }} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "kafka.metrics.kafka.serviceAccountName" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.metrics.kafka.serviceAccount.automountServiceAccountToken }} -{{- end }} diff --git a/charts/kafka/templates/kafka-metrics-svc.yaml b/charts/kafka/templates/kafka-metrics-svc.yaml deleted file mode 100644 index b123d43..0000000 --- a/charts/kafka/templates/kafka-metrics-svc.yaml +++ /dev/null @@ -1,45 +0,0 @@ -{{- if .Values.metrics.kafka.enabled }} -apiVersion: v1 -kind: Service -metadata: - name: {{ template "kafka.fullname" . }}-metrics - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( 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 "common.tplvalues.render" ( dict "value" .Values.metrics.kafka.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( 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 "common.labels.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: metrics -{{- end }} diff --git a/charts/kafka/templates/kafka-provisioning.yaml b/charts/kafka/templates/kafka-provisioning.yaml deleted file mode 100644 index 24337c3..0000000 --- a/charts/kafka/templates/kafka-provisioning.yaml +++ /dev/null @@ -1,164 +0,0 @@ -{{- if .Values.provisioning.enabled }} -{{- $replicaCount := int .Values.replicaCount }} -kind: Job -apiVersion: batch/v1 -metadata: - name: {{ include "kafka.fullname" . }}-provisioning - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka-provisioning - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - annotations: - helm.sh/hook: post-install,post-upgrade - helm.sh/hook-delete-policy: before-hook-creation - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - template: - metadata: - labels: {{- include "common.labels.standard" . | nindent 8 }} - app.kubernetes.io/component: kafka-provisioning - {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" (dict "value" .Values.podLabels "context" $) | nindent 8 }} - {{- end }} - annotations: - {{- if .Values.provisioning.podAnnotations }} - {{- include "common.tplvalues.render" (dict "value" .Values.provisioning.podAnnotations "context" $) | nindent 8 }} - {{- end }} - spec: - {{- include "kafka.imagePullSecrets" . | nindent 6 }} - {{- if .Values.provisioning.schedulerName }} - schedulerName: {{ .Values.provisioning.schedulerName | quote }} - {{- end }} - restartPolicy: OnFailure - terminationGracePeriodSeconds: 0 - initContainers: - - name: wait-for-available-kafka - image: {{ include "kafka.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy | quote }} - command: - - /bin/bash - - -c - - >- - set -e; - wait-for-port \ - --host={{ include "kafka.fullname" . }} \ - --state=inuse \ - --timeout=120 \ - {{ .Values.service.port | int64 }}; - echo "Kafka is available"; - {{- if .Values.provisioning.resources }} - resources: {{- toYaml .Values.provisioning.resources | nindent 12 }} - {{- end }} - containers: - - name: kafka-provisioning - image: {{ include "kafka.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy | quote }} - {{- if .Values.diagnosticMode.enabled }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} - {{- else }} - command: - {{- if .Values.provisioning.command }} - {{- include "common.tplvalues.render" (dict "value" .Values.provisioning.command "context" $) | nindent 12 }} - {{- else }} - - /bin/bash - {{- end }} - {{- end }} - {{- if .Values.diagnosticMode.enabled }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} - {{- else }} - args: - {{- if .Values.provisioning.args }} - {{- include "common.tplvalues.render" (dict "value" .Values.provisioning.args "context" $) | nindent 12 }} - {{- else }} - - -ec - - | - {{- $bootstrapServer := printf "%s:%d" (include "kafka.fullname" .) (.Values.service.port | int64) }} - {{- range $topic := .Values.provisioning.topics }} - echo "Ensure topic '{{ $topic.name }}' exists" - /opt/bitnami/kafka/bin/kafka-topics.sh \ - --create \ - --if-not-exists \ - --bootstrap-server {{ $bootstrapServer }} \ - --replication-factor {{ $topic.replicationFactor | default $.Values.provisioning.replicationFactor }} \ - --partitions {{ $topic.partitions | default $.Values.provisioning.numPartitions }} \ - {{- range $name, $value := $topic.config }} - --config {{ $name }}={{ $value }} \ - {{- end }} - --topic {{ $topic.name }} - {{- end }} - echo "Provisioning succeeded" - {{- end }} - {{- end }} - env: - - name: BITNAMI_DEBUG - value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | quote }} - {{- if .Values.provisioning.resources }} - resources: {{- toYaml .Values.provisioning.resources | nindent 12 }} - {{- end }} - volumeMounts: - {{- if or .Values.config .Values.existingConfigmap }} - - name: kafka-config - mountPath: {{ .Values.persistence.mountPath }}/config/server.properties - subPath: server.properties - {{- end }} - {{- if or .Values.log4j .Values.existingLog4jConfigMap }} - - name: log4j-config - mountPath: {{ .Values.persistence.mountPath }}/config/log4j.properties - subPath: log4j.properties - {{- end }} - {{- if (include "kafka.tlsEncryption" .) }} - {{- if not (empty .Values.auth.tls.existingSecrets) }} - {{- range $index := .Values.auth.tls.existingSecrets }} - - name: kafka-certs-{{ $index }} - mountPath: /certs-{{ $index }} - readOnly: true - {{- end }} - {{- else if or (not (empty (coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret))) (.Files.Glob "files/tls/*.{crt,pem}") }} - - name: kafka-certs - mountPath: /certs - readOnly: true - {{- else if .Values.auth.tls.autoGenerated }} - {{- range $index := until $replicaCount }} - - name: kafka-certs-{{ $index }} - mountPath: /certs-{{ $index }} - readOnly: true - {{- end }} - {{- end }} - {{- 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 }} - {{- if (include "kafka.tlsEncryption" .) }} - {{- if not (empty .Values.auth.tls.existingSecrets) }} - {{- range $index, $secret := .Values.auth.tls.existingSecrets }} - - name: kafka-certs-{{ $index }} - secret: - secretName: {{ tpl $secret $ }} - defaultMode: 256 - {{- end }} - {{- else if or (not (empty (coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret))) (.Files.Glob "files/tls/*.{crt,pem}") }} - - name: kafka-certs - secret: - secretName: {{ if not (empty (coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret)) }}{{ tpl (coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret) . }}{{ else }}{{ printf "%s-tls" (include "kafka.fullname" .) }}{{ end }} - defaultMode: 256 - {{- else if .Values.auth.tls.autoGenerated }} - {{- range $index := until $replicaCount }} - - name: kafka-certs-{{ $index }} - secret: - secretName: {{ printf "%s-%d-tls" (include "kafka.fullname" $) $index }} - defaultMode: 256 - {{- end }} - {{- end }} - {{- end }} -{{- end }} diff --git a/charts/kafka/templates/log4j-configmap.yaml b/charts/kafka/templates/log4j-configmap.yaml deleted file mode 100644 index 90eccde..0000000 --- a/charts/kafka/templates/log4j-configmap.yaml +++ /dev/null @@ -1,16 +0,0 @@ -{{- if (include "kafka.log4j.createConfigMap" .) }} -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ include "kafka.log4j.configMapName" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -data: - log4j.properties: |- - {{- include "common.tplvalues.render" ( dict "value" .Values.log4j "context" $ ) | nindent 4 }} -{{- end -}} diff --git a/charts/kafka/templates/networkpolicy-egress.yaml b/charts/kafka/templates/networkpolicy-egress.yaml deleted file mode 100644 index 16f66a1..0000000 --- a/charts/kafka/templates/networkpolicy-egress.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- if and .Values.networkPolicy.enabled .Values.networkPolicy.egressRules.customRules }} -kind: NetworkPolicy -apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }} -metadata: - name: {{ printf "%s-egress" (include "common.names.fullname" .) }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} -spec: - podSelector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 6 }} - policyTypes: - - Egress - egress: - {{- include "common.tplvalues.render" (dict "value" .Values.networkPolicy.egressRules.customRules "context" $) | nindent 4 }} -{{- end }} diff --git a/charts/kafka/templates/networkpolicy-ingress.yaml b/charts/kafka/templates/networkpolicy-ingress.yaml deleted file mode 100644 index 56e9417..0000000 --- a/charts/kafka/templates/networkpolicy-ingress.yaml +++ /dev/null @@ -1,54 +0,0 @@ -{{- if .Values.networkPolicy.enabled }} -kind: NetworkPolicy -apiVersion: {{ include "common.capabilities.networkPolicy.apiVersion" . }} -metadata: - name: {{ printf "%s-ingress" (include "common.names.fullname" .) }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} - namespace: {{ .Release.Namespace }} -spec: - podSelector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 6 }} - policyTypes: - - Ingress - ingress: - # Allow client connections - - ports: - - port: {{ .Values.service.port }} - {{- if not .Values.networkPolicy.allowExternal }} - from: - - podSelector: - matchLabels: - {{ template "common.names.fullname" . }}-client: "true" - {{- if .Values.networkPolicy.explicitNamespacesSelector }} - namespaceSelector: -{{ toYaml .Values.networkPolicy.explicitNamespacesSelector | indent 12 }} - {{- end }} - {{- end }} - # Allow communication inter-broker - - ports: - - port: {{ .Values.service.internalPort }} - from: - - podSelector: - matchLabels: - {{- include "common.labels.matchLabels" . | nindent 14 }} - # Allow External connection - {{- if .Values.externalAccess.enabled }} - - ports: - - port: {{ .Values.service.externalPort }} - {{- if .Values.externalAccess.from }} - from: {{- include "common.tplvalues.render" ( dict "value" .Values.networkPolicy.externalAccess.from "context" $ ) | nindent 8 }} - {{- end }} - {{- end }} - {{- if .Values.metrics.kafka.enabled }} - # Allow prometheus scrapes - - ports: - - port: {{ .Values.metrics.kafka.service.port }} - {{- end }} -{{- end }} diff --git a/charts/kafka/templates/poddisruptionbudget.yaml b/charts/kafka/templates/poddisruptionbudget.yaml deleted file mode 100644 index 972f82a..0000000 --- a/charts/kafka/templates/poddisruptionbudget.yaml +++ /dev/null @@ -1,25 +0,0 @@ -{{- $replicaCount := int .Values.replicaCount }} -{{- if and .Values.pdb.create (gt $replicaCount 1) }} -apiVersion: {{ include "common.capabilities.policy.apiVersion" . }} -kind: PodDisruptionBudget -metadata: - name: {{ template "kafka.fullname" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( 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 "common.labels.matchLabels" . | nindent 6 }} - app.kubernetes.io/component: kafka -{{- end }} diff --git a/charts/kafka/templates/role.yaml b/charts/kafka/templates/role.yaml deleted file mode 100644 index 08e2784..0000000 --- a/charts/kafka/templates/role.yaml +++ /dev/null @@ -1,23 +0,0 @@ -{{- if .Values.rbac.create -}} -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -kind: Role -metadata: - name: {{ template "kafka.fullname" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -rules: - - apiGroups: - - "" - resources: - - services - verbs: - - get - - list - - watch -{{- end -}} diff --git a/charts/kafka/templates/rolebinding.yaml b/charts/kafka/templates/rolebinding.yaml deleted file mode 100644 index 7c69df0..0000000 --- a/charts/kafka/templates/rolebinding.yaml +++ /dev/null @@ -1,22 +0,0 @@ -{{- if and .Values.serviceAccount.create .Values.rbac.create }} -apiVersion: {{ include "common.capabilities.rbac.apiVersion" . }} -kind: RoleBinding -metadata: - name: {{ template "kafka.fullname" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( 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 }} diff --git a/charts/kafka/templates/scripts-configmap.yaml b/charts/kafka/templates/scripts-configmap.yaml deleted file mode 100644 index fad9595..0000000 --- a/charts/kafka/templates/scripts-configmap.yaml +++ /dev/null @@ -1,160 +0,0 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: {{ template "kafka.fullname" . }}-scripts - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( 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 }} - {{- $jksTruststoreSecret := coalesce .Values.auth.tls.jksTruststoreSecret .Values.auth.jksTruststoreSecret -}} - {{- $jksTruststore := coalesce .Values.auth.tls.jksTruststore .Values.auth.jksTruststore -}} - {{- $jksKeystoreSAN := coalesce .Values.auth.tls.jksKeystoreSAN .Values.auth.jksKeystoreSAN -}} - {{- if .Values.externalAccess.autoDiscovery.enabled }} - auto-discovery.sh: |- - #!/bin/bash - - SVC_NAME="${MY_POD_NAME}-external" - - {{- if eq .Values.externalAccess.service.type "LoadBalancer" }} - # Auxiliary 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 }}-"}" - if [[ -f "/bitnami/kafka/data/meta.properties" ]]; then - export KAFKA_CFG_BROKER_ID="$(grep "broker.id" /bitnami/kafka/data/meta.properties | awk -F '=' '{print $2}')" - else - export KAFKA_CFG_BROKER_ID="$((ID + {{ .Values.minBrokerId }}))" - fi - - {{- 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 and .Values.externalAccess.service.usePodIPs .Values.externalAccess.autoDiscovery.enabled }} - export EXTERNAL_ACCESS_IP="${MY_POD_IP}" - {{- else if or .Values.externalAccess.service.useHostIPs .Values.externalAccess.autoDiscovery.enabled }} - export EXTERNAL_ACCESS_IP="${HOST_IP}" - {{- else 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={{ join "," .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" .) }} - mkdir -p /opt/bitnami/kafka/config/certs - {{- if eq .Values.auth.tls.type "jks" }} - {{- if not (empty .Values.auth.tls.existingSecrets) }} - JKS_TRUSTSTORE={{ printf "/%s/%s" (ternary "certs-${ID}" "truststore" (empty $jksTruststoreSecret)) (default "kafka.truststore.jks" $jksTruststore) | quote }} - JKS_KEYSTORE="/certs-${ID}/kafka-keystore.jks" - {{- else }} - JKS_TRUSTSTORE={{ printf "/%s/%s" (ternary "certs" "truststore" (empty $jksTruststoreSecret)) (default "kafka.truststore.jks" $jksTruststore) | quote }} - JKS_KEYSTORE={{ printf "/certs/%s" (default "kafka-${ID}.keystore.jks" $jksKeystoreSAN) | quote }} - {{- end }} - if [[ -f "$JKS_TRUSTSTORE" ]] && [[ -f "$JKS_KEYSTORE" ]]; then - cp "$JKS_TRUSTSTORE" "/opt/bitnami/kafka/config/certs/kafka.truststore.jks" - cp "$JKS_KEYSTORE" "/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 - export KAFKA_TLS_TRUSTSTORE_FILE="/opt/bitnami/kafka/config/certs/kafka.truststore.jks" - - {{- else if eq .Values.auth.tls.type "pem" }} - {{- if or (not (empty .Values.auth.tls.existingSecrets)) (and .Values.auth.tls.autoGenerated (empty (coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret)) (not (.Files.Glob "files/tls/*.{crt,pem}"))) }} - PEM_CA="/certs-${ID}/ca.crt" - PEM_CERT="/certs-${ID}/tls.crt" - PEM_KEY="/certs-${ID}/tls.key" - {{- else }} - PEM_CA="/certs/kafka.truststore.pem" - PEM_CERT="/certs/kafka-${ID}.keystore.pem" - PEM_KEY="/certs/kafka-${ID}.keystore.key" - {{- end }} - if [[ -f "$PEM_CA" ]] && [[ -f "$PEM_CERT" ]] && [[ -f "$PEM_KEY" ]]; then - cp "$PEM_CA" "/opt/bitnami/kafka/config/certs/kafka.truststore.pem" - cp "$PEM_CERT" "/opt/bitnami/kafka/config/certs/kafka.keystore.pem" - # Ensure the key used PEM format with PKCS#8 - openssl pkcs8 -topk8 -nocrypt -in "$PEM_KEY" > "/opt/bitnami/kafka/config/certs/kafka.keystore.key" - else - echo "Couldn't find the expected PEM files! They are mandatory when encryption via TLS is enabled." - exit 1 - fi - export KAFKA_TLS_TRUSTSTORE_FILE="/opt/bitnami/kafka/config/certs/kafka.truststore.pem" - {{- end }} - {{- end }} - - exec /entrypoint.sh /run.sh diff --git a/charts/kafka/templates/serviceaccount.yaml b/charts/kafka/templates/serviceaccount.yaml deleted file mode 100644 index 14dc4fa..0000000 --- a/charts/kafka/templates/serviceaccount.yaml +++ /dev/null @@ -1,15 +0,0 @@ -{{- if .Values.serviceAccount.create }} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ template "kafka.serviceAccountName" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -automountServiceAccountToken: {{ .Values.serviceAccount.automountServiceAccountToken }} -{{- end }} diff --git a/charts/kafka/templates/servicemonitor-jmx-metrics.yaml b/charts/kafka/templates/servicemonitor-jmx-metrics.yaml deleted file mode 100644 index 53ede60..0000000 --- a/charts/kafka/templates/servicemonitor-jmx-metrics.yaml +++ /dev/null @@ -1,42 +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 "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - {{- if .Values.metrics.serviceMonitor.selector }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }} - {{- end }} - 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 }} - {{- if .Values.metrics.serviceMonitor.relabelings }} - relabelings: {{- toYaml .Values.metrics.serviceMonitor.relabelings | nindent 6 }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.metricRelabelings }} - metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 6 }} - {{- end }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace }} -{{- end }} diff --git a/charts/kafka/templates/servicemonitor-metrics.yaml b/charts/kafka/templates/servicemonitor-metrics.yaml deleted file mode 100644 index e5dddb4..0000000 --- a/charts/kafka/templates/servicemonitor-metrics.yaml +++ /dev/null @@ -1,42 +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 "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: metrics - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - selector: - matchLabels: {{- include "common.labels.matchLabels" . | nindent 6 }} - {{- if .Values.metrics.serviceMonitor.selector }} - {{- include "common.tplvalues.render" (dict "value" .Values.metrics.serviceMonitor.selector "context" $) | nindent 6 }} - {{- end }} - 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 }} - {{- if .Values.metrics.serviceMonitor.relabelings }} - relabelings: {{- toYaml .Values.metrics.serviceMonitor.relabelings | nindent 6 }} - {{- end }} - {{- if .Values.metrics.serviceMonitor.metricRelabelings }} - metricRelabelings: {{- toYaml .Values.metrics.serviceMonitor.metricRelabelings | nindent 6 }} - {{- end }} - namespaceSelector: - matchNames: - - {{ .Release.Namespace }} -{{- end }} diff --git a/charts/kafka/templates/statefulset.yaml b/charts/kafka/templates/statefulset.yaml deleted file mode 100644 index e8b13f4..0000000 --- a/charts/kafka/templates/statefulset.yaml +++ /dev/null @@ -1,577 +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: {{ include "common.capabilities.statefulset.apiVersion" . }} -kind: StatefulSet -metadata: - name: {{ include "kafka.fullname" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -spec: - podManagementPolicy: {{ .Values.podManagementPolicy }} - replicas: {{ .Values.replicaCount }} - selector: - matchLabels: {{- include "common.labels.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 "common.labels.standard" . | nindent 8 }} - app.kubernetes.io/component: kafka - {{- if .Values.podLabels }} - {{- include "common.tplvalues.render" (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/jaas-secret: {{ include (print $.Template.BasePath "/jaas-secret.yaml") . | sha256sum }} - {{- end }} - {{- if (include "kafka.createTlsSecret" .) }} - checksum/tls-secret: {{ include (print $.Template.BasePath "/tls-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 "common.tplvalues.render" (dict "value" .Values.podAnnotations "context" $) | nindent 8 }} - {{- end }} - {{- end }} - spec: - {{- include "kafka.imagePullSecrets" . | nindent 6 }} - {{- if .Values.hostAliases }} - hostAliases: {{- include "common.tplvalues.render" (dict "value" .Values.hostAliases "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.schedulerName }} - schedulerName: {{ .Values.schedulerName | quote }} - {{- end }} - {{- if .Values.affinity }} - affinity: {{- include "common.tplvalues.render" (dict "value" .Values.affinity "context" $) | nindent 8 }} - {{- else }} - affinity: - podAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAffinityPreset "component" "kafka" "context" $) | nindent 10 }} - podAntiAffinity: {{- include "common.affinities.pods" (dict "type" .Values.podAntiAffinityPreset "component" "kafka" "context" $) | nindent 10 }} - nodeAffinity: {{- include "common.affinities.nodes" (dict "type" .Values.nodeAffinityPreset.type "key" .Values.nodeAffinityPreset.key "values" .Values.nodeAffinityPreset.values) | nindent 10 }} - {{- end }} - {{- if .Values.nodeSelector }} - nodeSelector: {{- include "common.tplvalues.render" (dict "value" .Values.nodeSelector "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.tolerations }} - tolerations: {{- include "common.tplvalues.render" (dict "value" .Values.tolerations "context" $) | nindent 8 }} - {{- end }} - {{- if .Values.topologySpreadConstraints }} - topologySpreadConstraints: {{- include "common.tplvalues.render" (dict "value" .Values.topologySpreadConstraints "context" .) | nindent 8 }} - {{- end }} - {{- if .Values.terminationGracePeriodSeconds }} - terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }} - {{- end }} - {{- if .Values.priorityClassName }} - priorityClassName: {{ .Values.priorityClassName }} - {{- end }} - {{- if .Values.podSecurityContext.enabled }} - securityContext: {{- omit .Values.podSecurityContext "enabled" | toYaml | nindent 8 }} - {{- end }} - serviceAccountName: {{ template "kafka.serviceAccountName" . }} - {{- if or (and .Values.volumePermissions.enabled .Values.persistence.enabled) (and .Values.externalAccess.enabled .Values.externalAccess.autoDiscovery.enabled) .Values.initContainers }} - 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 - - | - chown -R "{{ .Values.podSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }}" "{{ .Values.persistence.mountPath }}" - chown -R "{{ .Values.podSecurityContext.runAsUser }}:{{ .Values.podSecurityContext.fsGroup }}" "{{ .Values.logPersistence.mountPath }}" - {{- if eq ( toString ( .Values.volumePermissions.securityContext.runAsUser )) "auto" }} - securityContext: {{- omit .Values.volumePermissions.securityContext "runAsUser" | toYaml | nindent 12 }} - {{- else }} - securityContext: {{- .Values.volumePermissions.securityContext | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.volumePermissions.resources }} - resources: {{- toYaml .Values.volumePermissions.resources | nindent 12 }} - {{- end }} - volumeMounts: - - name: data - mountPath: {{ .Values.persistence.mountPath }} - - name: logs - mountPath: {{ .Values.logPersistence.mountPath }} - {{- 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: logs - mountPath: {{ .Values.logPersistence.mountPath }} - - name: scripts - mountPath: /scripts/auto-discovery.sh - subPath: auto-discovery.sh - {{- end }} - {{- if .Values.initContainers }} - {{- include "common.tplvalues.render" ( dict "value" .Values.initContainers "context" $ ) | nindent 8 }} - {{- end }} - {{- end }} - containers: - - name: kafka - image: {{ include "kafka.image" . }} - imagePullPolicy: {{ .Values.image.pullPolicy | quote }} - {{- if .Values.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.diagnosticMode.enabled }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} - {{- else if .Values.command }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.command "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.diagnosticMode.enabled }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} - {{- else if .Values.args }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.args "context" $) | nindent 12 }} - {{- end }} - env: - - name: BITNAMI_DEBUG - value: {{ ternary "true" "false" (or .Values.image.debug .Values.diagnosticMode.enabled) | 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: {{ printf "%s%s" (include "kafka.zookeeper.fullname" .) (tpl .Values.zookeeperChrootPath .) | quote }} - {{- else }} - value: {{ include "common.tplvalues.render" (dict "value" (join "," .Values.externalZookeeper.servers) "context" $) }} - {{- 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") (coalesce .Values.auth.sasl.jaas.zookeeperUser .Values.auth.jaas.zookeeperUser) }} - - name: KAFKA_CFG_SASL_ENABLED_MECHANISMS - value: {{ upper (coalesce .Values.auth.sasl.mechanisms .Values.auth.saslMechanisms) | quote }} - - name: KAFKA_CFG_SASL_MECHANISM_INTER_BROKER_PROTOCOL - value: {{ upper (coalesce .Values.auth.sasl.interBrokerMechanism .Values.auth.saslInterBrokerMechanism) | quote }} - {{- end }} - - name: KAFKA_CFG_LISTENERS - {{- if .Values.listeners }} - value: {{ join "," .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 }} - {{- if eq .Values.externalAccess.service.type "NodePort" }} - - name: HOST_IP - valueFrom: - fieldRef: - fieldPath: status.hostIP - {{- end }} - {{- else }} - - name: KAFKA_CFG_ADVERTISED_LISTENERS - {{- if .Values.advertisedListeners }} - value: {{ join "," .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" .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 "," (coalesce .Values.auth.sasl.jaas.clientUsers .Values.auth.jaas.clientUsers) | quote }} - - name: KAFKA_CLIENT_PASSWORDS - valueFrom: - secretKeyRef: - name: {{ include "kafka.jaasSecretName" . }} - key: client-passwords - {{- end }} - {{- if (include "kafka.interBroker.saslAuthentication" .) }} - - name: KAFKA_INTER_BROKER_USER - value: {{ coalesce .Values.auth.sasl.jaas.interBrokerUser .Values.auth.jaas.interBrokerUser | quote }} - - name: KAFKA_INTER_BROKER_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "kafka.jaasSecretName" . }} - key: inter-broker-password - {{- end }} - {{- end }} - {{- if and .Values.zookeeper.auth.enabled (coalesce .Values.auth.sasl.jaas.zookeeperUser .Values.auth.jaas.zookeeperUser) }} - - name: KAFKA_ZOOKEEPER_PROTOCOL - value: "SASL" - - name: KAFKA_ZOOKEEPER_USER - value: {{ coalesce .Values.auth.sasl.jaas.zookeeperUser .Values.auth.jaas.zookeeperUser | quote }} - - name: KAFKA_ZOOKEEPER_PASSWORD - valueFrom: - secretKeyRef: - name: {{ include "kafka.jaasSecretName" . }} - key: zookeeper-password - {{- end }} - {{- if (include "kafka.tlsEncryption" .) }} - - name: KAFKA_TLS_TYPE - value: {{ upper .Values.auth.tls.type | quote }} - - name: KAFKA_CFG_SSL_ENDPOINT_IDENTIFICATION_ALGORITHM - value: {{ default "" (coalesce .Values.auth.tls.endpointIdentificationAlgorithm .Values.auth.tlsEndpointIdentificationAlgorithm) | quote }} - - name: KAFKA_TLS_CLIENT_AUTH - value: {{ ternary "required" "none" (eq .Values.auth.clientProtocol "mtls") | quote }} - {{- $tlsPassword := coalesce .Values.auth.tls.password .Values.auth.jksPassword }} - - name: KAFKA_CERTIFICATE_PASSWORD - value: {{ default "" $tlsPassword | quote }} - {{- end }} - {{- if .Values.metrics.jmx.enabled }} - - name: JMX_PORT - value: "5555" - {{- end }} - - name: KAFKA_VOLUME_DIR - value: {{ .Values.persistence.mountPath | quote }} - - name: KAFKA_LOG_DIR - value: {{ .Values.logPersistence.mountPath | quote }} - - 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 | replace "_" "" | 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 }} - - name: KAFKA_CFG_AUTHORIZER_CLASS_NAME - value: {{ .Values.authorizerClassName | quote }} - - name: KAFKA_CFG_ALLOW_EVERYONE_IF_NO_ACL_FOUND - value: {{ .Values.allowEveryoneIfNoAclFound | quote }} - - name: KAFKA_CFG_SUPER_USERS - value: {{ .Values.superUsers | quote }} - {{- if .Values.extraEnvVars }} - {{ include "common.tplvalues.render" ( 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 not .Values.diagnosticMode.enabled }} - {{- 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 "common.tplvalues.render" (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 "common.tplvalues.render" (dict "value" .Values.customReadinessProbe "context" $) | nindent 12 }} - {{- end }} - {{- end }} - {{- if .Values.resources }} - resources: {{- toYaml .Values.resources | nindent 12 }} - {{- end }} - volumeMounts: - - name: data - mountPath: {{ .Values.persistence.mountPath }} - - name: logs - mountPath: {{ .Values.logPersistence.mountPath }} - {{- if or .Values.config .Values.existingConfigmap }} - - name: kafka-config - mountPath: {{ .Values.persistence.mountPath }}/config/server.properties - subPath: server.properties - {{- end }} - {{- if or .Values.log4j .Values.existingLog4jConfigMap }} - - name: log4j-config - mountPath: {{ .Values.persistence.mountPath }}/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" .) }} - {{- if not (empty .Values.auth.tls.existingSecrets) }} - {{- range $index, $_ := .Values.auth.tls.existingSecrets }} - - name: kafka-certs-{{ $index }} - mountPath: /certs-{{ $index }} - readOnly: true - {{- end }} - {{- else if or (not (empty (coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret))) (.Files.Glob "files/tls/*.{crt,pem}") }} - - name: kafka-certs - mountPath: /certs - readOnly: true - {{- else if .Values.auth.tls.autoGenerated }} - {{- range $index := until $replicaCount }} - - name: kafka-certs-{{ $index }} - mountPath: /certs-{{ $index }} - readOnly: true - {{- end }} - {{- end }} - {{- if (coalesce .Values.auth.tls.jksTruststoreSecret .Values.auth.jksTruststoreSecret) }} - - name: kafka-truststore - mountPath: /truststore - readOnly: true - {{- end }} - {{- end }} - {{- if .Values.extraVolumeMounts }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumeMounts "context" $) | nindent 12 }} - {{- end }} - {{- if .Values.metrics.jmx.enabled }} - - name: jmx-exporter - image: {{ template "kafka.metrics.jmx.image" . }} - imagePullPolicy: {{ .Values.metrics.jmx.image.pullPolicy | quote }} - {{- if .Values.metrics.jmx.containerSecurityContext.enabled }} - securityContext: {{- omit .Values.metrics.jmx.containerSecurityContext "enabled" | toYaml | nindent 12 }} - {{- end }} - {{- if .Values.diagnosticMode.enabled }} - command: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.command "context" $) | nindent 12 }} - args: {{- include "common.tplvalues.render" (dict "value" .Values.diagnosticMode.args "context" $) | nindent 12 }} - {{- else }} - command: - - java - - -XX:+UnlockExperimentalVMOptions - - -XX:+UseCGroupMemoryLimitForHeap - - -XX:MaxRAMFraction=1 - - -XshowSettings:vm - - -jar - - jmx_prometheus_httpserver.jar - - "5556" - - /etc/jmx-kafka/jmx-kafka-prometheus.yml - {{- end }} - 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 "common.tplvalues.render" (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" .) }} - {{- if not (empty .Values.auth.tls.existingSecrets) }} - {{- range $index, $secret := .Values.auth.tls.existingSecrets }} - - name: kafka-certs-{{ $index }} - secret: - secretName: {{ tpl $secret $ }} - defaultMode: 256 - {{- end }} - {{- else if or (not (empty (coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret))) (.Files.Glob "files/tls/*.{crt,pem}") }} - - name: kafka-certs - secret: - secretName: {{ if not (empty (coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret)) }}{{ tpl (coalesce .Values.auth.tls.existingSecret .Values.auth.jksSecret) . }}{{ else }}{{ printf "%s-tls" (include "kafka.fullname" .) }}{{ end }} - defaultMode: 256 - {{- else if .Values.auth.tls.autoGenerated }} - {{- range $index := until $replicaCount }} - - name: kafka-certs-{{ $index }} - secret: - secretName: {{ printf "%s-%d-tls" (include "kafka.fullname" $) $index }} - defaultMode: 256 - {{- end }} - {{- end }} - {{- if (coalesce .Values.auth.tls.jksTruststoreSecret .Values.auth.jksTruststoreSecret) }} - - name: kafka-truststore - secret: - secretName: {{ coalesce .Values.auth.tls.jksTruststoreSecret .Values.auth.jksTruststoreSecret }} - defaultMode: 256 - {{- end }} - {{- end }} - {{- if .Values.extraVolumes }} - {{- include "common.tplvalues.render" (dict "value" .Values.extraVolumes "context" $) | 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 .) }} -{{- end }} -{{- if not .Values.logPersistence.enabled }} - - name: logs - emptyDir: {} -{{- else if .Values.logPersistence.existingClaim }} - - name: logs - persistentVolumeClaim: - claimName: {{ printf "%s" (tpl .Values.logPersistence.existingClaim .) }} -{{- end }} - {{- if or (and .Values.persistence.enabled (not .Values.persistence.existingClaim)) (and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim)) }} - volumeClaimTemplates: - {{- end }} -{{- if and .Values.persistence.enabled (not .Values.persistence.existingClaim) }} - - metadata: - name: data - {{- if .Values.persistence.annotations }} - annotations: {{- include "common.tplvalues.render" (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 }} - {{- if .Values.persistence.selector }} - selector: {{- include "common.tplvalues.render" (dict "value" .Values.persistence.selector "context" $) | nindent 10 }} - {{- end -}} -{{- end }} -{{- if and .Values.logPersistence.enabled (not .Values.logPersistence.existingClaim) }} - - metadata: - name: logs - {{- if .Values.logPersistence.annotations }} - annotations: {{- include "common.tplvalues.render" (dict "value" .Values.logPersistence.annotations "context" $) | nindent 10 }} - {{- end }} - spec: - accessModes: - {{- range .Values.logPersistence.accessModes }} - - {{ . | quote }} - {{- end }} - resources: - requests: - storage: {{ .Values.logPersistence.size | quote }} - {{ include "kafka.storageClass" . | nindent 8 }} - {{- if .Values.logPersistence.selector }} - selector: {{- include "common.tplvalues.render" (dict "value" .Values.logPersistence.selector "context" $) | nindent 10 }} - {{- end -}} -{{- end }} -{{- end }} diff --git a/charts/kafka/templates/svc-external-access.yaml b/charts/kafka/templates/svc-external-access.yaml deleted file mode 100644 index 9169a65..0000000 --- a/charts/kafka/templates/svc-external-access.yaml +++ /dev/null @@ -1,53 +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 }} -{{- $_ := set $ "targetPod" $targetPod }} ---- -apiVersion: v1 -kind: Service -metadata: - name: {{ template "kafka.fullname" $ }}-{{ $i }}-external - labels: {{- include "common.labels.standard" $ | nindent 4 }} - app.kubernetes.io/component: kafka - pod: {{ $targetPod }} - {{- if $root.Values.commonLabels }} - {{- include "common.tplvalues.render" ( 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 "common.tplvalues.render" ( dict "value" $root.Values.externalAccess.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if $root.Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( 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 "common.labels.matchLabels" $ | nindent 4 }} - app.kubernetes.io/component: kafka - statefulset.kubernetes.io/pod-name: {{ $targetPod }} ---- -{{- end }} -{{- end }} diff --git a/charts/kafka/templates/svc-headless.yaml b/charts/kafka/templates/svc-headless.yaml deleted file mode 100644 index ad2303a..0000000 --- a/charts/kafka/templates/svc-headless.yaml +++ /dev/null @@ -1,26 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "kafka.fullname" . }}-headless - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( 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 "common.labels.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: kafka diff --git a/charts/kafka/templates/svc.yaml b/charts/kafka/templates/svc.yaml deleted file mode 100644 index 70b24dd..0000000 --- a/charts/kafka/templates/svc.yaml +++ /dev/null @@ -1,49 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ template "kafka.fullname" . }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - app.kubernetes.io/component: kafka - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if or .Values.service.annotations .Values.commonAnnotations }} - annotations: - {{- if .Values.service.annotations }} - {{ include "common.tplvalues.render" ( dict "value" .Values.service.annotations "context" $) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - {{- include "common.tplvalues.render" ( 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 "common.labels.matchLabels" . | nindent 4 }} - app.kubernetes.io/component: kafka diff --git a/charts/kafka/templates/tls-secret.yaml b/charts/kafka/templates/tls-secret.yaml deleted file mode 100644 index 894adc8..0000000 --- a/charts/kafka/templates/tls-secret.yaml +++ /dev/null @@ -1,49 +0,0 @@ -{{- if (include "kafka.createTlsSecret" .) }} -{{- if .Files.Glob "files/tls/*.{crt,pem,jks}" }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ printf "%s-tls" (include "kafka.fullname" .) }} - labels: {{- include "common.labels.standard" . | nindent 4 }} - {{- if .Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" .Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if .Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -type: Opaque -data: - {{- $root := . }} - {{- range $path, $bytes := .Files.Glob "files/tls/*.{crt,pem,jks}" }} - {{ base $path }}: {{ $root.Files.Get $path | b64enc | quote }} - {{- end }} -{{- else if and .Values.auth.tls.autoGenerated (eq .Values.auth.tls.type "pem") }} -{{- $replicaCount := int .Values.replicaCount }} -{{- $releaseNamespace := .Release.Namespace }} -{{- $clusterDomain := .Values.clusterDomain }} -{{- $fullname := include "kafka.fullname" . }} -{{- $ca := genCA "kafka-ca" 365 }} -{{- range $i := until $replicaCount }} -{{- $replicaHost := printf "%s-%d.%s-headless" $fullname $i $fullname }} -{{- $altNames := list (printf "%s.%s.svc.%s" $replicaHost $releaseNamespace $clusterDomain) (printf "%s.%s.svc.%s" $fullname $releaseNamespace $clusterDomain) (printf "%s.%s" $replicaHost $releaseNamespace) (printf "%s.%s" $fullname $releaseNamespace) $replicaHost $fullname }} -{{- $cert := genSignedCert $replicaHost nil $altNames 365 $ca }} -apiVersion: v1 -kind: Secret -metadata: - name: {{ printf "%s-%d-tls" (include "kafka.fullname" $) $i }} - labels: {{- include "common.labels.standard" $ | nindent 4 }} - {{- if $.Values.commonLabels }} - {{- include "common.tplvalues.render" ( dict "value" $.Values.commonLabels "context" $ ) | nindent 4 }} - {{- end }} - {{- if $.Values.commonAnnotations }} - annotations: {{- include "common.tplvalues.render" ( dict "value" $.Values.commonAnnotations "context" $ ) | nindent 4 }} - {{- end }} -type: kubernetes.io/tls -data: - ca.crt: {{ $ca.Cert | b64enc | quote }} - tls.crt: {{ $cert.Cert | b64enc | quote }} - tls.key: {{ $cert.Key | b64enc | quote }} ---- -{{- end }} -{{- end }} -{{- end }} diff --git a/charts/kafka/values.yaml b/charts/kafka/values.yaml deleted file mode 100644 index 51669d0..0000000 --- a/charts/kafka/values.yaml +++ /dev/null @@ -1,1380 +0,0 @@ -## @section Global parameters -## 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, imagePullSecrets and storageClass - -## @param global.imageRegistry Global Docker image registry -## @param global.imagePullSecrets Global Docker registry secret names as an array -## @param global.storageClass Global StorageClass for Persistent Volume(s) -## -global: - imageRegistry: "" - ## E.g. - ## imagePullSecrets: - ## - myRegistryKeySecretName - ## - imagePullSecrets: [] - storageClass: "" - -## @section Common parameters - -## @param nameOverride String to partially override kafka.fullname -## -nameOverride: "" -## @param fullnameOverride String to fully override kafka.fullname -## -fullnameOverride: "" -## @param clusterDomain Default Kubernetes cluster domain -## -clusterDomain: cluster.local -## @param commonLabels Labels to add to all deployed objects -## -commonLabels: {} -## @param commonAnnotations Annotations to add to all deployed objects -## -commonAnnotations: {} -## @param extraDeploy Array of extra objects to deploy with the release -## -extraDeploy: [] - -## Enable diagnostic mode in the deployment -## -diagnosticMode: - ## @param diagnosticMode.enabled Enable diagnostic mode (all probes will be disabled and the command will be overridden) - ## - enabled: false - ## @param diagnosticMode.command Command to override all containers in the deployment - ## - command: - - sleep - ## @param diagnosticMode.args Args to override all containers in the deployment - ## - args: - - infinity - -## @section Kafka parameters - -## Bitnami Kafka image version -## ref: https://hub.docker.com/r/bitnami/kafka/tags/ -## @param image.registry Kafka image registry -## @param image.repository Kafka image repository -## @param image.tag Kafka image tag (immutable tags are recommended) -## @param image.pullPolicy Kafka image pull policy -## @param image.pullSecrets Specify docker-registry secret names as an array -## @param image.debug Set to true if you would like to see extra information on logs -## -image: - registry: docker.io - repository: bitnami/kafka - tag: 2.8.1-debian-10-r99 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: https://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 -## @param config Configuration file for Kafka. Auto-generated based on other parameters when not specified (see [below]( -## Specify content for server.properties -## NOTE: This will override any KAFKA_CFG_ environment variables (including those set by the chart) -## The server.properties is auto-generated based on other parameters when this parameter 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: "" -## @param existingConfigmap ConfigMap with Kafka Configuration -## NOTE: This will override config AND any KAFKA_CFG_ environment variables. -## -existingConfigmap: "" -## @param log4j An optional log4j.properties file to overwrite the default of the Kafka brokers. -## 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: "" -## @param existingLog4jConfigMap The name of an existing ConfigMap containing a log4j.properties file. -## The name of an existing ConfigMap containing a log4j.properties file. -## NOTE: this will override log4j. -## -existingLog4jConfigMap: "" -## @param heapOpts Kafka's Java Heap size -## -heapOpts: -Xmx1024m -Xms1024m -## @param deleteTopicEnable Switch to enable topic deletion or not -## -deleteTopicEnable: false -## @param autoCreateTopicsEnable Switch to enable auto creation of topics. Enabling auto creation of topics not recommended for production or similar environments -## -autoCreateTopicsEnable: true -## @param logFlushIntervalMessages The number of messages to accept before forcing a flush of data to disk -## -logFlushIntervalMessages: _10000 -## @param logFlushIntervalMs The maximum amount of time a message can sit in a log before we force a flush -## -logFlushIntervalMs: 1000 -## @param logRetentionBytes A size-based retention policy for logs -## -logRetentionBytes: _1073741824 -## @param logRetentionCheckIntervalMs The interval at which log segments are checked to see if they can be deleted -## -logRetentionCheckIntervalMs: 300000 -## @param logRetentionHours The minimum age of a log file to be eligible for deletion due to age -## -logRetentionHours: 168 -## @param logSegmentBytes The maximum size of a log segment file. When this size is reached a new log segment will be created -## -logSegmentBytes: _1073741824 -## @param logsDirs A comma separated list of directories under which to store log files -## -logsDirs: /bitnami/kafka/data -## @param maxMessageBytes The largest record batch size allowed by Kafka -## -maxMessageBytes: _1000012 -## @param defaultReplicationFactor Default replication factors for automatically created topics -## -defaultReplicationFactor: 1 -## @param offsetsTopicReplicationFactor The replication factor for the offsets topic -## -offsetsTopicReplicationFactor: 1 -## @param transactionStateLogReplicationFactor The replication factor for the transaction topic -## -transactionStateLogReplicationFactor: 1 -## @param transactionStateLogMinIsr Overridden min.insync.replicas config for the transaction topic -## -transactionStateLogMinIsr: 1 -## @param numIoThreads The number of threads doing disk I/O -## -numIoThreads: 8 -## @param numNetworkThreads The number of threads handling network requests -## -numNetworkThreads: 3 -## @param numPartitions The default number of log partitions per topic -## -numPartitions: 1 -## @param numRecoveryThreadsPerDataDir The number of threads per data directory to be used for log recovery at startup and flushing at shutdown -## -numRecoveryThreadsPerDataDir: 1 -## @param socketReceiveBufferBytes The receive buffer (SO_RCVBUF) used by the socket server -## -socketReceiveBufferBytes: 102400 -## @param socketRequestMaxBytes The maximum size of a request that the socket server will accept (protection against OOM) -## -socketRequestMaxBytes: _104857600 -## @param socketSendBufferBytes The send buffer (SO_SNDBUF) used by the socket server -## -socketSendBufferBytes: 102400 -## @param zookeeperConnectionTimeoutMs Timeout in ms for connecting to Zookeeper -## -zookeeperConnectionTimeoutMs: 6000 -## @param zookeeperChrootPath Path which puts data under some path in the global ZooKeeper namespace -## ref: https://kafka.apache.org/documentation/#brokerconfigs_zookeeper.connect -## -zookeeperChrootPath: "" -## @param authorizerClassName The Authorizer is configured by setting authorizer.class.name=kafka.security.authorizer.AclAuthorizer in server.properties. -## -authorizerClassName: "" -## @param allowEveryoneIfNoAclFound By default, if a resource has no associated ACLs, then no one is allowed to access that resource except super users. -## -allowEveryoneIfNoAclFound: true -## @param superUsers You can add super users in server.properties -## -superUsers: User:admin -## @param command Override kafka container command -## -command: - - /scripts/setup.sh -## @param args Override kafka container arguments -## -args: [] -## @param extraEnvVars Extra environment variables to add to kafka pods (see [below]({KEY} -## ref: https://github.com/bitnami/bitnami-docker-kafka#configuration -## Example: -## extraEnvVars: -## - name: KAFKA_CFG_BACKGROUND_THREADS -## value: "10" -## -extraEnvVars: [] -## @param extraVolumes Extra volume(s) to add to Kafka statefulset -## Examples: -## extraVolumes: -## - name: kafka-jaas -## secret: -## secretName: kafka-jaas -extraVolumes: [] -## @param extraVolumeMounts Extra volumeMount(s) to add to Kafka containers -## extraVolumeMounts: -## - name: kafka-jaas -## mountPath: /bitnami/kafka/config/kafka_jaas.conf -## subPath: kafka_jaas.conf -extraVolumeMounts: [] -## Authentication parameteres -## https://github.com/bitnami/bitnami-docker-kafka#security -## -auth: - ## Authentication protocol for client and inter-broker communications - ## 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 | - ## @param auth.clientProtocol Authentication protocol for communications with clients. Allowed protocols: `plaintext`, `tls`, `mtls`, `sasl` and `sasl_tls` - ## @param auth.interBrokerProtocol Authentication protocol for inter-broker communications. Allowed protocols: `plaintext`, `tls`, `mtls`, `sasl` and `sasl_tls` - ## - clientProtocol: plaintext - interBrokerProtocol: plaintext - ## SASL configuration - ## - sasl: - ## @param auth.sasl.mechanisms SASL mechanisms when either `auth.interBrokerProtocol` or `auth.clientProtocol` are `sasl`. Allowed types: `plain`, `scram-sha-256`, `scram-sha-512` - ## - mechanisms: plain,scram-sha-256,scram-sha-512 - ## @param auth.sasl.interBrokerMechanism SASL mechanism for inter broker communication. - ## - interBrokerMechanism: plain - ## JAAS configuration for SASL authentication. - ## - jaas: - ## @param auth.sasl.jaas.clientUsers Kafka client user list - ## - ## clientUsers: - ## - user1 - ## - user2 - ## - clientUsers: - - user - ## @param auth.sasl.jaas.clientPasswords Kafka client passwords. This is mandatory if more than one user is specified in clientUsers - ## - ## clientPasswords: - ## - password1 - ## - password2" - ## - clientPasswords: [] - ## @param auth.sasl.jaas.interBrokerUser Kafka inter broker communication user for SASL authentication - ## - interBrokerUser: admin - ## @param auth.sasl.jaas.interBrokerPassword Kafka inter broker communication password for SASL authentication - ## - interBrokerPassword: "" - ## @param auth.sasl.jaas.zookeeperUser Kafka Zookeeper user for SASL authentication - ## - zookeeperUser: "" - ## @param auth.sasl.jaas.zookeeperPassword Kafka Zookeeper password for SASL authentication - ## - zookeeperPassword: "" - ## @param auth.sasl.jaas.existingSecret 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: "" - ## @param auth.saslMechanisms DEPRECATED: use `auth.sasl.mechanisms` instead. - ## - saslMechanisms: plain,scram-sha-256,scram-sha-512 - ## @param auth.saslInterBrokerMechanism DEPRECATED: use `auth.sasl.interBrokerMechanism` instead. - ## - saslInterBrokerMechanism: plain - ## @param auth.jaas [object] DEPRECATED: use `auth.sasl.jaas` instead. - ## @skip auth.jaas.clientUsers - ## - jaas: - clientUsers: - - user - clientPasswords: [] - interBrokerUser: admin - interBrokerPassword: "" - zookeeperUser: "" - zookeeperPassword: "" - existingSecret: "" - ## TLS configuration - ## - tls: - ## @param auth.tls.type Format to use for TLS certificates. Allowed types: `jks` and `pem` - ## - type: jks - ## @param auth.tls.existingSecrets Array existing secrets containing the TLS certificates for the Kafka brokers - ## When using 'jks' format for certificates, each secret should contain a truststore and a keystore. - ## Create these secrets following the steps below: - ## 1) Generate your truststore 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 one time per broker to create its associated secret (SECRET_NAME_X is the name of the secret you want to create): - ## kubectl create secret generic SECRET_NAME_0 --from-file=kafka.truststore.jks=./kafka.truststore.jks --from-file=kafka.keystore.jks=./kafka-0.keystore.jks - ## kubectl create secret generic SECRET_NAME_1 --from-file=kafka.truststore.jks=./kafka.truststore.jks --from-file=kafka.keystore.jks=./kafka-1.keystore.jks - ## ... - ## - ## When using 'pem' format for certificates, each secret should contain a public CA certificate, a public certificate and one private key. - ## Create these secrets following the steps below: - ## 1) Create a certificate key and signing request per Kafka broker, and sign the signing request with your CA - ## 2) Rename your CA file to `kafka.ca.crt`. - ## 3) Rename your certificates to `kafka-X.tls.crt` where X is the ID of each Kafka broker. - ## 3) Rename your keys to `kafka-X.tls.key` where X is the ID of each Kafka broker. - ## 4) Run the command below one time per broker to create its associated secret (SECRET_NAME_X is the name of the secret you want to create): - ## kubectl create secret generic SECRET_NAME_0 --from-file=ca.crt=./kafka.ca.crt --from-file=tls.crt=./kafka-0.tls.crt --from-file=tls.key=./kafka-0.tls.key - ## kubectl create secret generic SECRET_NAME_1 --from-file=ca.crt=./kafka.ca.crt --from-file=tls.crt=./kafka-1.tls.crt --from-file=tls.key=./kafka-1.tls.key - ## ... - ## - existingSecrets: [] - ## @param auth.tls.existingSecret DEPRECATED: use `auth.tls.existingSecrets` instead. - ## - existingSecret: "" - ## @param auth.tls.autoGenerated Generate automatically self-signed TLS certificates for Kafka brokers. Currently only supported if `auth.tls.type` is `pem` - ## Note: ignored when using 'jks' format or `auth.tls.existingSecrets` is not empty - ## - autoGenerated: false - ## @param auth.tls.password Password to access the JKS files or PEM key when they are password-protected. - ## - password: "" - ## @param auth.tls.jksTruststoreSecret Name of the existing secret containing your truststore if truststore not existing or different from the ones in the `auth.tls.existingSecrets` - ## Note: ignored when using 'pem' format for certificates . - ## - jksTruststoreSecret: "" - ## @param auth.tls.jksKeystoreSAN The secret key from the `auth.tls.existingSecret` containing the keystore with a SAN certificate - ## The SAN certificate in it should be issued with Subject Alternative Names for all headless services: - ## - kafka-0.kafka-headless.kafka.svc.cluster.local - ## - kafka-1.kafka-headless.kafka.svc.cluster.local - ## - kafka-2.kafka-headless.kafka.svc.cluster.local - ## Note: ignored when using 'pem' format for certificates. - ## - jksKeystoreSAN: "" - ## @param auth.tls.jksTruststore The secret key from the `auth.tls.existingSecret` or `auth.tls.jksTruststoreSecret` containing the truststore - ## Note: ignored when using 'pem' format for certificates. - ## - jksTruststore: "" - ## @param auth.tls.endpointIdentificationAlgorithm The endpoint identification algorithm to validate server hostname using server certificate - ## Disable server host name verification by setting it to an empty string. - ## ref: https://docs.confluent.io/current/kafka/authentication_ssl.html#optional-settings - ## - endpointIdentificationAlgorithm: https - ## @param auth.jksSecret DEPRECATED: use `auth.tls.existingSecrets` instead. - ## - jksSecret: "" - ## @param auth.jksTruststoreSecret DEPRECATED: use `auth.tls.jksTruststoreSecret` instead. - ## - jksTruststoreSecret: "" - ## @param auth.jksKeystoreSAN DEPRECATED: use `auth.tls.jksKeystoreSAN` instead. - ## - jksKeystoreSAN: "" - ## @param auth.jksTruststore DEPRECATED: use `auth.tls.jksTruststore` instead. - ## - jksTruststore: "" - ## @param auth.jksPassword DEPRECATED: use `auth.tls.password` instead. - ## - jksPassword: "" - ## @param auth.tlsEndpointIdentificationAlgorithm DEPRECATED: use `auth.tls.endpointIdentificationAlgorithm` instead. - ## - tlsEndpointIdentificationAlgorithm: https -## @param listeners The address(es) the socket server listens on. Auto-calculated it's set to an empty array -## 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: [] -## @param advertisedListeners The address(es) (hostname:port) the broker will advertise to producers and consumers. Auto-calculated it's set to an empty array -## 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: [] -## @param listenerSecurityProtocolMap The protocol->listener mapping. Auto-calculated it's set to nil -## When it's nil, the listeners will be configured based on the authentication protocols (auth.clientProtocol and auth.interBrokerProtocol parameters) -## -listenerSecurityProtocolMap: "" -## @param allowPlaintextListener Allow to use the PLAINTEXT listener -## -allowPlaintextListener: true -## @param interBrokerListenerName The listener that the brokers should communicate on -## -interBrokerListenerName: INTERNAL - -## @section Statefulset parameters - -## @param replicaCount Number of Kafka nodes -## -replicaCount: 1 -## @param minBrokerId Minimal broker.id value, nodes increment their `broker.id` respectively -## Brokers increment their ID starting at this minimal value. -## E.g., with `minBrokerId=100` and 3 nodes, IDs will be 100, 101, 102 for brokers 0, 1, and 2, respectively. -## -minBrokerId: 0 -## @param updateStrategy Update strategy for the stateful set -## ref: https://kubernetes.io/docs/tutorials/stateful-application/basic-stateful-set/#updating-statefulsets -## -updateStrategy: RollingUpdate -## @param rollingUpdatePartition Partition update strategy -## https://kubernetes.io/docs/concepts/workloads/controllers/statefulset/#partitions -## -rollingUpdatePartition: "" -## @param hostAliases Add deployment host aliases -## https://kubernetes.io/docs/concepts/services-networking/add-entries-to-pod-etc-hosts-with-host-aliases/ -## -hostAliases: [] -## @param podManagementPolicy 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 -## @param schedulerName Name of the k8s scheduler (other than default) -## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ -## -schedulerName: "" -## @param podLabels Kafka pod labels -## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ -## -podLabels: {} -## @param podAnnotations Kafka Pod annotations -## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ -## -podAnnotations: {} -## @param priorityClassName Name of the existing priority class to be used by kafka pods -## Ref: https://kubernetes.io/docs/concepts/configuration/pod-priority-preemption/ -## -priorityClassName: "" -## @param podAffinityPreset Pod affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` -## ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## -podAffinityPreset: "" -## @param podAntiAffinityPreset Pod anti-affinity preset. Ignored if `affinity` is set. Allowed values: `soft` or `hard` -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#inter-pod-affinity-and-anti-affinity -## -podAntiAffinityPreset: soft -## Node affinity preset -## Ref: https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#node-affinity -## -nodeAffinityPreset: - ## @param nodeAffinityPreset.type Node affinity preset type. Ignored if `affinity` is set. Allowed values: `soft` or `hard` - ## - type: "" - ## @param nodeAffinityPreset.key Node label key to match Ignored if `affinity` is set. - ## E.g. - ## key: "kubernetes.io/e2e-az-name" - ## - key: "" - ## @param nodeAffinityPreset.values Node label values to match. Ignored if `affinity` is set. - ## E.g. - ## values: - ## - e2e-az1 - ## - e2e-az2 - ## - values: [] -## @param affinity Affinity for pod assignment -## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity -## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set -## -affinity: {} -## @param nodeSelector Node labels for pod assignment -## Ref: https://kubernetes.io/docs/user-guide/node-selection/ -## -nodeSelector: {} -## @param tolerations Tolerations for pod assignment -## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ -## -tolerations: [] -## @param topologySpreadConstraints Topology Spread Constraints for pod assignment spread across your cluster among failure-domains. Evaluated as a template -## Ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-topology-spread-constraints/#spread-constraints-for-pods -## -topologySpreadConstraints: {} -## @param terminationGracePeriodSeconds Seconds the pod needs to gracefully terminate -## ref: https://kubernetes.io/docs/concepts/containers/container-lifecycle-hooks/#hook-handler-execution -## -terminationGracePeriodSeconds: "" -## Kafka pods' Security Context -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-pod -## @param podSecurityContext.enabled Enable security context for the pods -## @param podSecurityContext.fsGroup Group ID for the filesystem used by the containers -## @param podSecurityContext.runAsUser User ID for the service user running the pod -## -podSecurityContext: - enabled: true - 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 -## @param containerSecurityContext.enabled Enable Kafka containers' Security Context -## Example: -## containerSecurityContext: -## enabled: true -## capabilities: -## drop: ["NET_RAW"] -## readOnlyRootFilesystem: true -## -containerSecurityContext: - enabled: false -## Kafka containers' resource requests and limits -## ref: https://kubernetes.io/docs/user-guide/compute-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:'. -## @param resources.limits The resources limits for Kafka containers -## @param resources.requests The requested resources for Kafka containers -## -resources: - ## Example: - ## limits: - ## cpu: 250m - ## memory: 1Gi - limits: {} - ## Examples: - ## requests: - ## cpu: 250m - ## memory: 256Mi - requests: {} -## Kafka containers' liveness probe. Evaluated as a template. -## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes -## @param livenessProbe.enabled Enable livenessProbe -## @param livenessProbe.initialDelaySeconds Initial delay seconds for livenessProbe -## @param livenessProbe.periodSeconds Period seconds for livenessProbe -## @param livenessProbe.timeoutSeconds Timeout seconds for livenessProbe -## @param livenessProbe.failureThreshold Failure threshold for livenessProbe -## @param livenessProbe.successThreshold Success threshold for livenessProbe -## -livenessProbe: - enabled: true - initialDelaySeconds: 10 - timeoutSeconds: 5 - failureThreshold: 3 - periodSeconds: 10 - successThreshold: 1 -## Kafka containers' readiness probe. Evaluated as a template. -## ref: https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle/#container-probes -## @param readinessProbe.enabled Enable readinessProbe -## @param readinessProbe.initialDelaySeconds Initial delay seconds for readinessProbe -## @param readinessProbe.periodSeconds Period seconds for readinessProbe -## @param readinessProbe.timeoutSeconds Timeout seconds for readinessProbe -## @param readinessProbe.failureThreshold Failure threshold for readinessProbe -## @param readinessProbe.successThreshold Success threshold for readinessProbe -## -readinessProbe: - enabled: true - initialDelaySeconds: 5 - failureThreshold: 6 - timeoutSeconds: 5 - periodSeconds: 10 - successThreshold: 1 -## @param customLivenessProbe Custom Liveness probe configuration for Kafka -## -customLivenessProbe: {} -## @param customReadinessProbe Custom Readiness probe configuration for Kafka -## -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: - ## @param pdb.create Enable/disable a Pod Disruption Budget creation - ## - create: false - ## @param pdb.minAvailable Minimum number/percentage of pods that should remain scheduled - ## - minAvailable: "" - ## @param pdb.maxUnavailable Maximum number/percentage of pods that may be made unavailable - ## - maxUnavailable: 1 -## @param sidecars Attach additional sidecar containers to the Kafka pod -## Example: -## sidecars: -## - name: your-image-name -## image: your-image -## imagePullPolicy: Always -## ports: -## - name: portname -## containerPort: 1234 -## -sidecars: [] -## @param initContainers Add extra init containers -## -initContainers: [] - -## @section Exposure parameters -networkPolicy: - ## @param networkPolicy.enabled Enable creation of NetworkPolicy resources. - ## - enabled: false - ## @param networkPolicy.allowExternal Don't require client label for connections - ## The Policy model to apply. When set to false, only pods with the correct - ## client label will have network access to Kafka port for client connections (service.port). - ## When true, kafka will accept connections from any source - ## (with the correct destination port). - ## - allowExternal: true - ## @param networkPolicy.explicitNamespacesSelector A Kubernetes LabelSelector to explicitly select namespaces from which traffic could be allowed - ## If explicitNamespacesSelector is missing or set to {}, only client Pods that are in the networkPolicy's namespace - ## and that match other criteria, the ones that have the good label, can reach the kafka. - ## But sometimes, we want the kafka to be accessible to clients from other namespaces, in this case, we can use this - ## LabelSelector to select these namespaces, note that the networkPolicy's namespace should also be explicitly added. - ## - ## Example: - ## explicitNamespacesSelector: - ## matchLabels: - ## role: frontend - ## matchExpressions: - ## - {key: role, operator: In, values: [frontend]} - ## - explicitNamespacesSelector: {} - ## @param networkPolicy.externalAccess.from customize the from section for External Access on tcp-external port - ## Example: - ## - ipBlock: - ## cidr: 172.9.0.0/16 - ## except: - ## - 172.9.1.0/24 - ## - externalAccess: - from: [] - ## @param networkPolicy.egressRules.customRules [object] Custom network policy rule - ## - egressRules: - ## Additional custom egress rules - ## e.g: - ## customRules: - ## - to: - ## - namespaceSelector: - ## matchLabels: - ## label: example - customRules: [] -## Service parameters -## -service: - ## @param service.type Kubernetes Service type - ## - type: ClusterIP - ## @param service.port Kafka port for client connections - ## - port: 9092 - ## @param service.internalPort Kafka port for inter-broker connections - ## - internalPort: 9093 - ## @param service.externalPort Kafka port for external connections - ## - externalPort: 9094 - ## @param service.nodePorts [object] 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: "" - ## @param service.loadBalancerIP loadBalancerIP for Kafka Service - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer - ## - loadBalancerIP: "" - ## @param service.loadBalancerSourceRanges Address(es) that are allowed when service is LoadBalancer - ## 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: [] - ## @param service.annotations Service annotations - ## - annotations: {} -## External Access to Kafka brokers configuration -## -externalAccess: - ## @param externalAccess.enabled 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: - ## @param externalAccess.autoDiscovery.enabled Enable using an init container to auto-detect external IPs/ports by querying the K8s API - ## - enabled: false - ## Bitnami Kubectl image - ## ref: https://hub.docker.com/r/bitnami/kubectl/tags/ - ## @param externalAccess.autoDiscovery.image.registry Init container auto-discovery image registry - ## @param externalAccess.autoDiscovery.image.repository Init container auto-discovery image repository - ## @param externalAccess.autoDiscovery.image.tag Init container auto-discovery image tag (immutable tags are recommended) - ## @param externalAccess.autoDiscovery.image.pullPolicy Init container auto-discovery image pull policy - ## @param externalAccess.autoDiscovery.image.pullSecrets Init container auto-discovery image pull secrets - ## - image: - registry: docker.io - repository: bitnami/kubectl - tag: 1.23.1-debian-10-r26 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: https://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: https://kubernetes.io/docs/user-guide/compute-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:'. - ## @param externalAccess.autoDiscovery.resources.limits Init container auto-discovery resource limits - ## @param externalAccess.autoDiscovery.resources.requests Init container auto-discovery resource requests - ## - resources: - ## Example: - ## limits: - ## cpu: 100m - ## memory: 128Mi - limits: {} - ## Examples: - ## requests: - ## cpu: 100m - ## memory: 128Mi - requests: {} - ## Parameters to configure K8s service(s) used to externally access Kafka brokers - ## A new service per broker will be created - ## - service: - ## @param externalAccess.service.type Kubernetes Service type for external access. It can be NodePort or LoadBalancer - ## - type: LoadBalancer - ## @param externalAccess.service.port Kafka port used for external access when service type is LoadBalancer - ## - port: 9094 - ## @param externalAccess.service.loadBalancerIPs 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: [] - ## @param externalAccess.service.loadBalancerSourceRanges Address(es) that are allowed when service is LoadBalancer - ## 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: [] - ## @param externalAccess.service.nodePorts Array of node ports used for each Kafka broker. Length must be the same as replicaCount - ## Example: - ## nodePorts: - ## - 30001 - ## - 30002 - ## - nodePorts: [] - ## @param externalAccess.service.useHostIPs Use service host IPs to configure Kafka external listener when service type is NodePort - ## - useHostIPs: false - ## @param externalAccess.service.domain Domain or external ip used to configure Kafka external listener when service type is NodePort - ## If not specified, the container will try to get the kubernetes node external IP - ## - domain: "" - ## @param externalAccess.service.annotations Service annotations for external access - ## - annotations: {} - ## @param externalAccess.service.usePodIPs using the MY_POD_IP address for external access. - ## - usePodIPs: false - -## @section Persistence parameters - -## Persistence parameters -## -persistence: - ## @param persistence.enabled Enable Kafka data persistence using PVC, note that Zookeeper persistence is unaffected - ## - enabled: true - ## @param persistence.existingClaim Provide an existing `PersistentVolumeClaim`, the value is evaluated as a template - ## If defined, PVC must be created manually before volume will be bound - ## The value is evaluated as a template - ## - existingClaim: "" - ## @param persistence.storageClass PVC Storage Class for Kafka data volume - ## If defined, storageClassName: - ## 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: "" - ## @param persistence.accessModes PV Access Mode - ## - accessModes: - - ReadWriteOnce - ## @param persistence.size PVC Storage Request for Kafka data volume - ## - size: 8Gi - ## @param persistence.annotations Annotations for the PVC - ## - annotations: {} - ## @param persistence.selector Selector to match an existing Persistent Volume for Kafka's data PVC. If set, the PVC can't have a PV dynamically provisioned for it - ## selector: - ## matchLabels: - ## app: my-app - selector: {} - ## @param persistence.mountPath Mount path of the Kafka data volume - ## - mountPath: /bitnami/kafka -## Log Persistence parameters -## -logPersistence: - ## @param logPersistence.enabled Enable Kafka logs persistence using PVC, note that Zookeeper persistence is unaffected - ## - enabled: false - ## @param logPersistence.existingClaim 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: "" - ## @param logPersistence.existingLogClaim PV Storage Class - ## If defined, storageClassName: - ## 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. - existingLogClaim: "" - ## @param logPersistence.accessModes PV Access Mode - ## - accessModes: - - ReadWriteOnce - ## @param logPersistence.size PVC Storage Request for Kafka logs volume - ## - size: 8Gi - ## @param logPersistence.annotations Annotations for the PVC - ## - annotations: {} - ## @param logPersistence.selector Selector to match an existing Persistent Volume for Kafka's log data PVC. If set, the PVC can't have a PV dynamically provisioned for it - ## selector: - ## matchLabels: - ## app: my-app - selector: {} - ## @param logPersistence.mountPath Mount path of the Kafka logs volume - ## - mountPath: /opt/bitnami/kafka/logs - -## @section RBAC parameters - -## Kafka pods ServiceAccount -## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ -## -serviceAccount: - ## @param serviceAccount.create Enable creation of ServiceAccount for Kafka pods - ## - create: true - ## @param serviceAccount.name The name of the service account to use. If not set and `create` is `true`, a name is generated - ## If not set and create is true, a name is generated using the kafka.serviceAccountName template - ## - name: "" - ## @param serviceAccount.automountServiceAccountToken Allows auto mount of ServiceAccountToken on the serviceAccount created - ## Can be set to false if pods using this serviceAccount do not need to use K8s API - ## - automountServiceAccountToken: true -## Role Based Access -## ref: https://kubernetes.io/docs/admin/authorization/rbac/ -## -rbac: - ## @param rbac.create Whether to create & use RBAC resources or not - ## binding Kafka ServiceAccount to a role - ## that allows Kafka pods querying the K8s API - ## - create: false - -## @section Volume Permissions parameters - -## Init Container parameters -## 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: - ## @param volumePermissions.enabled Enable init container that changes the owner and group of the persistent volume(s) mountpoint to `runAsUser:fsGroup` - ## - enabled: false - ## The security context for the volumePermissions init container - ## @param volumePermissions.securityContext.runAsUser User ID for the container. - ## Can be set to "auto". "auto" is especially useful for OpenShift which has scc with dynamic user ids (and 0 is not allowed). - ## - securityContext: - runAsUser: 0 - ## @param volumePermissions.image.registry Init container volume-permissions image registry - ## @param volumePermissions.image.repository Init container volume-permissions image name - ## @param volumePermissions.image.tag Init container volume-permissions image tag - ## @param volumePermissions.image.pullPolicy Init container volume-permissions image pull policy - ## @param volumePermissions.image.pullSecrets Specify docker-registry secret names as an array - ## - image: - registry: docker.io - repository: bitnami/bitnami-shell - tag: 10-debian-10-r307 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: https://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: https://kubernetes.io/docs/user-guide/compute-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:'. - ## @param volumePermissions.resources.limits Init container volume-permissions resource limits - ## @param volumePermissions.resources.requests Init container volume-permissions resource requests - ## - resources: - ## Example: - ## limits: - ## cpu: 100m - ## memory: 128Mi - limits: {} - ## Examples: - ## requests: - ## cpu: 100m - ## memory: 128Mi - requests: {} - -## @section Metrics parameters - -## Prometheus Exporters / Metrics -## -metrics: - ## Prometheus Kafka Exporter: exposes complimentary metrics to JMX Exporter - ## - kafka: - ## @param metrics.kafka.enabled Whether or not to create a standalone Kafka exporter to expose Kafka metrics - ## - enabled: false - ## Bitnami Kafka exporter image - ## ref: https://hub.docker.com/r/bitnami/kafka-exporter/tags/ - ## @param metrics.kafka.image.registry Kafka exporter image registry - ## @param metrics.kafka.image.repository Kafka exporter image repository - ## @param metrics.kafka.image.tag Kafka exporter image tag (immutable tags are recommended) - ## @param metrics.kafka.image.pullPolicy Kafka exporter image pull policy - ## @param metrics.kafka.image.pullSecrets Specify docker-registry secret names as an array - ## - image: - registry: docker.io - repository: bitnami/kafka-exporter - tag: 1.4.2-debian-10-r115 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: https://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: [] - ## Kafka exporter pods ServiceAccount - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/configure-service-account/ - ## - serviceAccount: - ## @param metrics.kafka.serviceAccount.create Enable creation of ServiceAccount for Kafka exporter pods - ## - create: true - ## @param metrics.kafka.serviceAccount.name The name of the service account to use. If not set and `create` is `true`, a name is generated - ## If not set and create is true, a name is generated using the kafka.metrics.kafka.serviceAccountName template - ## - name: "" - ## @param metrics.kafka.serviceAccount.automountServiceAccountToken Allows auto mount of ServiceAccountToken on the serviceAccount created - ## Can be set to false if pods using this serviceAccount do not need to use K8s API - ## - automountServiceAccountToken: true - ## @param metrics.kafka.schedulerName Name of the k8s scheduler (other than default) for Kafka Exporter - ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ - ## - schedulerName: "" - ## @param metrics.kafka.extraFlags Extra flags to be passed to Kafka exporter - ## Example: - ## extraFlags: - ## tls.insecure-skip-tls-verify: "" - ## web.telemetry-path: "/metrics" - ## - extraFlags: {} - ## @param metrics.kafka.certificatesSecret Name of the existing secret containing the optional certificate and key files - ## for Kafka Exporter client authentication - ## - certificatesSecret: "" - ## @param metrics.kafka.tlsCert The secret key from the certificatesSecret if 'client-cert' key different from the default (cert-file) - ## - tlsCert: cert-file - ## @param metrics.kafka.tlsKey The secret key from the certificatesSecret if 'client-key' key different from the default (key-file) - ## - tlsKey: key-file - ## @param metrics.kafka.tlsCaSecret Name of the existing secret containing the optional ca certificate for Kafka Exporter client authentication - ## - tlsCaSecret: "" - ## @param metrics.kafka.tlsCaCert The secret key from the certificatesSecret or tlsCaSecret if 'ca-cert' key different from the default (ca-file) - ## - tlsCaCert: ca-file - ## @param metrics.kafka.podLabels Kafka exporter pod labels - ## Ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ - ## - podLabels: {} - ## @param metrics.kafka.podAnnotations Kafka exporter pod annotations - ## ref: https://kubernetes.io/docs/concepts/overview/working-with-objects/annotations/ - ## - podAnnotations: {} - ## Prometheus Kafka Exporter containers' Security Context - ## @param metrics.kafka.containerSecurityContext.enabled Enable Prometheus Kafka Exporter containers' Security Context - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container - ## Example: - ## containerSecurityContext: - ## enabled: true - ## capabilities: - ## drop: ["NET_RAW"] - ## readOnlyRootFilesystem: true - ## - containerSecurityContext: - enabled: false - ## Prometheus Kafka Exporter' resource requests and limits - ## ref: https://kubernetes.io/docs/user-guide/compute-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:'. - ## @param metrics.kafka.resources.limits Kafka Exporter container resource limits - ## @param metrics.kafka.resources.requests Kafka Exporter container resource requests - ## - resources: - ## Example: - ## limits: - ## cpu: 100m - ## memory: 128Mi - limits: {} - ## Examples: - ## requests: - ## cpu: 100m - ## memory: 128Mi - requests: {} - ## @param metrics.kafka.affinity Affinity for Kafka Exporter pod assignment - ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity - ## Note: podAffinityPreset, podAntiAffinityPreset, and nodeAffinityPreset will be ignored when it's set - ## - affinity: {} - ## @param metrics.kafka.nodeSelector Node labels for Kafka Exporter pod assignment - ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ - ## - nodeSelector: {} - ## @param metrics.kafka.tolerations Tolerations for Kafka Exporter pod assignment - ## Ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ - ## - tolerations: [] - ## @param metrics.kafka.initContainers Add init containers to the Kafka exporter pods - ## Example: - ## initContainers: - ## - name: your-image-name - ## image: your-image - ## imagePullPolicy: Always - ## ports: - ## - name: portname - ## containerPort: 1234 - ## - initContainers: [] - ## Service configuration - ## - service: - ## @param metrics.kafka.service.type Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) for Kafka Exporter - ## - type: ClusterIP - ## @param metrics.kafka.service.port Kafka Exporter Prometheus port - ## - port: 9308 - ## @param metrics.kafka.service.nodePort Kubernetes HTTP node port - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - ## - nodePort: "" - ## @param metrics.kafka.service.loadBalancerIP loadBalancerIP if service type is `LoadBalancer` - ## Set the LoadBalancer service type to internal only - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer - ## - loadBalancerIP: "" - ## @param metrics.kafka.service.loadBalancerSourceRanges 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: [] - ## @param metrics.kafka.service.clusterIP Static clusterIP or None for headless services - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address - ## - clusterIP: "" - ## @param metrics.kafka.service.annotations [object] 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: - ## @param metrics.jmx.enabled Whether or not to expose JMX metrics to Prometheus - ## - enabled: false - ## Bitnami JMX exporter image - ## ref: https://hub.docker.com/r/bitnami/jmx-exporter/tags/ - ## @param metrics.jmx.image.registry JMX exporter image registry - ## @param metrics.jmx.image.repository JMX exporter image repository - ## @param metrics.jmx.image.tag JMX exporter image tag (immutable tags are recommended) - ## @param metrics.jmx.image.pullPolicy JMX exporter image pull policy - ## @param metrics.jmx.image.pullSecrets Specify docker-registry secret names as an array - ## - image: - registry: docker.io - repository: bitnami/jmx-exporter - tag: 0.16.1-debian-10-r177 - ## Specify a imagePullPolicy - ## Defaults to 'Always' if image tag is 'latest', else set to 'IfNotPresent' - ## ref: https://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 Containers' Security Context - ## @param metrics.jmx.containerSecurityContext.enabled Enable Prometheus JMX Exporter Containers' Security Context - ## ref: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/#set-the-security-context-for-a-container - ## Example: - ## containerSecurityContext: - ## enabled: true - ## capabilities: - ## drop: ["NET_RAW"] - ## readOnlyRootFilesystem: true - ## - containerSecurityContext: - enabled: false - ## Prometheus JMX Exporter' resource requests and limits - ## ref: https://kubernetes.io/docs/user-guide/compute-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:'. - ## @param metrics.jmx.resources.limits JMX Exporter container resource limits - ## @param metrics.jmx.resources.requests JMX Exporter container resource requests - ## - resources: - ## Example: - ## limits: - ## cpu: 100m - ## memory: 128Mi - limits: {} - ## Examples: - ## requests: - ## cpu: 100m - ## memory: 128Mi - requests: {} - ## Service configuration - ## - service: - ## @param metrics.jmx.service.type Kubernetes service type (`ClusterIP`, `NodePort` or `LoadBalancer`) for JMX Exporter - ## - type: ClusterIP - ## @param metrics.jmx.service.port JMX Exporter Prometheus port - ## - port: 5556 - ## @param metrics.jmx.service.nodePort Kubernetes HTTP node port - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#type-nodeport - ## - nodePort: "" - ## @param metrics.jmx.service.loadBalancerIP loadBalancerIP if service type is `LoadBalancer` - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#internal-load-balancer - ## - loadBalancerIP: "" - ## @param metrics.jmx.service.loadBalancerSourceRanges 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: [] - ## @param metrics.jmx.service.clusterIP Static clusterIP or None for headless services - ## ref: https://kubernetes.io/docs/concepts/services-networking/service/#choosing-your-own-ip-address - ## - clusterIP: "" - ## @param metrics.jmx.service.annotations [object] Annotations for the JMX Exporter Prometheus metrics service - ## - annotations: - prometheus.io/scrape: "true" - prometheus.io/port: "{{ .Values.metrics.jmx.service.port }}" - prometheus.io/path: "/" - ## @param metrics.jmx.whitelistObjectNames Allows setting which JMX objects you want to expose to via JMX stats to JMX Exporter - ## 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:* - ## @param metrics.jmx.config [string] Configuration file for JMX exporter - ## 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 }} - ## @param metrics.jmx.existingConfigmap Name of existing ConfigMap with JMX exporter configuration - ## NOTE: This will override metrics.jmx.config - ## - existingConfigmap: "" - ## Prometheus Operator ServiceMonitor configuration - ## - serviceMonitor: - ## @param metrics.serviceMonitor.enabled if `true`, creates a Prometheus Operator ServiceMonitor (requires `metrics.kafka.enabled` or `metrics.jmx.enabled` to be `true`) - ## - enabled: false - ## @param metrics.serviceMonitor.namespace Namespace in which Prometheus is running - ## - namespace: "" - ## @param metrics.serviceMonitor.interval Interval at which metrics should be scraped - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint - ## - interval: "" - ## @param metrics.serviceMonitor.scrapeTimeout Timeout after which the scrape is ended - ## ref: https://github.com/coreos/prometheus-operator/blob/master/Documentation/api.md#endpoint - ## - scrapeTimeout: "" - ## @param metrics.serviceMonitor.selector ServiceMonitor selector labels - ## ref: https://github.com/bitnami/charts/tree/master/bitnami/prometheus-operator#prometheus-configuration - ## e.g: - ## selector: - ## prometheus: my-prometheus - ## - selector: {} - ## @param metrics.serviceMonitor.relabelings Relabel configuration for the metrics - ## - relabelings: [] - ## @param metrics.serviceMonitor.metricRelabelings MetricRelabelConfigs to apply to samples before ingestion - ## - metricRelabelings: [] - -## @section Kafka provisioning parameters - -## Kafka provisioning -## -provisioning: - ## @param provisioning.enabled Enable kafka provisioning Job - ## - enabled: false - ## @param provisioning.numPartitions Default number of partitions for topics when unspecified. - numPartitions: 1 - ## @param provisioning.replicationFactor Default replication factor for topics when unspecified. - replicationFactor: 1 - ## @param provisioning.schedulerName Name of the k8s scheduler (other than default) for kafka provisioning - ## ref: https://kubernetes.io/docs/tasks/administer-cluster/configure-multiple-schedulers/ - ## - schedulerName: "" - ## @param provisioning.podAnnotations Provisioning Pod annotations. - ## - podAnnotations: {} - ## 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:'. - ## @param provisioning.resources.limits The resources limits for the container - ## @param provisioning.resources.requests The requested resources for the container - ## - resources: - ## Example: - ## limits: - ## cpu: 250m - ## memory: 1Gi - limits: {} - ## Examples: - ## requests: - ## cpu: 250m - ## memory: 256Mi - requests: {} - ## @param provisioning.command Override provisioning container command - ## - command: [] - ## @param provisioning.args Override provisioning container arguments - ## - args: [] - ## @param provisioning.topics Kafka provisioning topics - ## - name: topic-name - ## partitions: 1 - ## replicationFactor: 1 - ## ## https://kafka.apache.org/documentation/#topicconfigs - ## config: - ## max.message.bytes: 64000 - ## flush.messages: 1 - ## - topics: [] - -## @section Zookeeper chart parameters - -## Zookeeper chart configuration -## https://github.com/bitnami/charts/blob/master/bitnami/zookeeper/values.yaml -## -zookeeper: - ## @param zookeeper.enabled Switch to enable or disable the Zookeeper helm chart - ## - enabled: true - auth: - ## @param zookeeper.auth.enabled Enable Zookeeper auth - ## - enabled: false - ## @param zookeeper.auth.clientUser User that will use Zookeeper clients to auth - ## - clientUser: "" - ## @param zookeeper.auth.clientPassword Password that will use Zookeeper clients to auth - ## - clientPassword: "" - ## @param zookeeper.auth.serverUsers Comma, semicolon or whitespace separated list of user to be created. Specify them as a string, for example: "user1,user2,admin" - ## - serverUsers: "" - ## @param zookeeper.auth.serverPasswords 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: - ## @param externalZookeeper.servers Server or list of external Zookeeper servers to use - ## - servers: []