This episode covers deploying Kafka on Kubernetes with Strimzi: the operator pattern and CRDs, Kafka and KafkaConnect resources, StatefulSets and PersistentVolumes, automatic TLS and user management, and production considerations like anti-affinity, storage classes, and multi-zone.

Running Kafka on Kubernetes manually — StatefulSets, services, TLS secrets, and rolling updates — is error-prone work. Strimzi provides a Kubernetes Operator that automates all of it: you describe the cluster with a Custom Resource, and the operator realizes it along with its maintenance operations.
Episode 28 covers the operator and CRD pattern, the main Strimzi resources (Kafka, KafkaConnect, KafkaUser), how StatefulSets and storage work, automatic TLS and ACL management, and production considerations like anti-affinity, storage classes, and multi-zone.
An operator is an application that handles the lifecycle of custom resources: it watches declarations (CRDs), realizes them into K8s resources, and continuously reconciles actual state with desired state. Strimzi contains several operators: the Cluster Operator (brokers, Connect, MirrorMaker), the Topic Operator (topics), and the User Operator (users and ACLs).
The main resources you write:
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
name: my-cluster
spec:
kafka:
replicas: 3
version: 3.7.1
storage:
type: persistent-claim
size: 100Gi
listeners:
- name: tls
port: 9093
type: internal
tls: truespec.kafka.replicas: 3 declares three brokers, and storage: persistent-claim requests a PersistentVolume per pod. The operator creates the StatefulSet, services, and secrets according to this declaration.
Kafka brokers run as a StatefulSet because every pod needs a stable identity (pod name = broker identity) and separate storage. Strimzi creates one pod per broker with its own volume. Rolling updates are done one by one by the operator — brokers never go down at the same time.
Storage is declared per cluster:
storage:
type: persistent-claim
size: 100Gi
class: gp3
deleteClaim: falseclass: gp3 selects a storage class (for example EBS gp3 on AWS); deleteClaim: false keeps volumes around when a cluster is deleted — preventing accidental data loss. Choose a storage class with enough IOPS for Kafka writes.
Strimzi creates services for broker access: one for internal pod-to-pod communication, and one per listener for clients. Broker configuration (for example log segments, retention) is set in spec.kafka.config. TLS credentials and certificates are stored as Secrets automatically mounted into broker pods.
The operator handles rolling updates when the broker version or configuration changes, including partition maintenance during the process. The most valuable part: automatic TLS management — Strimzi creates the CA, issues and rotates certificates for brokers and clients, so you don't manage certificates manually like in episode 18.
Access control is declared, not done with the CLI:
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaUser
metadata:
name: app-producer
spec:
authentication:
type: tls
authorization:
type: simple
acls:
- resource:
type: topic
name: orders
patternType: literal
operation: Writeauthentication.type: tls gives the user a certificate for mutual TLS, and authorization.acls replaces kafka-acls.sh — the operator applies the ACLs to the cluster automatically.
Strimzi exposes metrics for Prometheus (episode 22) and can integrate Cruise Control (episode 20) for automatic rebalancing — both are simply enabled via CRD declarations.
One broker per physical node so a node failure doesn't take down several brokers at once:
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- topologyKey: kubernetes.io/hostname
labelSelector:
matchLabels:
strimzi.io/name: my-cluster-kafkapodAntiAffinity prevents two broker pods from being scheduled on the same node. Combine with topology.kubernetes.io/zone to spread brokers across AZs (rack awareness, episode 24).
broker.rack based on zone labels so replicas spread across AZs.Tip
Start in development with ephemeral storage and one broker for experiments, but redesign for production: three brokers, persistent storage with enough IOPS, anti-affinity, and monitoring from day one. Switching storage classes after production is difficult.
In this episode 28 you've understood deploying Kafka on Kubernetes with Strimzi: the operator and CRD pattern, StatefulSets and storage, automatic TLS and user management, and production considerations like anti-affinity, storage classes, and multi-zone.
The key takeaways:
deleteClaim: false prevents data loss when a cluster is deleted.In the next episode 29 we'll discuss Docker and container best practices — official and Confluent images, Docker Compose for multi-broker setups with Schema Registry and ksqlDB, and JVM, memory, health check, and volume considerations in containers.