Uninstall

How to uninstall the Altinity Kubernetes Operator and its namespace

To remove the Altinity Kubernetes Operator, both the Altinity Kubernetes 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 Altinity Kubernetes Operator. For more details, see how to install and verify the Altinity Kubernetes 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 Altinity Kubernetes 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 Altinity Kubernetes Operator from your Kubernetes environment from a standard install:

  1. Verify the Altinity Kubernetes Operator is in the kube-system namespace. The Altinity Kubernetes Operator and other pods will be displayed:

    NAME                                   READY   STATUS    RESTARTS       AGE
    clickhouse-operator-77b54889b4-mlzqc   2/2     Running   0              5s
    coredns-78fcd69978-nthp2               1/1     Running   2 (107m ago)   23d
    etcd-minikube                          1/1     Running   2 (107m ago)   23d
    kube-apiserver-minikube                1/1     Running   2 (107m ago)   23d
    kube-controller-manager-minikube       1/1     Running   2 (107m ago)   23d
    kube-proxy-lsggn                       1/1     Running   2 (107m ago)   23d
    kube-scheduler-minikube                1/1     Running   2 (107m ago)   23d
    storage-provisioner                    1/1     Running   5 (106m ago)   23d
    
  2. Issue the kubectl delete command using the same YAML file used to install the Altinity Kubernetes Operator. By default the Altinity Kubernetes Operator is installed in the namespace kube-system. If this was installed into a custom namespace, verify that it installed in the uninstall command. In this example, we specified an installation of the Altinity Kubernetes Operator version 0.18.1 into the default kube-system namespace. This produces output similar to the following:

    kubectl delete -f https://github.com/Altinity/clickhouse-operator/raw/0.18.1/deploy/operator/clickhouse-operator-install-bundle.yaml
    
    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 Altinity Kubernetes Operator has been removed, use the kubectl get namespaces command:

    kubectl get pods --namespace kube-system
    
    NAME                               READY   STATUS    RESTARTS       AGE
    coredns-78fcd69978-nthp2           1/1     Running   2 (107m ago)   23d
    etcd-minikube                      1/1     Running   2 (107m ago)   23d
    kube-apiserver-minikube            1/1     Running   2 (107m ago)   23d
    kube-controller-manager-minikube   1/1     Running   2 (107m ago)   23d
    kube-proxy-lsggn                   1/1     Running   2 (107m ago)   23d
    kube-scheduler-minikube            1/1     Running   2 (107m ago)   23d
    storage-provisioner                1/1     Running   5 (106m ago)   23d