The module lifecycle stage: Preview
The module has requirements for installation
CassandraClass
The Cluster Wide CassandraClass resource allows restricting the creation of invalid configurations and predefining some values.
Every Cassandra resource must be associated with an existing CassandraClass resource.
Before deploying the service, all configuration will be checked against the corresponding CassandraClass.
Sizing Policies
The structure allows creating a set of sizing policies for associated Cassandra resources.
This helps avoid uneven distribution of CPU and Memory resources on cluster nodes.
The determining factor for choosing a particular policy is falling within the cores interval.
Then compliance with other fields of the specific policy will be checked.
spec:
sizingPolicies:
- cores:
min: 1
max: 4
memory:
min: 100Mi
max: 1Gi
step: 1Mi
coreFraction: [10%, 30%, 50%]
- cores:
min: 5
max: 10
memory:
min: 500Mi
max: 2Gi
coreFraction: [50%, 70%, 100%]Validation Rules
CEL (Common Expression Language) syntax is used to create flexible validation mechanisms.
We provide a set of predefined variables that can be used in rule:
- instance.memory.size
int - instance.cpu.cores
int
spec:
validations:
- message: "CPU cores must be between 1 and 64"
rule: "instance.cpu.cores >= 1 && instance.cpu.cores <= 64"Affinity
Standard Kubernetes mechanism for managing scheduling of deployed pods.
spec:
nodeAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
nodeSelectorTerms:
- matchExpressions:
- key: "node.deckhouse.io/group"
operator: "In"
values:
- "cas"Tolerations
Standard Kubernetes mechanism for managing scheduling of deployed pods.
spec:
tolerations:
- key: primary-role
operator: Equal
value: cas
effect: NoScheduleNode Selector
Standard Kubernetes mechanism for managing scheduling of deployed pods.
nodeSelector:
"node.deckhouse.io/group": "cas"Usage Examples
Basic Usage
apiVersion: managed-services.deckhouse.io/v1alpha1
kind: CassandraClass
metadata:
name: default
spec:
sizingPolicies:
- cores:
min: 1
max: 2
memory:
min: 2Gi
max: 8Gi
step: 1Gi
coreFractions:
- "25%"
- "50%"
- "75%"
- "100%"
validations:
- message: "CPU cores must be between 1 and 8"
rule: "instance.cpu.cores >= 1 && instance.cpu.cores <= 16"
- message: "Memory must be between 2 and 64"
rule: "instance.memory.size >= 2 && instance.memory.size <= 64"