I am new at Strimzi and want to get some advice
We have kafka cluster in GKE. It is deployed with Strimzi and we have it on all stands including prod env.
Our configuration of PVC that used by
kafka:
template:
pod:
.....
storage:
type: jbod
volumes:
- id: 0
type: persistent-claim
size: {{ .Values.kafka.storageSize | quote }}
deleteClaim: true
And storage that zookeeper is using:
zookeeper:
...
storage:
type: persistent-claim
size: {{ .Values.zookeeper.storageSize | quote }}
deleteClaim: true
With this configuration PVs are created with ReclaimPolicy: Delete, because it is default Storage Class and I need to change it to custom (with ReclaimPolicy: Retain)
And now i need to save all data in topics and change storageClass of both broker's and zookeeper's storages.
So my question is what should I do and in what order because if I just change the class through .spec.storage.class
then PVC will be released and PV would be deleted.
You can't really change the storage class for existing volumes.
There are several options how to work around it for Kafka:
kafka-reassign-partitions.sh
script.KafkaNodePool
resources (and if you don't, you can migrate to node pools), you can create a new node pool with the new storage class and move all partition-replicas to it, and then remove the old node pool once empty. Here, you can use Cruise Control to move the partition-replicas, so it is a but easier.For ZooKeeper, none of these are really possibly. There are only hacky ways how to change the storage type. But maybe you can use the KRaft-migration that you would anyway need to go through sooner or later as an opportunity to change the storage type.