Configuring Cassandra or DSE in Kubernetes with the Kubernetes Operator for Apache Cassandra

Configure the Kubernetes Operator for Apache Cassandra in an existing Kubernetes environment:

  1. Create a Kubernetes cluster where you will set up the Cassandra Operator and Apache Cassandra® or DataStax Enterprise (DSE) resources, and then authorize connections between your local machine where you will run kubectl commands and your Kubernetes cluster. For instructions, see Create a Kubernetes cluster.

  2. Create a namespace for the cluster:

    kubectl create ns my-db-ns

    This example uses the namespace my-db-ns. Adjust subsequent commands to match the namespace that you defined.

  3. Define a StorageClass resource.

    DataStax recommends that you use the fastest type of networked storage available. For example, on Google Kubernetes Engine (GKE), use the following YAML parameters to define persistent network SSD-backed volumes:

    apiVersion: storage.k8s.io/v1
    kind: StorageClass
    metadata:
      name: server-storage
    provisioner: kubernetes.io/gce-pd
    parameters:
      type: pd-ssd
      replication-type: none
    volumeBindingMode: WaitForFirstConsumer

    You can customize the values for your environment and save the configuration with a name such as server-storage.yaml. These steps assume that you have defined a StorageClass with the name server-storage.

  4. Run the following kubectl command to apply the YAML file and get the resulting storage classes from Kubernetes:

    kubectl -n my-db-ns apply -f ./server-storage.yaml
  5. Verify the storage class configuration:

    kubectl -n my-db-ns get storageclass

    Make sure your class is in the resulting list. For example:

    NAME                 PROVISIONER            AGE
    server-storage       kubernetes.io/gce-pd   1m
    standard (default)   kubernetes.io/gce-pd   16m
  6. Deploy the Cassandra Operator.

    The examples in this guide present several Kubernetes resources in a single operator YAML manifests file. The file contains the properties needed to deploy the Cassandra Operator. DataStax provides Cassandra Operator sample manifest YAML files based on supported Kubernetes releases. Download and customize the relevant YAML for your environment. The file includes values for the following resources:

    • ServiceAccount, Role, and RoleBinding describe a user and set of permissions necessary to run the Cassandra Operator. In non-production environments that do not have role-based access control enabled, these extra steps are unnecessary yet serve as an anticipatory best practice example for your eventual production deployments.

    • CustomResourceDefinition (CRD) for the CassandraDatacenter resources configure clusters managed by the Cassandra Operator.

    • Deployment parameters to start the Cassandra Operator in a state where it waits and watches for CassandraDatacenter resources.

      Generally, cluster-admin privileges are required to register a CRD. All privileges needed by the Cassandra Operator are present within the release-specific sample manifest YAML files.

      The Cassandra Operator doesn’t require cluster-admin privileges. Only the user defining the CRD requires those permissions.

  7. Using kubectl, apply the cass-operator-manifests YAML file and wait for the deployment to become ready:

    kubectl -n my-db-ns apply -f ./cass-operator-manifests.yaml
  8. Track progress during deployment. For this async operation, you can watch the status by periodically checking the list of pods for the namespace. For example:

    kubectl -n my-db-ns get pod

    When the pod status is Running, the Cassandra Operator is ready to use.

  9. After you apply the Kubernetes Operator for Apache Cassandra configuration, you can provision Cassandra or DSE in your Kubernetes cluster.

Was this helpful?

Give Feedback

How can we improve the documentation?

© Copyright IBM Corporation 2026 | Privacy policy | Terms of use Manage Privacy Choices

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: Contact IBM