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. # A key/value list of annotations
  11. annotations:
  12. # key: value
  13. datacenter:
  14. name: us-east-1
  15. racks:
  16. - name: us-east-1a
  17. members: 3
  18. storage:
  19. volumeClaimTemplates:
  20. - metadata:
  21. name: rook-cassandra-data
  22. spec:
  23. storageClassName: my-storage-class
  24. resources:
  25. requests:
  26. storage: 200Gi
  27. resources:
  28. requests:
  29. cpu: 8
  30. memory: 32Gi
  31. limits:
  32. cpu: 8
  33. memory: 32Gi
  34. # A key/value list of annotations
  35. annotations:
  36. # key: value
  37. placement:
  38. nodeAffinity:
  39. requiredDuringSchedulingIgnoredDuringExecution:
  40. nodeSelectorTerms:
  41. - matchExpressions:
  42. - key: failure-domain.beta.kubernetes.io/region
  43. operator: In
  44. values:
  45. - us-east-1
  46. - key: failure-domain.beta.kubernetes.io/zone
  47. operator: In
  48. values:
  49. - 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}
  • annotations: Key value pair list of annotations to add.

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.
  • annotations: Key value pair list of annotations to add.
  • placement: Defines the placement of Cassandra Pods. Has the following subfields: