kafka
by HelmForge
Apache Kafka Helm chart for JVM and native KRaft runtimes
About this chart
Kafka
Apache Kafka for Kubernetes using a KRaft-only design. The chart supports the official
apache/kafka JVM runtime by default and the experimental
apache/kafka-native runtime as an option.
When runtime=native, an init container based on apache/kafka generates server.properties and formats
KRaft storage before the native container starts. Apache currently recommends the native image for local
development and testing rather than production.
This chart intentionally supports two clear topologies:
single-brokerfor development and simple internal environmentsclusterfor production-oriented deployments with dedicated controllers and brokers
Install
HTTPS repository
helm repo add helmforge https://repo.helmforge.dev
helm repo update
helm install kafka helmforge/kafka -f values.yaml
OCI registry
helm install kafka oci://ghcr.io/helmforgedev/helm/kafka -f values.yaml
Supported architectures
| Architecture | When to use | Document |
|---|---|---|
single-broker | development, CI, demos, and simple internal workloads without node-level broker redundancy | docs/single-broker.md |
cluster | production-oriented Kafka with dedicated KRaft controllers and brokers | docs/cluster.md |
cluster (combined mode) | 3-node HA production deployments where each controller also acts as a broker (brokers.replicaCount: 0) | docs/combined-mode.md |
What this chart covers
- KRaft only
- official Kafka
4.4.0JVM or native runtime image - JVM-based setup init container when the native runtime is selected
- persistent storage for single-broker, controllers, and brokers
- automatic cleanup of
lost+founddirectories in PVCs (ext4/xfs compatibility) - stable in-cluster advertised listeners for brokers
- explicit KRaft cluster ID and controller directory ID secret handling
- optional Prometheus metrics through a SHA-256 verified JMX exporter javaagent for the JVM runtime
- optional
ServiceMonitor - optional
PodDisruptionBudget - support for
extraInitContainersfor custom initialization logic
What this chart does not try to automate in v1
- ZooKeeper mode
- external listeners or cloud load balancer matrices
- TLS, SASL, ACLs, and credential lifecycle
- ecosystem components such as Kafka Connect, MirrorMaker, Schema Registry, or UIs
Official references
Quick start
Single broker:
architecture: single-broker
singleBroker:
persistence:
size: 8Gi
Native single broker for development/testing:
runtime: native
architecture: single-broker
Cluster (dedicated controllers and brokers):
architecture: cluster
cluster:
minInSyncReplicas: 2
controllers:
replicaCount: 3
persistence:
size: 8Gi
brokers:
replicaCount: 3
persistence:
size: 50Gi
pdb:
enabled: true
Cluster (combined mode - controllers act as brokers):
architecture: cluster
cluster:
minInSyncReplicas: 2
controllers:
replicaCount: 3
persistence:
size: 50Gi
brokers:
replicaCount: 0 # Combined mode: process.roles=broker,controller
pdb:
enabled: true
Metrics:
# Metrics require runtime=jvm.
metrics:
enabled: true
serviceMonitor:
enabled: true
Production direction
- use
clusterin production - keep dedicated controllers and brokers
- validate topic creation, producer, and consumer flows before promotion
- keep persistence enabled for both controllers and brokers
- treat external access, TLS, and auth as deliberate follow-up work rather than hidden defaults
Main values
| Parameter | Description | Default |
|---|---|---|
runtime | Kafka runtime: jvm or native | jvm |
architecture | single-broker or cluster | single-broker |
image.repository | JVM runtime and native setup image repository | apache/kafka |
image.tag | JVM Kafka image tag | 4.4.0 |
native.image.repository | Native runtime image repository | apache/kafka-native |
native.image.tag | Native Kafka image tag | 4.4.0 |
service.type | Client bootstrap service type | ClusterIP |
service.ipFamilyPolicy | Service IP family policy for client, headless, and metrics Services | "" |
service.ipFamilies | Service IP families for client, headless, and metrics Services | [] |
kraft.existingSecret | Existing secret for cluster ID and controller directory IDs | "" |
listeners.client.port | Kafka client port | 9092 |
listeners.controller.port | KRaft controller port | 9093 |
listeners.interBroker.port | Inter-broker port | 9094 |
config.numPartitions | Default partitions for new topics | 3 |
config.autoCreateTopicsEnabled | Enable automatic topic creation | false |
singleBroker.persistence.enabled | Enable PVC in single-broker mode | true |
cluster.controllers.replicaCount | Controller replicas in cluster mode | 3 |
cluster.brokers.replicaCount | Broker replicas in cluster mode. Set to 0 for combined mode (controllers act as brokers) | 3 |
cluster.minInSyncReplicas | Minimum ISR in cluster mode | 2 |
metrics.enabled | Enable JMX exporter javaagent metrics | false |
metrics.agent.url | JMX exporter javaagent download URL | Maven Central 1.0.1 jar |
metrics.agent.sha256 | SHA-256 checksum for the JMX exporter javaagent | 7d61f737... |
metrics.serviceMonitor.enabled | Create ServiceMonitor resources | false |
pdb.enabled | Create PodDisruptionBudgets in cluster mode | false |
podSecurityContext | Pod security context | fsGroup: 1000, RuntimeDefault seccomp |
securityContext | Container security context | uid 1000, runAsNonRoot, no escalation, drop ALL |
automountServiceAccountToken | Mount the ServiceAccount token | false |
Topics created without an explicit replication factor use
default.replication.factor: 1 in single-broker mode and the internal
replication factor (up to 3) in cluster mode.
Security
- Pods run as uid 1000 without privilege escalation, with every capability
dropped,
RuntimeDefaultseccomp, and no ServiceAccount token. - All listeners use
PLAINTEXT. Keep Kafka inside a trusted network boundary and restrict access with NetworkPolicies; TLS and SASL are not modeled yet.
Security Scan: kafka
| Framework | Score |
|---|---|
| MITRE + NSA + SOC2 | 86.36364% |
Security posture acceptable.
CI scenarios
The ci/ directory covers the main supported paths:
single-broker.yamlcluster.yamlcombined-mode.yamlmetrics.yamlcluster-tuned.yamlnative-single-broker.yamlnative-cluster.yamlnative-combined-mode.yaml
Examples
See examples/:
- single-broker.yaml
- cluster-production.yaml
- combined-mode/
Architecture guides
- Single Broker
- Cluster
- Combined Mode
Important notes
- the bootstrap service is internal-only in v1
- broker advertised listeners use stable StatefulSet pod DNS names
- for production, do not treat this chart as a shortcut around Kafka capacity planning, topic design, and client retry behavior
- the chart automatically removes
lost+founddirectories from PVCs during pod initialization to prevent Kafka startup failures on ext4/xfs filesystems metrics.enabledis supported only withruntime=jvm- keep
image.tagandnative.image.tagaligned when usingruntime=native
Deploy kafka with OpenTenant
Each tenant gets its own release of this chart, with its own namespace, secrets and domain. The builder below already has kafka on a Hetzner server. Change the host, add apps from the marketplace, then copy the generated files. Providers and prices are samples, and nothing here is sent anywhere.
- Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
- Place the chartkafka is pinned at v1.5.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
- ApplySave opentenant.yaml and main.tf from the console, then run the commands below.
# opentenant.yaml, main.tf and dns.tf come from the builder below opentenant validate opentenant.yaml terraform init && terraform apply