Summary
Deleting a tenant that has a Kafka app leaves the tenant namespace stuck in Terminating indefinitely. The KafkaTopic CR keeps the finalizer strimzi.io/topic-operator, but the Strimzi topic-operator is torn down together with the Kafka app, so nothing ever removes the finalizer and the namespace never finalizes.
Environment
- Cozystack
v1.6.1-rc.1
- A Kafka app (Strimzi-based) with at least one topic
Steps to reproduce
- Create a tenant.
- Deploy a Kafka app with a topic (e.g. topic
orders).
- Delete the tenant (this deletes the Kafka app and the namespace).
Actual result
The tenant namespace hangs in Terminating:
NamespaceContentRemaining: Some resources are remaining: kafkatopics.kafka.strimzi.io has 1 resource instances
NamespaceFinalizersRemaining: Some content in the namespace has finalizers remaining: strimzi.io/topic-operator in 1 resource instances
The KafkaTopic (e.g. kafka-kafka-orders) still carries finalizers: [strimzi.io/topic-operator]. The Strimzi topic-operator has already been deleted together with the Kafka app, so no controller is left to drain that finalizer. The namespace stays in Terminating forever.
Reproduced on every tenant that had a Kafka app (multiple tenants stuck the same way).
Expected result
Deleting the tenant / Kafka app should clean up KafkaTopic resources (or drain their finalizers) so the namespace terminates cleanly, without manual finalizer surgery.
Workaround
Remove the finalizer manually, then the namespace finalizes within seconds:
kubectl -n tenant-<name> patch kafkatopic <topic-name> \
--type=merge -p '{"metadata":{"finalizers":null}}'
Suggested fix
Order the teardown so the Strimzi topic-operator outlives its KafkaTopic resources (drain the strimzi.io/topic-operator finalizer before the operator itself is removed), or have the Kafka app / tenant deletion explicitly delete KafkaTopic CRs and wait for their finalizers to clear before removing the operator.
Summary
Deleting a tenant that has a Kafka app leaves the tenant namespace stuck in
Terminatingindefinitely. TheKafkaTopicCR keeps the finalizerstrimzi.io/topic-operator, but the Strimzi topic-operator is torn down together with the Kafka app, so nothing ever removes the finalizer and the namespace never finalizes.Environment
v1.6.1-rc.1Steps to reproduce
orders).Actual result
The tenant namespace hangs in
Terminating:The
KafkaTopic(e.g.kafka-kafka-orders) still carriesfinalizers: [strimzi.io/topic-operator]. The Strimzi topic-operator has already been deleted together with the Kafka app, so no controller is left to drain that finalizer. The namespace stays inTerminatingforever.Reproduced on every tenant that had a Kafka app (multiple tenants stuck the same way).
Expected result
Deleting the tenant / Kafka app should clean up
KafkaTopicresources (or drain their finalizers) so the namespace terminates cleanly, without manual finalizer surgery.Workaround
Remove the finalizer manually, then the namespace finalizes within seconds:
Suggested fix
Order the teardown so the Strimzi topic-operator outlives its
KafkaTopicresources (drain thestrimzi.io/topic-operatorfinalizer before the operator itself is removed), or have the Kafka app / tenant deletion explicitly deleteKafkaTopicCRs and wait for their finalizers to clear before removing the operator.