Strimzi turns Kafka, topics, users, and Connect workers into Kubernetes resources. It does not turn a regional GKE cluster into a fault-tolerant Kafka service by itself. The production contract still depends on broker placement, replicated data, persistent-volume semantics, client authentication, capacity headroom, and an upgrade and recovery process that the team has executed.
The design below keeps the Kafka control plane and data plane explicit. It targets a regional GKE cluster, separate broker and workload node pools, Strimzi-managed certificates, Workload Identity for Google Cloud access, and regional persistent disks for broker data.
Set the availability boundary
Start with three brokers in three zones, at least three controller quorums, and a PodDisruptionBudget that cannot evict multiple brokers at once. If the selected Strimzi release uses a ZooKeeper-based Kafka topology, treat the three ZooKeeper replicas as equally critical. For a KRaft topology, pin the Kafka and Strimzi versions together and test the controller quorum through a broker and node replacement.
Keep these layers independently upgradeable:
| Layer | Example pin | Upgrade order |
|---|---|---|
| GKE control plane and nodes | release channel plus tested surge settings | first in staging, last in production unless required |
| Strimzi operator and CRDs | one reviewed Helm or manifest version | before Kafka version transitions |
| Kafka | a Strimzi-supported broker image | one broker at a time |
| Kafka Connect and plugins | immutable application image | after broker compatibility is proven |
| Client libraries | one tested protocol matrix | before old TLS or broker versions are removed |
Do not combine a GKE node-channel jump, Strimzi CRD update, Kafka major upgrade, and connector migration in one maintenance window. A version matrix in source control is more useful than a generalized promise that components are “current.”
Build regional and storage foundations
A regional GKE cluster distributes control plane replicas, but workloads still need explicit scheduling constraints. Create dedicated node pools for brokers and application or Connect workloads. Reserve enough memory for page cache and broker heap, and use node taints so general workloads cannot consume the broker capacity.
The storage class must support the zone-aware scheduling model. A regional persistent disk can survive a zonal node failure, but it still adds latency and must be sized for both throughput and IOPS. A zonal disk may be suitable when each of three broker replicas is in another zone and the Kafka RPO tolerates replacing one lost replica from peers; it is not an automatic substitute for a tested restore.
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: kafka-regional
provisioner: pd.csi.storage.gke.io
parameters:
type: pd-balanced
replication-type: regional-pd
reclaimPolicy: Retain
allowVolumeExpansion: true
volumeBindingMode: WaitForFirstConsumer
regional-pd gives a volume zonal redundancy, but it does not make every broker volume available to every node. Node affinity and scheduling still matter. Validate actual attach, detach, resize, and failover behavior in a non-production cluster. The Retain policy protects data from a namespace or PVC deletion; it also means the team must own cleanup inventory.
Install a production Kafka custom resource
The following Strimzi schema targets a Kafka release where KRaft resources are represented by a KafkaNodePool. Confirm the exact CRD fields against the installed Strimzi release before applying it; Kubernetes rejects stale examples early, which is preferable to silently assuming compatibility.
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaNodePool
metadata:
name: brokers
namespace: data-platform
labels:
strimzi.io/cluster: events
spec:
replicas: 3
roles:
- controller
- broker
storage:
type: jbod
volumes:
- id: 0
type: persistent-claim
size: 1Ti
class: kafka-regional
deleteClaim: false
template:
pod:
tolerations:
- key: kafka
operator: Equal
value: data
effect: NoSchedule
topologySpreadConstraints:
- maxSkew: 1
topologyKey: topology.kubernetes.io/zone
whenUnsatisfiable: DoNotSchedule
labelSelector:
matchLabels:
strimzi.io/cluster: events
terminationGracePeriodSeconds: 300
---
apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
name: events
namespace: data-platform
annotations:
strimzi.io/node-pools: enabled
spec:
kafka:
version: 3.6.1
metadataVersion: 3.6-IV2
listeners:
- name: tls
port: 9093
type: internal
tls: true
authentication:
type: tls
- name: external
port: 9094
type: internal
tls: true
authentication:
type: tls
config:
auto.create.topics.enable: false
default.replication.factor: 3
min.insync.replicas: 2
offsets.topic.replication.factor: 3
transaction.state.log.replication.factor: 3
transaction.state.log.min.isr: 2
num.network.threads: 8
num.io.threads: 8
rack:
topologyKey: topology.kubernetes.io/zone
entityOperator:
topicOperator: {}
userOperator: {}
The required min.insync.replicas of two means an acks=all producer rejects a write when fewer than two replicas are in sync. That is intentional: accepting writes with one remaining copy may keep traffic flowing but weakens the durability contract. Monitor producer errors as well as broker health.
For externally reachable traffic, prefer Private Service Connect or a private internal load balancer and firewall policy over a public Kafka listener. The external example remains type: internal so another exposure mechanism can be added without accidentally publishing brokers to the internet.
Declare topics, users, and certificates
Create topics through reviewed KafkaTopic objects and disable runtime auto-creation. For a key-partitioned event stream:
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
name: orders-v1
namespace: data-platform
labels:
strimzi.io/cluster: events
spec:
partitions: 24
replicas: 3
config:
min.insync.replicas: "2"
retention.ms: "1209600000"
segment.bytes: "1073741824"
cleanup.policy: delete
---
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaUser
metadata:
name: order-writer
namespace: data-platform
labels:
strimzi.io/cluster: events
spec:
authentication:
type: tls
authorization:
type: simple
acls:
- resource:
type: topic
name: orders-v1
patternType: literal
operations: [Write, Describe]
Partition count is an operational setting, not a throughput label. First measure records, bytes, consumer processing rate, key skew, and replay window. A 24-partition topic can support 24 concurrently active consumers, but one hot key can still dominate. Make partition expansion a planned migration because reduction is not a standard in-place operation.
Strimzi’s certificate authority and user secrets are Kubernetes Secrets. Store their encryption and backup requirements in the cluster security design. Rotate and replace a CA only with a client-coordinated plan: trust overlap is necessary so brokers and old and new clients can communicate during the transition.
Use Workload Identity without broker credentials
Kafka workloads do not need Google credentials merely because the service runs on GKE. Connectors that read Google Cloud Storage, Pub/Sub, or Secret Manager do need narrowly scoped identities.
Bind a Kubernetes service account to a Google service account:
gcloud iam service-accounts create kafka-connect \
--display-name="Kafka Connect runtime"
gcloud iam service-accounts add-iam-policy-binding \
kafka-connect@PROJECT_ID.iam.gserviceaccount.com \
--role roles/iam.workloadIdentityUser \
--member "serviceAccount:PROJECT_ID.svc.id.goog[data-platform/kafka-connect]"
kubectl annotate serviceaccount kafka-connect \
--namespace data-platform \
iam.gke.io/gcp-service-account=kafka-connect@PROJECT_ID.iam.gserviceaccount.com
Grant the Google service account only the target resource permissions. A GCS connector needs bucket object permissions; a Secret Manager connector needs access only to named secrets. Never put a downloaded Google service-account key in a pod or image. Keep credentials for Kafka itself in Strimzi-generated Secrets mounted with the TLS client identity.
For application secrets that are not Strimzi-owned, use a reviewed Secret Manager CSI Driver or external-secrets workflow. Reference secret names in Kubernetes resources rather than values in Git, and test revocation, rotation, and pod behavior when a secret disappears.
Run Kafka Connect independently
Connect workers are an application tier with offset, config, and status topics. Give them their own deployment and least-privilege role:
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaConnect
metadata:
name: data-connect
namespace: data-platform
annotations:
strimzi.io/use-connector-resources: "true"
spec:
image: REGION-docker.pkg.dev/PROJECT_ID/platform/connect:3.6.1-20240212
replicas: 3
bootstrapServers: events-kafka-bootstrap:9093
serviceAccount: kafka-connect
tls:
trustedCertificates:
- secretName: events-cluster-ca-cert
certificate: ca.crt
config:
group.id: data-connect
offset.storage.topic: connect-offsets
config.storage.topic: connect-configs
status.storage.topic: connect-status
key.converter: org.apache.kafka.connect.storage.StringConverter
value.converter: org.apache.kafka.connect.json.JsonConverter
value.converter.schemas.enable: false
resources:
requests:
cpu: "2"
memory: 6Gi
limits:
cpu: "4"
memory: 8Gi
Build connector plugins into the image and keep a software bill of materials. Installing a plugin into a running pod is not reproducible and survives neither rescheduling nor a security rebuild. Connector secrets belong in a protected configuration mechanism; connector task state belongs in internal topics with replication factor three.
Scale on the real constraint
Adding brokers changes replica placement and network demand but does not add partition-level consumer parallelism. Scale the consuming application or Connect tasks first if:
- brokers have disk and CPU headroom;
- all partitions are online and sufficiently replicated;
- p95 produce and fetch latency is stable;
- consumer lag is growing while network and storage are healthy.
When broker disk reaches 60 to 70 percent and partition skew prevents a safe reset, expand a node pool and broker count, then rebalance. Validate partition reassignment with throttles:
kubectl exec -n data-platform events-brokers-0 -- \
bin/kafka-topics.sh --bootstrap-server localhost:9093 \
--describe --under-replicated-partitions
kubectl exec -n data-platform events-brokers-0 -- \
bin/kafka-topics.sh --bootstrap-server localhost:9093 \
--describe --unavailable-partitions
Use a broker rebalance plan and cap migration throughput. An unrestricted reassignment can turn a capacity action into an outage by saturating regional disks and inter-zone bandwidth. Expand before disk exceeds the volume’s safe operating region, because expansion itself consumes transient space and bandwidth.
Observe health, lag, and recovery debt
At minimum, collect:
- under-replicated, offline, and leaderless partitions;
- active controller and controller-election changes;
- request queue time, produce/fetch latency, bytes per broker, and network utilization;
- log bytes, disk utilization, and regional-volume IOPS/throughput;
- consumer lag by group, topic, and partition;
- Connect task state, retries, dead letters, and last successful offset;
- pod restarts, eviction, Pending time, certificate age, and Secret changes.
Pair symptom metrics with SLOs. Example SLOs are 99.9 percent successful acks=all writes, p99 produce latency under 250 ms, zero offline partitions, and 99 percent of priority events consumed within five minutes. A healthy CPU chart is irrelevant if a connector has been replaying one partition for an hour.
Use alert windows and runbooks. Broker CPU is context; an offline partition and sustained in-sync replica loss are incidents. Certificate expiry alerts should begin well before the shortest client renewal cycle.
Upgrade without losing quorum
The safe operator, CRD, and Kafka sequence is:
- Back up reviewed CRs and Strimzi/CA Secrets through the approved disaster-recovery path.
- Confirm no under-replicated or offline partitions and verify every PVC is
Bound. - Upgrade Strimzi in staging and run a Kafka smoke test with production-compatible TLS clients.
- Update the operator and wait for its deployment and CRDs to become healthy.
- Change one Kafka version field and let Strimzi roll the brokers.
- Before each next broker, wait for ISR, controller stability, and acceptable request latency.
- Run producer/consumer, retention, rebalance, and Connect task checks.
- Keep the previous client and image rollback points until an observation window completes.
kubectl get kafka,kafkanodepool,kafkatopic,kafkauser -n data-platform
kubectl get pods,pvc -n data-platform -o wide
kubectl rollout status deployment/strimzi-cluster-operator -n data-platform
kubectl get events -n data-platform --sort-by=.lastTimestamp | tail -n 50
If a broker will not return, do not delete the PVC in an attempt to make the pod schedule. Inspect volume attachment, node pool capacity, certificate state, and broker logs. A volume recreated with no retained data is no longer one repaired replica; it is a new replica that must be synchronized under load.
Disaster recovery
Replication across zones reduces common failures, but not a region-level control-plane, configuration, or credential event. Define both the Kafka data RPO and the platform reconstruction RPO.
For a regional loss:
- Provision the destination regional GKE cluster, node pools, storage classes, namespaces, RBAC, and pinned Strimzi release.
- Restore the Kafka, node pool, topic, user, and Connect CRs from versioned configuration.
- Restore CA or client trust material only through the reviewed encrypted backup process; otherwise deliberately issue a new trust chain and rotate every client.
- Restore broker data from cross-region replication or persistent-disk backups that satisfy the declared RPO. A PVC snapshot is not independently consistent for a distributed log unless the capture procedure accounts for Kafka replication and commit points.
- Recreate consumers and verify source-to-sink offsets and deduplication keys.
- Run canary writes, forced consumer restarts, and a controlled broker loss before reopening producers.
Cross-region Kafka replication can be implemented with a supported mirror or connector design, but mirror lag is the recovery-point evidence. Also exercise application cutover: DNS, bootstrap addresses, trust roots, consumer-group offsets, and topic ACLs all move as one release.
Production runbook
The day-two checklist should be executable:
# Inventory the desired and observed Strimzi state.
kubectl get kafka,kafkanodepool,kafkatopic,kafkauser,kafkaconnect -n data-platform
kubectl get pods -n data-platform \
-l strimzi.io/cluster=events -o wide
# Check PVC binding and capacity.
kubectl get pvc -n data-platform
kubectl top pod -n data-platform
# Inspect only the broker's current log, then query health metrics.
kubectl logs -n data-platform events-brokers-0 -c kafka --tail=200
# Record the exact operator, CRD, and Kafka versions before a change.
kubectl get kafka events -n data-platform \
-o jsonpath='{.status.kafkaVersion}{"\n"}'
kubectl get deployment strimzi-cluster-operator -n data-platform \
-o jsonpath='{.spec.template.spec.containers[0].image}{"\n"}'
The runbook should also name the owner, incident communication channel, source retention, maximum accepted data loss, certificate contacts, and last successful restore exercise. Kafka on GKE is production-ready when failure and recovery are routine measurements, not heroic debugging.