Cassandra Cluster CRD

Cassandra database clusters can be created and configuring using the clusters.cassandra.rook.io custom resource definition (CRD).

Please refer to the the user guide walk-through for complete instructions. This page will explain all the available configuration options on the Cassandra CRD.

Sample

  1. apiVersion: cassandra.rook.io/v1alpha1
  2. kind: Cluster
  3. metadata:
  4. name: rook-cassandra
  5. namespace: rook-cassandra
  6. spec:
  7. version: 3.11.1
  8. repository: my-private-repo.io/cassandra
  9. mode: cassandra
  10. datacenter:
  11. name: us-east-1
  12. racks:
  13. - name: us-east-1a
  14. members: 3
  15. storage:
  16. volumeClaimTemplates:
  17. - metadata:
  18. name: rook-cassandra-data
  19. spec:
  20. storageClassName: my-storage-class
  21. resources:
  22. requests:
  23. storage: 200Gi
  24. resources:
  25. requests:
  26. cpu: 8
  27. memory: 32Gi
  28. limits:
  29. cpu: 8
  30. memory: 32Gi
  31. placement:
  32. nodeAffinity:
  33. requiredDuringSchedulingIgnoredDuringExecution:
  34. nodeSelectorTerms:
  35. - matchExpressions:
  36. - key: failure-domain.beta.kubernetes.io/region
  37. operator: In
  38. values: us-east-1
  39. - key: failure-domain.beta.kubernetes.io/zone
  40. operator: In
  41. value: us-east-1a

Settings Explanation

Cluster Settings:

  • version: The version of Cassandra to use. It is used as the image tag to pull.
  • repository: Optional field. Specifies a custom image repo. If left unset, the official docker hub repo is used.
  • mode: Optional field. Specifies if this is a Cassandra or Scylla cluster. If left unset, it defaults to cassandra. Values: {scylla, cassandra}

In the Cassandra model, each cluster contains datacenters and each datacenter contains racks. At the moment, the operator only supports single datacenter setups.

Datacenter Settings:

  • name: Name of the datacenter. Usually, a datacenter corresponds to a region.
  • racks: List of racks for the specific datacenter.

Rack Settings:

  • name: Name of the rack. Usually, a rack corresponds to an availability zone.
  • members: Number of Cassandra members for the specific rack. (In Cassandra documentation, they are called nodes. We don’t call them nodes to avoid confusion as a Cassandra Node corresponds to a Kubernetes Pod, not a Kubernetes Node).
  • storage: Defines the volumes to use for each Cassandra member. Currently, only 1 volume is supported.
  • resources: Defines the CPU and RAM resources for the Cassandra Pods.
  • placement: Defines the placement of Cassandra Pods. Has the following subfields: