kafka

by HelmForge

Helm chartv1.5.4App 4.4.0Apache-2.0Verified publisher

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-broker for development and simple internal environments
  • cluster for 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

ArchitectureWhen to useDocument
single-brokerdevelopment, CI, demos, and simple internal workloads without node-level broker redundancydocs/single-broker.md
clusterproduction-oriented Kafka with dedicated KRaft controllers and brokersdocs/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.0 JVM 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+found directories 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 extraInitContainers for 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 cluster in 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

ParameterDescriptionDefault
runtimeKafka runtime: jvm or nativejvm
architecturesingle-broker or clustersingle-broker
image.repositoryJVM runtime and native setup image repositoryapache/kafka
image.tagJVM Kafka image tag4.4.0
native.image.repositoryNative runtime image repositoryapache/kafka-native
native.image.tagNative Kafka image tag4.4.0
service.typeClient bootstrap service typeClusterIP
service.ipFamilyPolicyService IP family policy for client, headless, and metrics Services""
service.ipFamiliesService IP families for client, headless, and metrics Services[]
kraft.existingSecretExisting secret for cluster ID and controller directory IDs""
listeners.client.portKafka client port9092
listeners.controller.portKRaft controller port9093
listeners.interBroker.portInter-broker port9094
config.numPartitionsDefault partitions for new topics3
config.autoCreateTopicsEnabledEnable automatic topic creationfalse
singleBroker.persistence.enabledEnable PVC in single-broker modetrue
cluster.controllers.replicaCountController replicas in cluster mode3
cluster.brokers.replicaCountBroker replicas in cluster mode. Set to 0 for combined mode (controllers act as brokers)3
cluster.minInSyncReplicasMinimum ISR in cluster mode2
metrics.enabledEnable JMX exporter javaagent metricsfalse
metrics.agent.urlJMX exporter javaagent download URLMaven Central 1.0.1 jar
metrics.agent.sha256SHA-256 checksum for the JMX exporter javaagent7d61f737...
metrics.serviceMonitor.enabledCreate ServiceMonitor resourcesfalse
pdb.enabledCreate PodDisruptionBudgets in cluster modefalse
podSecurityContextPod security contextfsGroup: 1000, RuntimeDefault seccomp
securityContextContainer security contextuid 1000, runAsNonRoot, no escalation, drop ALL
automountServiceAccountTokenMount the ServiceAccount tokenfalse

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, RuntimeDefault seccomp, 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

FrameworkScore
MITRE + NSA + SOC286.36364%

Security posture acceptable.

CI scenarios

The ci/ directory covers the main supported paths:

  • single-broker.yaml
  • cluster.yaml
  • combined-mode.yaml
  • metrics.yaml
  • cluster-tuned.yaml
  • native-single-broker.yaml
  • native-cluster.yaml
  • native-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+found directories from PVCs during pod initialization to prevent Kafka startup failures on ext4/xfs filesystems
  • metrics.enabled is supported only with runtime=jvm
  • keep image.tag and native.image.tag aligned when using runtime=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.

  1. Pick a serverConnect Hetzner, OVHcloud or AWS. The builder starts on Hetzner, the cheapest sample rate.
  2. Place the chartkafka is pinned at v1.5.4 in opentenant.yaml. Drag more apps from the marketplace onto a rack.
  3. 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