Uninstall Kubernetes Operator for Apache Cassandra and related resources in Kubernetes

To uninstall Kubernetes Operator for Apache Cassandra and related resources in Kubernetes, use the kubectl delete command.

Uninstalling the resources shown in this topic deletes the workloads, the pods, and all the data associated with the deployments, including all Cassandra or DSE databases and their data. Before uninstalling, verify that you have accounted for any and all dependencies with apps and users of the resources.

Uninstall examples

On a local machine where you have authorized access to the Kubernetes (K8s) cluster, as described in Create a Kubernetes cluster, use the following commands to remove the CassandraDatacenter, the Kubernetes Operator for Apache Cassandra, and the storage class. The examples are for a GKE 1.16 environment in which the Cassandra 3.11.7 image was deployed. Adjust the commands based on your cloud, storage, and database options.

  1. Uninstall a deployed CassandraDatacenter from the Kubernetes cluster.

    For example:

    kubectl delete cassdcs --all-namespaces --all

    Sample Output:

    cassandradatacenter.cassandra.datastax.com "dc1" deleted
  2. Uninstall a deployed Kubernetes Operator for Apache Cassandra from the Kubernetes cluster.

    For example:

    kubectl delete -f https://raw.githubusercontent.com/k8ssandra/cass-operator/v1.7.1/docs/user/cass-operator-manifests.yaml

    Sample Output:

    namespace "cass-operator" deleted
    serviceaccount "cass-operator" deleted
    secret "cass-operator-webhook-config" deleted
    customresourcedefinition.apiextensions.k8s.io "cassandradatacenters.cassandra.datastax.com" deleted
    clusterrole.rbac.authorization.k8s.io "cass-operator-cluster-role" deleted
    clusterrolebinding.rbac.authorization.k8s.io "cass-operator" deleted
    role.rbac.authorization.k8s.io "cass-operator" deleted
    rolebinding.rbac.authorization.k8s.io "cass-operator" deleted
    service "cassandradatacenter-webhook-service" deleted
    deployment.apps "cass-operator" deleted
    validatingwebhookconfiguration.admissionregistration.k8s.io "cassandradatacenter-webhook-registration" deleted
  3. Uninstall the deployed storage class.

    For example:

    kubectl delete -f https://raw.githubusercontent.com/k8ssandra/cass-operator/v1.7.1/operator/k8s-flavors/gke/storage.yaml

    Sample Output:

    storageclass.storage.k8s.io "server-storage" deleted
  4. Verify the deletions:

    kubectl -n cass-operator get pods

    Sample Output:

    No resources found in cass-operator namespace.

What’s next?

For more information about the supported Kubernetes environments, refer to each platform’s documentation.

  • Open-source Kubernetes

  • Google Kubernetes Engine (GKE)

  • Pivotal Container Service (PKS)

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2024 DataStax | Privacy policy | Terms of use

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com