pravega / zookeeper-operator

Kubernetes Operator for Zookeeper
Apache License 2.0
364 stars 203 forks source link

Operator pre-delete script should limit resources check to namespace #600

Closed csandanov closed 5 months ago

csandanov commented 5 months ago

Description

The pre-delete jobs checks for zookeeper cluster before deleting the operator but looks across all namespaces

ret=$(kubectl get zookeepercluster --all-namespaces --no-headers 2>&1)

In case of multi-tenant deployment when there are multiple operators per namespace this essentially prevents operator from being successfully deleted

Importance

must-have

Location

Config map https://github.com/pravega/zookeeper-operator/blob/master/charts/zookeeper-operator/templates/pre-delete-hooks.yaml

Suggestions for an improvement

Limit the zookeeper clusters check to the current release namespace, alternatively check for {{ .Values.watchNamespace }}

csandanov commented 5 months ago

Ok it seems you cannot have multi-tenant with zookeeper operator because even if you introduce the change I suggested the CRD will be deleted during uninstall (and I see no option to keep it) which will delete zookeeper clusters from all namespaces.