Skip to content

Upgrade to Kraft

The following steps are required to migrate to Kraft

  • Migrate to KafkaNodePool
  • Activate KafkaNodePool
  • Add controller KafkaNodePool
  • Enable Kafka Migration
  • Set Kraft
  • Cleanup

More info https://strimzi.io/docs/operators/latest/deploying#proc-deploy-migrate-kraft-str

apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaNodePool
metadata:
name: kafka
namespace: inma-kafka
labels:
strimzi.io/cluster: inma-kafka-cluster
spec:
replicas: 2
roles:
- broker
storage:
type: jbod
volumes:
- id: 0
type: persistent-claim
size: 10Gi
deleteClaim: false

Add the following line to Kafka Cluster Yaml

strimzi.io/node-pools: enabled

Example

apiVersion: kafka.strimzi.io/v1beta2
kind: Kafka
metadata:
name: my-cluster
annotations:
strimzi.io/node-pools: enabled
spec:
kafka:
# ...
zookeeper:
# ...
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaNodePool
metadata:
name: controller
namespace: inma-kafka
labels:
strimzi.io/cluster: inma-kafka-cluster
spec:
replicas: 2
roles:
- controller
storage:
type: jbod
volumes:
- id: 0
deleteClaim: false
size: 10Gi
type: persistent-claim
template:
pod:
affinity:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: node-type
operator: In
values:
- kafka
kubectl annotate kafka inma-kafka-cluster strimzi.io/kraft="migration" --overwrite -n inma-kafka

Only when status changed to KRaftPostMigration using

kubectl get kafka inma-kafka-cluster -n inma-kafka -w
kubectl annotate kafka inma-kafka-cluster strimzi.io/kraft="enabled" --overwrite -n inma-kafka

Remove any ZooKeeper-related configuration from the Kafka resource