Cassandra K8s study materials
Cassandra K8s study resources

Cassandra K8s flashcards

Cassandra K8s · Build recall with a focused review session.

33 cards. Read the term and the definition here. The deck at the top of this page is optional.

StatefulSet stable identity
Each pod gets a fixed ordinal name, a stable network identity through a headless Service, and its own PersistentVolumeClaim. This lets Cassandra nodes keep the same address and data across restarts.
Headless Service requirement
A Service with clusterIP None gives each StatefulSet pod a DNS A record. Cassandra peers and clients use these records to resolve node addresses without a cluster IP load balancer.
OrderedReady pod management
The default StatefulSet policy creates and deletes pods one at a time in ordinal order, waiting for readiness. Parallel policy starts all pods at once but loses deterministic bootstrap sequencing.
PVC retention on scale-down
Scaling a StatefulSet down deletes the highest-ordinal pod but keeps its PVC by default. Setting persistentVolumeClaimRetentionPolicy to Delete removes the claim and the data with it.
Partition key ownership
The partition key is hashed by the partitioner to a token, and the node owning that token range stores the data. Clustering columns only sort rows inside that partition.
Consistency level QUORUM
QUORUM requires a majority of replicas (RF/2+1) to acknowledge a read or write. LOCAL_QUORUM applies the same majority but counts only replicas in the client's datacenter.
Hinted handoff and repair
Hinted handoff stores writes for a briefly unavailable replica and replays them later. Anti-entropy repair compares and reconciles replicas that diverged while no hints existed.
Wide partition limit
A partition should stay under roughly 100 MB and 100k rows. Larger partitions increase read latency, garbage collection pressure, and repair cost across the cluster.
Compaction strategy tradeoffs
STCS optimizes write throughput, LCS optimizes read latency and space, and TWCS groups writes by time window for time-series data. Each trades amplification in one dimension for another.
Operator install order
Install the CassandraDatacenter CRDs first, then the operator Deployment and its RBAC, then the custom resource. CRD upgrades must happen before upgrading the operator image.
Level-triggered reconciliation
The operator continuously compares the CassandraDatacenter spec with actual StatefulSets, Services, ConfigMaps, and PVCs, then converges them. It does not rely on one-time install scripts.
CassandraDatacenter spec fields
The resource declares serverType, serverVersion, size per rack, rack definitions, storageConfig, and resource requests. The operator translates these into StatefulSets and Services.
Version compatibility matrix
Operator releases support specific Cassandra serverVersion values. Check the operator release notes before changing serverVersion, because unsupported pairs can fail reconciliation or bootstrap.
Rack as failure domain
Replicas are placed across racks, so a rack should map to a zone or physical failure domain. With RF=3, use three racks so no two replicas share a failure domain.
Snitch and topology match
The snitch must match the actual rack layout. GossipingPropertyFileSnitch reads cassandra-rackdc.properties; a mismatch places replicas in the wrong failure domain and weakens durability.
num_tokens at bootstrap
num_tokens sets the number of virtual token ranges a node owns. It is fixed at bootstrap and cannot be changed without rebuilding the node, so choose it before cluster creation.
Seed node role
Seeds are gossip contact points that new nodes use to discover the cluster. They are not special data owners, and making every node a seed slows gossip convergence.
WaitForFirstConsumer binding
This volumeBindingMode delays PersistentVolume provisioning until a pod is scheduled. It ensures the volume is created in the same zone as the pod, avoiding cross-zone attachment failures.
Cassandra storage type
Cassandra needs local or block storage with correct fsync behavior. NFS and most network filesystems are unsupported for data directories and can corrupt SSTables.
PVC expansion limits
Most CSI drivers allow volume expansion when the StorageClass sets allowVolumeExpansion true, but shrinking is not supported. Size data volumes for projected growth before cluster creation.
Client Service versus pod IPs
The operator creates a client Service for drivers and headless Services for peer discovery. Clients should use the client Service contact points rather than hard-coded pod IP addresses.
broadcast_rpc_address
This setting is the address nodes advertise to clients for the native protocol. It must be routable from clients, or driver topology discovery fails behind NAT or Service translation.
CQL and internode ports
Native transport listens on 9042 for clients. Internode storage communication uses 7000, and 7001 when internode SSL is enabled. NetworkPolicies should scope each port separately.
Internode TLS configuration
serverEncryptionOptions in the CassandraDatacenter enables TLS between nodes, using certificates from a Secret or cert-manager. require_client_auth true enforces mutual authentication.
Cassandra authenticators
PasswordAuthenticator checks username and password credentials. MutualTLSAuthenticator authenticates clients by certificate. The authorizer separately controls what an authenticated role may access.
Cassandra role grants
Roles can be granted to other roles to form hierarchies. Permissions such as SELECT or MODIFY are granted on a keyspace or table resource to a role.
nodetool snapshot mechanics
A snapshot creates hard links to current SSTables, which is fast and space-efficient. The snapshot is only valid while those SSTables remain, so compaction can invalidate it over time.
Restore with nodetool refresh
Stop the node, clear the table data directory, copy snapshot SSTables in, then run nodetool refresh so the node loads them. Follow with repair to reconcile with other replicas.
Medusa backup tool
Medusa performs full and incremental Cassandra backups to object storage such as S3 or GCS. It tracks backup metadata and supports restore into a new or existing cluster.
Dropped mutation metric
nodetool tpstats reports dropped messages per stage. Nonzero dropped mutations mean the node could not keep up, usually from overload, long GC pauses, or insufficient heap.
Pending compactions alert
A rising pending compaction count means writes outpace compaction. Alert on sustained growth because it precedes read latency increases and disk exhaustion.
Rolling restart gating
The operator restarts one pod at a time and waits for the node to be Up/Normal with schema agreement before continuing. A pod stuck unready halts the whole operation.
Decommission before scale-down
Run nodetool decommission to stream data to other nodes before removing a pod. Otherwise the operator deletes the pod and the cluster must stream replacements through repair.