In case you want to delete the Koperator from your cluster, note that because of dependencies between the various components, they must be deleted in specific order.
CAUTION:
Itβs important to delete the Koperator deployment as the last step.Uninstall Koperator π︎
-
Delete the Prometheus instance used by the Kafka cluster. If you used the sample Prometheus instance from the Koperator repository you can use the following command, otherwise do this step manually according to the way you deployed the Prometheus instance.
kubectl delete \ -n kafka \ -f https://raw.githubusercontent.com/banzaicloud/koperator/0.24.1/config/samples/kafkacluster-prometheus.yamlExpected output:
clusterrole.rbac.authorization.k8s.io/prometheus deleted clusterrolebinding.rbac.authorization.k8s.io/prometheus deleted prometheus.monitoring.coreos.com/kafka-prometheus deleted prometheusrule.monitoring.coreos.com/kafka-alerts deleted serviceaccount/prometheus deleted servicemonitor.monitoring.coreos.com/cruisecontrol-servicemonitor deleted servicemonitor.monitoring.coreos.com/kafka-servicemonitor deleted -
Delete KafkaCluster Custom Resource (CR) that represent the Kafka cluster and Cruise Control.
kubectl delete kafkaclusters -n kafka kafkaExample output:
kafkacluster.kafka.banzaicloud.io/kafka deletedWait for the Kafka resources (Pods, PersistentVolumeClaims, Configmaps, etc) to be removed.
kubectl get pods -n kafkaExpected output:
NAME READY STATUS RESTARTS AGE kafka-operator-operator-8458b45587-286f9 2/2 Running 0 62sYou would also need to delete other Koperator-managed CRs (if any) following the same fashion
Note: KafkaCluster, KafkaTopic and KafkaUser custom resources are protected with Kubernetes finalizers, so those wonβt be actually deleted from Kubernetes until the Koperator removes those finalizers. After the Koperator has finished cleaning up everything, it removes the finalizers. In case you delete the Koperator deployment before it cleans up everything, you need to remove the finalizers manually.
-
Uninstall Koperator deployment.
helm uninstall kafka-operator -n kafkaExpected output:
release "kafka-operator" uninstalled -
Delete Koperator Custom Resource Definitions (CRDs).
kubectl delete -f https://github.com/banzaicloud/koperator/releases/download/v0.24.1/kafka-operator.crds.yaml
Uninstall Prometheus operator π︎
-
Uninstall the prometheus-operator deployment.
helm uninstall -n prometheus prometheusExpected output:
release "prometheus" uninstalled -
If no other cluster resources uses prometheus-operator CRDs, delete the prometheus-operator’s CRDs.
Note: Red Hat OpenShift clusters require those CRDs to function so do not delete those on such clusters.
kubectl get crd | grep 'monitoring.coreos.com'| awk '{print $1};' | xargs kubectl delete crd
Uninstall Zookeeper Operator π︎
-
Delete Zookeeper CR.
kubectl delete zookeeperclusters -n zookeeper zookeeper-serverExpected output:
zookeeperclusters.zookeeper.pravega.io/zookeeper-server deletedWait for the Zookeeper resources (Deployment, PersistentVolumeClaims, Configmaps, etc) to be removed.
kubectl get pods -n zookeeperExpected output:
NAME READY STATUS RESTARTS AGE zookeeper-operator-5857967dcc-gm5l5 1/1 Running 0 3m22s -
Uninstall the zookeeper-operator deployment.
helm uninstall zookeeper-operator -n zookeeper -
If no other cluster resource uses Zookeeper CRDs, delete Zookeeper Operator’s CRDs
kubectl delete customresourcedefinition zookeeperclusters.zookeeper.pravega.io
Uninstall Cert-Manager π︎
Uninstall with Helm π︎
-
Uninstall cert-manager deployment.
helm uninstall -n cert-manager cert-managerExpected output:
release "cert-manager" uninstalled -
If no other cluster resource uses cert-manager CRDs, delete cert-manager’s CRDs:
kubectl delete -f https://github.com/jetstack/cert-manager/releases/download/v1.11.0/cert-manager.crds.yamlExpected output:
customresourcedefinition.apiextensions.k8s.io/certificaterequests.cert-manager.io deleted customresourcedefinition.apiextensions.k8s.io/certificates.cert-manager.io deleted customresourcedefinition.apiextensions.k8s.io/challenges.acme.cert-manager.io deleted customresourcedefinition.apiextensions.k8s.io/clusterissuers.cert-manager.io deleted customresourcedefinition.apiextensions.k8s.io/issuers.cert-manager.io deleted customresourcedefinition.apiextensions.k8s.io/orders.acme.cert-manager.io deleted