Kokil Thapa - Professional Web Developer in Nepal
Freelancer Web Developer in Nepal with 15+ Years of Experience

Kokil Thapa is an experienced full-stack web developer focused on building fast, secure, and scalable web applications. He helps businesses and individuals create SEO-friendly, user-focused digital platforms designed for long-term growth.

Run Kafka on Kubernetes with Strimzi

By Kokil Thapa | Last reviewed: September 2026

Event-driven systems need a broker that survives node failures, scales with traffic, and stays operable under load. To run Kafka on Kubernetes with Strimzi, you install a cluster-scoped operator that watches custom resources and reconciles brokers, ZooKeeper or KRaft controllers, listeners, and topics into a working Apache Kafka deployment. If you are new to the broker itself, start with Apache Kafka fundamentals before touching cluster YAML. This guide walks through a production-minded path on any conformant Kubernetes cluster, including EKS, bare-metal, or managed offerings.

What is Strimzi and why should you run Kafka on Kubernetes with Strimzi?

Strimzi is a Kubernetes operator for Apache Kafka. It extends the API with CRDs such as Kafka, KafkaTopic, KafkaUser, and KafkaConnect. You declare desired state in YAML. The operator creates StatefulSets, Services, ConfigMaps, and certificates to match that state.

Running Kafka by hand on Kubernetes is painful. You must handle broker IDs, inter-broker TLS, log directories on persistent volumes, and rolling restarts without losing quorum. Strimzi encodes those operations into tested reconciliation loops. That is why most teams that run Kafka on Kubernetes with Strimzi choose the operator instead of raw StatefulSet manifests.

Strimzi also ships Entity Operator components for topic and user management. Topic creation stays declarative. ACLs and TLS credentials stay in sync with your KafkaUser objects. For teams comparing brokers, see RabbitMQ vs Kafka before committing to Kafka on cluster.

Strimzi Control PlaneCluster OperatorWatches CRDsEntity OperatorTopics and UsersKafka ConnectOptional syncKafka Cluster (Reconciled)Broker PodsControllerPVC StorageServices, Secrets, NetworkPolicies
Strimzi operator architecture when you run Kafka on Kubernetes with Strimzi — CRDs drive broker and storage reconciliation

Strimzi vs manual Kafka on Kubernetes

CriteriaStrimzi operatorManual StatefulSets
Broker rolling upgradesAutomated, partition-awareCustom scripts, high risk
TLS and certificatesBuilt-in CA or cert-managerManual Secret rotation
Topic managementKafkaTopic CRDShell scripts or CI jobs
KRaft migration pathSupported in recent versionsYou own every step
Day-2 operationsMetrics, Cruise Control hooksAssemble yourself

The operator pattern is documented in the Kubernetes operator concept guide. Strimzi applies that model specifically to Kafka. For storage decisions that affect broker performance, read Kubernetes persistent volumes and storage and OpenEBS for Kubernetes storage.

How do you install the Strimzi Kafka operator on Kubernetes?

Start with a cluster that meets Strimzi requirements. You need a supported Kubernetes version, a default StorageClass for broker logs, and enough CPU and memory for at least three brokers in production. A three-broker cluster with replication factor three tolerates one broker loss without data unavailability.

Install from the official release bundle

Download the install YAML for your Strimzi version from the Strimzi documentation. Apply cluster-scoped CRDs first, then namespace-scoped operator resources.

  1. Create a dedicated namespace, commonly kafka.
  2. Apply CRD manifests from the release bundle.
  3. Deploy the Cluster Operator into the namespace.
  4. Verify the operator pod is running before creating a Kafka resource.
kubectl create namespace kafka

kubectl create -f 'https://strimzi.io/install/latest?namespace=kafka' -n kafka

kubectl get pods -n kafka
kubectl wait --for=condition=Ready pod -l name=strimzi-cluster-operator -n kafka --timeout=300s

On shared clusters, restrict who can create Kafka resources through Kubernetes RBAC. The operator needs permissions to manage StatefulSets, Services, Secrets, and PVCs in watched namespaces.

GitOps-friendly installation

Teams using Argo CD GitOps for Kubernetes typically commit the operator manifests and a kustomization overlay. Pin the Strimzi version in Git. Upgrade the operator before bumping broker Kafka versions. Never let Argo auto-sync a major Strimzi jump without reading the release notes.

Strimzi Install Sequence1. Namespace2. Apply CRDs3. Operator4. Kafka CROperator Reconciliation LoopWatch Kafka CRDiff desired stateApply resourcesRepeat until Ready condition is True
Four-step install flow before you run Kafka on Kubernetes with Strimzi in production

How do you deploy a Kafka cluster with Strimzi custom resources?

The core object is the Kafka CR. It defines Kafka version, broker replicas, listeners, storage, and metadata mode. Modern deployments use KRaft mode, which removes the ZooKeeper dependency. Check your Strimzi release notes for the exact KRaft support matrix before choosing metadata mode.

Minimal production-shaped Kafka manifest

apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
  name: prod-cluster
  namespace: kafka
spec:
  kafka:
    version: 3.9.0
    replicas: 3
    listeners:
      - name: plain
        port: 9092
        type: internal
        tls: false
      - name: tls
        port: 9093
        type: internal
        tls: true
    config:
      offsets.topic.replication.factor: 3
      transaction.state.log.replication.factor: 3
      transaction.state.log.min.isr: 2
      default.replication.factor: 3
      min.insync.replicas: 2
    storage:
      type: jbod
      volumes:
        - id: 0
          type: persistent-claim
          size: 100Gi
          deleteClaim: false
  entityOperator:
    topicOperator: {}
    userOperator: {}

Apply the manifest and watch reconciliation:

kubectl apply -f kafka-cluster.yaml
kubectl get kafka -n kafka
kubectl wait kafka/prod-cluster --for=condition=Ready --timeout=600s -n kafka

Define topics declaratively with KafkaTopic. This prevents ad-hoc topic creation with wrong partition counts. Partition count affects parallelism for consumers; see Kafka consumer groups and partitions for sizing guidance.

apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
  name: orders-events
  namespace: kafka
  labels:
    strimzi.io/cluster: prod-cluster
spec:
  partitions: 12
  replicas: 3
  config:
    retention.ms: 604800000
    cleanup.policy: delete

Application teams often produce JSON payloads. Validate schemas in CI with a JSON formatter and validator before publishing to Kafka. Bad payloads at scale are expensive to replay.

Broker StatefulSet TopologyBroker-0 PodKafka processPVC log-0Headless SVCBroker-1 PodKafka processPVC log-1Headless SVCBroker-2 PodKafka processPVC log-2Headless SVCStable network IDs via StatefulSet ordinals
Three-broker StatefulSet layout with dedicated PVCs — standard when you run Kafka on Kubernetes with Strimzi

How do you configure storage, networking, and security for Strimzi Kafka?

Storage is the most common production failure point. Kafka brokers are write-heavy. Place PVCs on fast SSD-backed StorageClasses. Set deleteClaim: false on production volumes so accidental cluster deletion does not wipe logs. Snapshot PVCs regularly; pair Strimzi with Velero backup and restore for Kubernetes and volume snapshot workflows from volume snapshots in Kubernetes.

Resource requests and limits

Under-provisioned brokers cause long GC pauses and ISR shrink events. Set CPU and memory requests based on measured throughput, not guesses. Read Kubernetes resource limits and requests before applying defaults. A starting point for moderate traffic is 4 vCPU and 8 GiB RAM per broker, then tune with metrics.

  kafka:
    resources:
      requests:
        memory: 8Gi
        cpu: "2"
      limits:
        memory: 8Gi
        cpu: "4"

Networking and ingress

Internal listeners serve in-cluster producers and consumers. External listeners expose Kafka outside the cluster through LoadBalancer, NodePort, or Ingress routes. Pick the model that matches your cloud or on-prem setup. For ingress-based routing patterns, see Kubernetes ingress controllers explained.

Lock down east-west traffic with Kubernetes network policies. Allow only application namespaces to reach broker ports. Deny everything else by default.

TLS, authentication, and authorization

Enable TLS on every listener that crosses a trust boundary. Strimzi can generate a cluster CA automatically. For enterprise PKI, integrate cert-manager. Create per-application credentials with KafkaUser:

apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaUser
metadata:
  name: checkout-service
  namespace: kafka
  labels:
    strimzi.io/cluster: prod-cluster
spec:
  authentication:
    type: tls
  authorization:
    type: simple
    acls:
      - resource:
          type: topic
          name: orders-events
          patternType: literal
        operations:
          - Read
          - Write
          - Describe

Mount the generated Secret into your application pod as keystore and truststore files. Rotate credentials by updating the KafkaUser and rolling app pods. Never share one Kafka user across unrelated services.

Strimzi Security LayersApp NamespaceProducer / ConsumerNetworkPolicyAllow port 9093 onlyKafkaUser ACLsTopic-level authZKafka NamespaceTLS ListenerBroker PodsEncrypted PVC
Defense in depth — TLS listeners, network policies, and KafkaUser ACLs for Strimzi Kafka

How do you connect applications and tune performance after deployment?

Producers and consumers inside the cluster should use the internal bootstrap service Strimzi creates. The address follows the pattern prod-cluster-kafka-bootstrap.kafka.svc:9093 for TLS listeners. Configure client properties for acks, retries, and idempotence based on your delivery guarantees.

Laravel and PHP applications can publish domain events to Kafka through rdkafka or HTTP bridge patterns. For container basics around deploying those apps, see Kubernetes for Laravel getting started. On marketplace platforms like Gulfbizlist, event streams decouple listing updates from search indexing workers.

Monitoring and alerting

Export broker metrics with Strimzi's KafkaExporter or JMX Prometheus rules. Watch these signals:

  • Under-replicated partitions — should stay at zero in healthy clusters.
  • Offline partitions — immediate page; consumers stall.
  • Request handler idle ratio — sustained low values mean CPU saturation.
  • Disk usage on PVCs — expand volumes before brokers reject writes.

Pair metrics with log aggregation. Broker logs explain leader elections and slow replicas that dashboards alone miss.

How do you upgrade, scale, and troubleshoot Strimzi Kafka on Kubernetes?

Upgrades are two-step: operator first, Kafka version second. Edit the Kafka CR spec.kafka.version field. Strimzi rolls brokers one at a time. Ensure min.insync.replicas and replication factors stay compatible during the roll.

Scaling brokers and disks

Increase spec.kafka.replicas to add brokers. Reassign partitions with Cruise Control if enabled, or use kafka-reassign-partitions.sh. Expand PVCs only if your StorageClass supports volume expansion. JBOD volumes add disks without replacing existing claims.

Common failure modes

Brokers stuck in CrashLoopBackOff often trace to corrupt logs or wrong storage mounts. Follow debug a CrashLoopBackOff in Kubernetes systematically. Check kubectl describe pod events first.

ISR shrink loops usually mean slow disks or network latency between zones. Avoid spreading brokers across availability zones unless your SLA requires it. Cross-AZ traffic adds latency that hurts Kafka.

Operator reconcile errors appear in Cluster Operator logs. A typo in listener config blocks the entire cluster reconcile. Validate YAML in CI. Use Kubernetes troubleshooting field guide patterns for systemic issues.

Rolling Broker UpgradeBroker 0Broker 1Broker 2Step 1: Drain Broker 0UpgradingBroker 1Broker 2Step 2: Repeat for each brokerSafety ChecksISR >= min.insyncNo offline partsRF unchangedClients retry OKReady = True
Strimzi rolling upgrade — one broker at a time while ISR and replication stay healthy

For long-running operational ownership, many teams engage support and maintenance services or Linux system administration. Building the full event platform — brokers plus services — falls under enterprise application development. Booking systems such as Adventure Third Pole Trek benefit from reliable async pipelines during peak season traffic.

Consult the Apache Kafka documentation for broker configuration semantics that Strimzi passes through unchanged. Strimzi wraps operations; it does not replace Kafka tuning knowledge.

Key Takeaways

  • Install Strimzi CRDs and the Cluster Operator in a dedicated namespace before creating any Kafka resource.
  • Use three or more brokers, replication factor three, and min.insync.replicas: 2 for production durability.
  • Keep broker logs on fast SSD PVCs with deleteClaim: false and regular snapshots.
  • Enable TLS and KafkaUser ACLs per application; never share cluster-wide credentials.
  • Upgrade the Strimzi operator first, then bump spec.kafka.version and watch rolling restarts.
  • Monitor under-replicated partitions, disk usage, and handler idle ratio — alert before clients fail.

People Also Ask

Does Strimzi support KRaft without ZooKeeper?

Yes. Recent Strimzi releases support KRaft mode for Kafka metadata, removing ZooKeeper pods from the cluster. Check the Strimzi version matrix against your target Kafka release before migrating. Greenfield deployments in 2026 should prefer KRaft when your operator version supports it.

Can Strimzi run Kafka on minimal clusters like k3s?

Strimzi runs on any conformant Kubernetes distribution, including lightweight setups covered in k3s lightweight Kubernetes. Production Kafka still needs sufficient CPU, memory, and SSD storage. A single-node lab cluster is fine for learning; do not use it as a production template.

How do external clients connect to Strimzi Kafka?

Configure an external listener type on the Kafka CR — LoadBalancer, NodePort, or route-based ingress depending on your platform. Clients use the bootstrap address and TLS certificates from a KafkaUser Secret. Document connection strings per environment so mobile and SaaS consumers do not hard-code internal DNS names.

What backup strategy works for Strimzi Kafka?

Combine PVC snapshots with metadata backups of topic configs and ACLs stored in Git as CRDs. Velero covers namespace-level disaster recovery. Message data retention is governed by topic retention.ms; snapshots capture point-in-time broker state for catastrophic failure scenarios.

Run Kafka on Kubernetes with Strimzi in production

You now have a complete path to run Kafka on Kubernetes with Strimzi: operator install, declarative cluster and topic resources, hardened networking, and rolling upgrade discipline. Start in a staging namespace, load-test with realistic producer batch sizes, and promote the same Git-managed manifests to production through your CI pipeline.

Need help designing event-driven architecture, integrating Kafka with your application stack, or operating brokers on managed Kubernetes? Contact us to discuss your workload, or explore related guides on Kubernetes performance tuning and horizontal pod autoscaling.

Frequently Asked Questions

Install the Strimzi Cluster Operator, apply a Kafka custom resource for brokers and storage, then create KafkaTopic and KafkaUser resources. Strimzi reconciles pods, services, certificates, and rolling upgrades automatically.

Strimzi is a Kubernetes operator for Apache Kafka. It extends the API with CRDs such as Kafka, KafkaTopic, KafkaUser, and KafkaConnect. You declare desired state in YAML and the operator creates StatefulSets, Services, ConfigMaps, and certificates to match. Running Kafka by hand on Kubernetes means handling broker IDs, inter-broker TLS, log directories on persistent volumes, and rolling restarts without losing quorum. Strimzi encodes those operations into tested reconciliation loops, which is why most teams choose the operator over raw StatefulSet manifests.

Start with a conformant cluster that has a default StorageClass and enough CPU and memory for at least three production brokers. Create a dedicated namespace, commonly kafka. Apply cluster-scoped CRDs from the official Strimzi release bundle, deploy the Cluster Operator into that namespace, and verify the operator pod is Ready before creating any Kafka resource. On shared clusters, restrict who can create Kafka resources through Kubernetes RBAC because the operator needs permissions to manage StatefulSets, Services, Secrets, and PVCs in watched namespaces.

Yes. Recent Strimzi releases support KRaft mode for Kafka metadata, removing ZooKeeper pods. Check the Strimzi version matrix against your target Kafka release before migrating. Greenfield deployments in 2026 should prefer KRaft when your operator version supports it.

Yes. Strimzi runs on any conformant Kubernetes distribution, including lightweight k3s setups. A single-node lab cluster is fine for learning, but production Kafka still needs sufficient CPU, memory, and SSD storage.

The core object is the Kafka CR, which defines Kafka version, broker replicas, listeners, storage, and metadata mode. Modern deployments use KRaft mode when your Strimzi release supports it. Enable the Entity Operator for declarative topic and user management. Apply the manifest and wait for the Ready condition. Define topics with KafkaTopic resources so partition counts and retention stay in Git instead of ad-hoc shell creation. Partition count affects consumer parallelism, so size topics deliberately before producers start publishing at scale.

Use at least three brokers so a cluster with replication factor three tolerates one broker loss without data unavailability. Set offsets.topic.replication.factor, transaction.state.log.replication.factor, and default.replication.factor to three, with min.insync.replicas at two. Place broker logs on fast SSD-backed persistent volumes with deleteClaim set to false so accidental cluster deletion does not wipe data. Set CPU and memory requests from measured throughput—a starting point for moderate traffic is four vCPU and eight GiB RAM per broker, then tune using exported metrics rather than leaving defaults in place.

Manual StatefulSet deployments require custom scripts for broker rolling upgrades, TLS rotation, and topic management, each carrying high operational risk. Strimzi automates partition-aware rolling upgrades, provides built-in CA or cert-manager integration, and manages topics and users through KafkaTopic and KafkaUser CRDs. Recent Strimzi versions also offer a supported KRaft migration path plus metrics and Cruise Control hooks that you would otherwise assemble yourself. For day-two operations, the operator pattern keeps reconciliation consistent instead of relying on one-off maintenance scripts that break during the next upgrade.

Storage is the most common production failure point because Kafka brokers are write-heavy. Place PVCs on fast SSD-backed StorageClasses and set deleteClaim to false on production volumes so accidental cluster deletion does not wipe logs. Snapshot PVCs regularly and pair Strimzi with Velero for namespace-level backup and restore workflows. JBOD volumes let you add disks without replacing existing claims. Expand PVCs only if your StorageClass supports volume expansion, and monitor disk usage on broker volumes before brokers reject writes during traffic spikes.

Enable TLS on every listener that crosses a trust boundary. Strimzi can generate a cluster CA automatically, or you can integrate cert-manager for enterprise PKI. Create per-application credentials with KafkaUser resources using TLS authentication and simple ACLs scoped to specific topics. Mount the generated Secret into application pods as keystore and truststore files. Rotate credentials by updating the KafkaUser and rolling app pods. Lock down east-west traffic with Kubernetes network policies that allow only application namespaces to reach broker ports and deny everything else by default.

Configure an external listener type on the Kafka CR using LoadBalancer, NodePort, or route-based ingress depending on your platform. Clients use the bootstrap address and TLS certificates from a KafkaUser Secret. Document connection strings per environment so mobile and SaaS consumers do not hard-code internal DNS names like prod-cluster-kafka-bootstrap.kafka.svc, which only resolve inside the cluster. Match the listener model to your cloud or on-prem setup and keep TLS enabled on any path that crosses a trust boundary rather than exposing a plain internal listener externally.

Producers and consumers inside the cluster should use the internal bootstrap service Strimzi creates, following the pattern prod-cluster-kafka-bootstrap.kafka.svc on the TLS listener port. Configure client properties for acks, retries, and idempotence based on your delivery guarantees. Laravel and PHP applications can publish domain events through rdkafka or HTTP bridge patterns. Validate JSON payloads in CI before publishing because bad payloads at scale are expensive to replay. Never share one KafkaUser credential across unrelated services.

Export broker metrics with Strimzi KafkaExporter or JMX Prometheus rules. Under-replicated partitions should stay at zero in healthy clusters. Offline partitions need an immediate page because consumers stall. Request handler idle ratio sustained at low values signals CPU saturation. Disk usage on PVCs should trigger alerts before brokers reject writes. Pair metrics with log aggregation because broker logs explain leader elections and slow replicas that dashboards alone miss. Alert before clients fail, not after produce or consume latency spikes appear in application logs.

Upgrades are two-step: upgrade the Strimzi operator first, then bump spec.kafka.version on the Kafka CR. Strimzi rolls brokers one at a time while keeping ISR and replication healthy. Ensure min.insync.replicas and replication factors stay compatible during the roll. Teams using Argo CD should pin the Strimzi version in Git, upgrade the operator before bumping broker Kafka versions, and never auto-sync a major Strimzi jump without reading release notes. Validate YAML in CI because a typo in listener config can block the entire cluster reconcile.

Combine PVC snapshots with metadata backups of topic configs and ACLs stored in Git as CRDs. Velero covers namespace-level disaster recovery alongside volume snapshot workflows. Message data retention is governed by topic retention.ms settings on KafkaTopic resources. Snapshots capture point-in-time broker state for catastrophic failure scenarios where recreating empty brokers from YAML alone is not enough. Regular snapshots matter because deleteClaim false protects against accidental CR deletion but does not replace off-cluster recovery copies when a storage backend fails entirely.

Share this article

0 Comments

Leave a comment

Your email is not published. Comments appear once they have been read. Sign in to have your details filled in.

Quick Contact Options
Choose how you want to connect me: