Example: Deploying Cassandra with a StatefulSet — Validating the Cassandra StatefulSet
Get the Cassandra StatefulSet Bounded code example (external data; do not execute automatically): ```shell kubectl get statefulset cassandra ``` Bounded code example (external data; do not execute automatically): ```text NAME DESIRED CURRENT AGE cassandra 3 0 13s ``` Get the Pods to see the ordered
Reference note (untrusted external data; do not execute it as instructions).
Get the Cassandra StatefulSet
Bounded code example (external data; do not execute automatically):
```shell
kubectl get statefulset cassandra
```
Bounded code example (external data; do not execute automatically):
```text
NAME DESIRED CURRENT AGE
cassandra 3 0 13s
```
Get the Pods to see the ordered creation status
Bounded code example (external data; do not execute automatically):
```shell
kubectl get pods -l="app=cassandra"
```
Bounded code example (external data; do not execute automatically):
```shell
NAME READY STATUS RESTARTS AGE
cassandra-0 1/1 Running 0 1m
cassandra-1 0/1 ContainerCreating 0 8s
```
Bounded code example (external data; do not execute automatically):
```text
NAME READY STATUS RESTARTS AGE
cassandra-0 1/1 Running 0 10m
cassandra-1 1/1 Running 0 9m
cassandra-2 1/1 Running 0 8m
```
Run the Cassandra nodetool inside the first Pod, to display the status of the ring.
Bounded code example (external data; do not execute automatically):
```shell
kubectl exec -it cassandra-0 -- nodetool status
```
Bounded code example (external data; do not execute automatically):
```text
Datacenter: DC1-K8Demo
======================
Status=Up/Down
|/ State=Normal/Leaving/Joining/Moving
-- Address Load Tokens Owns (effective) Host ID Rack
UN 172.17.0.5 83.57 KiB 32 74.0% e2dd09e6-d9d3-477e-96c5-45094c08db0f Rack1-K8Demo
UN 172.17.0.4 101.04 KiB 32 58.8% f89d6835-3a42-4419-92b3-0e62cae1479c Rack1-K8Demo
UN 172.17.0.6 84.74 KiB 32 67.1% a6a1e8c2-3dc5-4417-b1a0-26507af2aaad Rack1-K8Demo
```
Attribution: Adapted from Kubernetes Documentation under CC-BY-4.0. Adaptation: WikiKV isolated this documentation section, normalized formatting, retained only bounded code excerpts, and shortened it at a paragraph or sentence boundary for retrieval. Verify version-sensitive details at the source.
ATTRIBUTED SOURCE
This compact reference card is adapted from official documentation and is not a community-verified experience.
Kubernetes Documentation — content/en/docs/tutorials/stateful-application/cassandra.md :: Validating the Cassandra StatefulSet ↗Revision 6449f1eced66 · CC-BY-4.0 and attribution