Uninstalling the Operator

How to uninstall the Altinity Kubernetes Operator for ClickHouse®

To remove the Altinity Kubernetes Operator for ClickHouse®, you first need to delete the ClickHouse resources you created with it. With that done, you can uninstall the operator.

Deleting the ClickHouse resources

Before deleting the operator, you need to delete the ClickHouse resources you created with it.

If you used ClickHouse Keeper (you created a chk resource) with the name clickhouse-keeper:

kubectl delete chk clickhouse-keeper -n operator

If you installed Zookeeper via a YAML file, delete that resource:

kubectl delete -f https://raw.githubusercontent.com/Altinity/clickhouse-operator/release-0.25.3/deploy/zookeeper/zookeeper-manually/quick-start-persistent-volume/zookeeper-3-nodes.yaml -n operator

With the Keeper deleted, now delete the chi (named cluster01 in this example):

kubectl delete chi cluster01 -n operator

This will take a few minutes. When the command is complete, you’re ready to delete any persistent volume claims that might still be around. (The YAML files we used defined reclaimPolicy: Retain, so that persistent storage will still exist.)

First, find the PVCs:

kubectl get pvc -n operator

This gives you the details of all the PVCs:

NAME                                               STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
clickhouse-storage-chi-cluster01-cluster01-0-0-0   Bound    pvc-e7757775-3d02-4c2e-ba21-ae7da30590fb   5Gi        RWO            managed-csi    <unset>                 22m
clickhouse-storage-chi-cluster01-cluster01-0-1-0   Bound    pvc-1ea61128-4b7d-4454-8b26-831013904feb   5Gi        RWO            managed-csi    <unset>                 15m
keeper-storage-chk-clickhouse-keeper-chk01-0-0-0   Bound    pvc-4f9733a5-a0fc-403a-96d6-a3d84feab041   10Gi       RWO            managed-csi    <unset>                 19m
keeper-storage-chk-clickhouse-keeper-chk01-0-1-0   Bound    pvc-6bf01467-7d6b-4291-bef7-b6afd71d559c   10Gi       RWO            managed-csi    <unset>                 18m
keeper-storage-chk-clickhouse-keeper-chk01-0-2-0   Bound    pvc-65c6e214-7c2c-409d-9100-80c7de68155a   10Gi       RWO            managed-csi    <unset>                 18m

(The PVCs you’ll see depend on whether you used ClickHouse Keeper or Zookeeper and whether you created shards.)

Deleting the PVCs will destroy any data you’ve stored. If you’re sure that’s what you want to do, you can use this command to delete a PVC by name:

kubectl delete pvc clickhouse-storage-chi-cluster01-cluster01-0-0-0 -n operator

With these resources deleted, it’s time to delete the operator itself.

Deleting the operator

Deleting the operator depends on how you installed it.

If you installed the operator with Helm

If you installed the operator with Helm, uninstalling it is trivial:

helm uninstall clickhouse-operator -n operator

Now delete your namespace:

kubectl delete ns operator

The last remnants of the operator are its CRDs. The kubectl get crds command will show you that the operator’s CustomResourceDefinitions weren’t deleted:

kubectl get crds | grep clickhouse
NAME                                                           CREATED AT
clickhouseinstallations.clickhouse.altinity.com                2025-08-08T14:16:34Z
clickhouseinstallationtemplates.clickhouse.altinity.com        2025-08-08T14:16:34Z
clickhousekeeperinstallations.clickhouse-keeper.altinity.com   2025-08-08T14:16:34Z
clickhouseoperatorconfigurations.clickhouse.altinity.com       2025-08-08T14:16:35Z

You can delete them with these commands:

kubectl delete crd clickhouseinstallations.clickhouse.altinity.com
kubectl delete crd clickhouseinstallationtemplates.clickhouse.altinity.com
kubectl delete crd clickhousekeeperinstallations.clickhouse-keeper.altinity.com
kubectl delete crd clickhouseoperatorconfigurations.clickhouse.altinity.com

If you installed the operator with kubectl

If you used a shell script that used kubectl to create a namespace and install the operator, run this command:

curl -s https://raw.githubusercontent.com/Altinity/clickhouse-operator/refs/heads/0.25.3/deploy/operator-web-installer/clickhouse-operator-delete.sh | OPERATOR_NAMESPACE=operator bash

This example is for operator version 0.25.3; if you used a different version of the install script, use the corresponding version of the delete script.

The script also deletes your namespace.

The last remnants of the operator are its CRDs. The kubectl get crds command will show you that the operator’s CustomResourceDefinitions weren’t deleted:

kubectl get crds | grep clickhouse
NAME                                                           CREATED AT
clickhouseinstallations.clickhouse.altinity.com                2025-08-08T14:16:34Z
clickhouseinstallationtemplates.clickhouse.altinity.com        2025-08-08T14:16:34Z
clickhousekeeperinstallations.clickhouse-keeper.altinity.com   2025-08-08T14:16:34Z
clickhouseoperatorconfigurations.clickhouse.altinity.com       2025-08-08T14:16:35Z

You can delete them with these commands:

kubectl delete crd clickhouseinstallations.clickhouse.altinity.com
kubectl delete crd clickhouseinstallationtemplates.clickhouse.altinity.com
kubectl delete crd clickhousekeeperinstallations.clickhouse-keeper.altinity.com
kubectl delete crd clickhouseoperatorconfigurations.clickhouse.altinity.com