In order to start the demo from scratch, with minimal effort: delete only the kafka broker and the topics:
oc delete kafkatopics --selector="strimzi.io/cluster=my-cluster"
oc delete kafka my-cluster
Drop the PVC:
oc delete pvc --selector="strimzi.io/cluster=my-cluster"
Delete kafka rebalance:
oc delete kafkarebalance full-rebalance
Then, you can apply again the first two yaml files.
When on the client side you get an error id, e.g.:
2023-06-06 17:50:29,556 DEBUG Runtime failure during token validation (ErrId: 5cbf1e54)
You can search that id in the server log to gather further insights.
To raise the log verbosity, use the following configuration:
spec:
kafka:
logging:
type: inline
loggers:
log4j.logger.io.strimzi: "DEBUG"
It could happen that you drop your Kafka cluster before removing kafka topics.
In such a case you cannot delete the project (namespace).
In order to delete the dangling topics is to remove the finalizer, this script remove it for all topics in a given namespace:
c -n my-kafka get kafkatopics -o jsonpath='{.items[*].metadata.name}' |xargs -n 1 oc -n my-kafka patch kafkatopics --type=merge -p '{"metadata":{"finalizers":null}}'