Uninstall

How to uninstall the clickhouse-operator and its namespace

To remove the clickhouse-operator, both the clickhouse-operator and the components in its installed namespace will have to be removed. The proper command is to uses the same clickhouse-operator-install-bundle.yaml file that was used to install the clickhouse-operator. For more details, see how to install and verify the clickhouse-operator.

The following instructions are based on the standard installation instructions. For users who perform a custom installation, note that the any custom namespaces that the user wants to remove will have to be deleted separate from the clickhouse-operator deletion.

For example, if the custom namespace operator-test is created, then it would be removed with the command kubectl delete namespaces operator-test.

Instructions

To remove the clickhouse-operator from your Kubernetes environment from a standard install:

  1. Verify the clickhouse-operator is in the kube-system namespace. The clickhouse-operator and other pods will be displayed:

    NAME                                   READY   STATUS    RESTARTS      AGE
    clickhouse-operator-6fd75cbd68-fqltz   2/2     Running   0             5s
    coredns-78fcd69978-7dqnd               1/1     Running   0             14m
    etcd-minikube                          1/1     Running   0             14m
    kube-apiserver-minikube                1/1     Running   0             14m
    kube-controller-manager-minikube       1/1     Running   0             14m
    kube-proxy-vnbqp                       1/1     Running   0             14m
    kube-scheduler-minikube                1/1     Running   0             14m
    storage-provisioner                    1/1     Running   1 (14m ago)   14m
    
  2. Issue the kubectl delete command using the same YAML file used to install the clickhouse-operator, specifying the kube-system namespace. This produces output similar to the following:

    kubectl delete --namespace "kube-system" -f https://raw.githubusercontent.com/Altinity/clickhouse-operator/master/deploy/operator/clickhouse-operator-install-bundle.yaml
    
    warning: deleting cluster-scoped resources, not scoped to the provided namespace
    customresourcedefinition.apiextensions.k8s.io "clickhouseinstallations.clickhouse.altinity.com" deleted
    customresourcedefinition.apiextensions.k8s.io "clickhouseinstallationtemplates.clickhouse.altinity.com" deleted
    customresourcedefinition.apiextensions.k8s.io "clickhouseoperatorconfigurations.clickhouse.altinity.com" deleted
    serviceaccount "clickhouse-operator" deleted
    clusterrole.rbac.authorization.k8s.io "clickhouse-operator-kube-system" deleted
    clusterrolebinding.rbac.authorization.k8s.io "clickhouse-operator-kube-system" deleted
    configmap "etc-clickhouse-operator-files" deleted
    configmap "etc-clickhouse-operator-confd-files" deleted
    configmap "etc-clickhouse-operator-configd-files" deleted
    configmap "etc-clickhouse-operator-templatesd-files" deleted
    configmap "etc-clickhouse-operator-usersd-files" deleted
    deployment.apps "clickhouse-operator" deleted
    service "clickhouse-operator-metrics" deleted
    
  3. To verify the clickhouse-operator has been removed, use the kubectl get namespaces command:

    kubectl get pods --namespace kube-system
    
    NAME                               READY   STATUS    RESTARTS      AGE
    coredns-78fcd69978-7dqnd           1/1     Running   0             14m
    etcd-minikube                      1/1     Running   0             14m
    kube-apiserver-minikube            1/1     Running   0             14m
    kube-controller-manager-minikube   1/1     Running   0             14m
    kube-proxy-vnbqp                   1/1     Running   0             14m
    kube-scheduler-minikube            1/1     Running   0             14m
    storage-provisioner                1/1     Running   1 (14m ago)   14m
    

Last modified 2022.01.07: QA reviewed, ready for merge.