Skip to main content

Cassandra cluster

CassandraCluster describes the desired state of the Cassandra cluster we want to setup through the operator.

apiVersion: "db.orange.com/v2"
kind: "CassandraCluster"
metadata:
name: cassandra-demo
labels:
cluster: k8s.kaas
spec:
cassandraImage: cassandra:3.11
bootstrapImage: ghcr.io/cscetbon/casskop-bootstrap:0.1.4
configMapName: cassandra-configmap-v1
dataCapacity: "200Mi"
dataStorageClass: "local-storage"
imagepullpolicy: IfNotPresent
hardAntiAffinity: false # Do we ensure only 1 cassandra on each node ?
deletePVC: true
autoPilot: false
config:
jvm-options:
log_gc: "true"
autoUpdateSeedList: false
maxPodUnavailable: 1
runAsUser: 999
shareProcessNamespace: true
resources:
limits:
cpu: '1'
memory: 2Gi
topology:
dc:
- name: dc1
nodesPerRacks: 1
rack:
- name: rack1
- name: rack2
- name: rack3

CassandraCluster

FieldTypeDescriptionRequiredDefault
metadataObjectMetadatais metadata that all persisted resources must have, which includes all objects users must create.Nonil
specCassandraClusterSpecdefines the desired state of CassandraCluster.Nonil
statusCassandraClusterStatusdefines the observed state of CassandraCluster.Nonil

CassandraClusterSpec

FieldTypeDescriptionRequiredDefault
nodesPerRacksint32Number of nodes to deploy for a Cassandra deployment in each Racks. If NodesPerRacks = 2 and there is 3 racks, the cluster will have 6 Cassandra NodesYes1
cassandraImagestringImage + version to use for CassandraYescassandra:3.11.6
configBuilderImagestringImage + version to use for configBuilderNodatastax/cass-config-builder:1.0.4
imagepullpolicyPullPolicyDefine the pull policy for C* docker imageYesPullAlways
bootstrapImagestringImage used for bootstrapping cluster (use the form : base:version)Yesghcr.io/cscetbon/casskop-bootstrap:0.1.4
runAsUserint64Define the id of the user to run in the Cassandra imageYes999
fsGroupint64FSGroup defines the GID owning volumes in the Cassandra imageNo1
configmapConfiguration used by the config builder to generated cassandra.yaml and other configuration filesNo
readOnlyRootFilesystemMake the pod as ReadonlyboolYestrue
resourcesResourcesDefine the Requests & Limits resources spec of the "cassandra" containerYes-
hardAntiAffinityboolHardAntiAffinity defines if the PodAntiAffinity of the statefulset has to be hard (it's soft by default)Yesfalse
podPodPolicyNo-
serviceServicePolicyNo-
deletePVCboolDefines if the PVC must be deleted when the cluster is deletedYesfalse
debugboolIs used to surcharge Cassandra pod command to not directly start cassandra but starts an infinite wait to allow user to connect a bash into the pod to make some diagnoses.Yesfalse
shareProcessNamespaceboolWhen process namespace sharing is enabled, processes in a container are visible to all other containers in that pod. Check documentation for more informationsYesfalse
autoPilotboolDefines if the Operator can fly alone or if we need human action to trigger actions on specific Cassandra nodes. Check documentation for more informationsYesfalse
noCheckStsAreEqualboolYesfalse
autoUpdateSeedListboolDefines if the Operator automatically update the SeedList according to new cluster CRD topologyYesfalse
maxPodUnavailableint32Number of MaxPodUnavailable used in the PodDisruptionBudgetYes1
restartCountBeforePodDeletionint32defines the number of restart allowed for a cassandra container allowed before deleting the pod to force its restart from scratch. if set to 0 or omit, no action will be performed based on restart count. Check documentation for more informationsYes0
unlockNextOperationboolVery special Flag to hack CassKop reconcile loop - use with really good CareYesfalse
dataCapacitystringDefine the Capacity for Persistent Volume Claims in the local storage. Check documentation for more informationsYes
dataStorageClassstringDefine StorageClass for Persistent Volume Claims in the local storage. Check documentation for more informationsYes
storageConfigs[ ]StorageConfigDefines additional storage configurations. Check documentation for more informationsNo-
sidecarConfigs[ ]ContainerDefines additional sidecar configurations. Check documentation for more informationsNo-
configMapNamestringName of the ConfigMap for Cassandra configuration (cassandra.yaml). If this is empty, operator will uses default cassandra.yaml from the baseImage. If this is not empty, operator will uses the cassandra.yaml from the Configmap instead. Check documentation for more informationsNo-
imagePullSecretLocalObjectReferenceName of the secret to uses to authenticate on Docker registries. If this is empty, operator do nothing. If this is not empty, propagate the imagePullSecrets to the statefulsetsNo-
imageJolokiaSecretLocalObjectReferenceJMX Secret if Set is used to set JMX_USER and JMX_PASSWORDNo-
topologyTopologyTo create Cassandra DC and Racks and to target appropriate Kubernetes NodesYes-
livenessInitialDelaySecondsint32Defines initial delay for the liveness probe of the main. Configure liveness Readiness startup probesYes120
livenessHealthCheckTimeoutint32Defines health check timeout for the liveness probe of the main. Configure liveness Readiness startup probesYes20
livenessHealthCheckPeriodint32Defines health check period for the liveness probe of the main. Configure liveness Readiness startup probesYes10
livenessFailureThresholdint32Defines failure threshold for the liveness probe of the main. Configure liveness Readiness startup probesYes(value set by kubernetes cluster)
livenessSuccessThresholdint32Defines success threshold for the liveness probe of the main. Configure liveness Readiness startup probesYes(value set by kubernetes cluster)
readinessInitialDelaySecondsint32Defines initial delay for the readiness probe of the main. Configure liveness Readiness startup probesYes60
readinessHealthCheckTimeoutint32Defines health check timeout for the readiness probe of the main. Configure liveness Readiness startup probesYes10
readinessHealthCheckPeriodint32Defines health check period for the readiness probe of the main. Configure liveness Readiness startup probesYes10
readinessFailureThresholdint32Defines failure threshold for the readiness probe of the main. Configure liveness Readiness startup probesYes(value set by kubernetes cluster)
readinessSuccessThresholdint32Defines success threshold for the readiness probe of the main. Configure liveness Readiness startup probesYes(value set by kubernetes cluster)

PodPolicy

FieldTypeDescriptionRequiredDefault
annotationsmap[string]stringAnnotations specifies the annotations to attach to pods the CassKop operator createsNo-
tolerationsTolerationTolerations specifies the tolerations to attach to the pods the CassKop operator createsNo-

ServicePolicy

FieldTypeDescriptionRequiredDefault
annotationsmap[string]stringAnnotations specifies the annotations to attach to headless service the CassKop operator createsNo-

StorageConfig

FieldTypeDescriptionRequiredDefault
namestringName of the storage config, used to name PV to reuse into sidecars for example.Yes-
mountPathstringPath where the volume will be mount into the main cassandra container inside the pod.Yes-
pvcSpecPersistentVolumeClaimSpecKubernetes PVC spec. create-a-persistentvolumeclaim.Yes-