Re-edited as code and my notes are mixed up. Changed color of code to red Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10
From: Manu Chadha<mailto:manu.cha...@hotmail.com> Sent: 02 July 2020 08:21 To: user@cassandra.apache.org<mailto:user@cassandra.apache.org> Subject: What is the way to scale down Cassandra/Kubernetes cluster from 3 to 1 nodes using cass-operator Hi I have created a cluster using cass-operator - https://github.com/datastax/cass-operator. I suppose by default 3 replicas (3 node cluster) are created. I want to scale down the cluster from 3 to 1 nodes? I executed kubectl scale sts cluster1-dc1-default-sts --replicas=1 -n cass-operator statefulset.apps/cluster1-dc1-default-sts scaled which brought down the no of nodes to 1 kubectl get all -n cass-operator NAME READY STATUS RESTARTS AGE pod/cass-operator-5f8cdf99fc-9c5g4 1/1 Running 0 2d10h pod/cluster1-dc1-default-sts-0 2/2 Running 0 2d10h pod/cluster1-dc1-default-sts-1 1/2 Running 0 48s pod/cluster1-dc1-default-sts-2 1/2 Running 0 52s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/cass-operator-metrics ClusterIP 10.51.243.147 <none> 8383/TCP,8686/TCP 2d10h service/cassandra-loadbalancer LoadBalancer 10.51.240.24 34.91.214.233 9042:30870/TCP 38h service/cassandradatacenter-webhook-service ClusterIP 10.51.243.86 <none> 443/TCP 2d10h service/cluster1-dc1-all-pods-service ClusterIP None <none> <none> 2d10h service/cluster1-dc1-service ClusterIP None <none> 9042/TCP,8080/TCP 2d10h service/cluster1-seed-service ClusterIP None <none> <none> 2d10h NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/cass-operator 1/1 1 1 2d10h NAME DESIRED CURRENT READY AGE replicaset.apps/cass-operator-5f8cdf99fc 1 1 1 2d10h NAME READY AGE statefulset.apps/cluster1-dc1-default-sts 1/3 2d10h <-- REDUCTION AS DESIRED But after few minutes, the nodes got scaled up again kubectl get all -n cass-operator NAME READY STATUS RESTARTS AGE pod/cass-operator-5f8cdf99fc-9c5g4 1/1 Running 0 2d10h pod/cluster1-dc1-default-sts-0 2/2 Running 0 2d10h pod/cluster1-dc1-default-sts-1 2/2 Running 0 2m46s pod/cluster1-dc1-default-sts-2 2/2 Running 0 2m50s NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE service/cass-operator-metrics ClusterIP 10.51.243.147 <none> 8383/TCP,8686/TCP 2d10h service/cassandra-loadbalancer LoadBalancer 10.51.240.24 34.91.214.233 9042:30870/TCP 38h service/cassandradatacenter-webhook-service ClusterIP 10.51.243.86 <none> 443/TCP 2d10h service/cluster1-dc1-all-pods-service ClusterIP None <none> <none> 2d10h service/cluster1-dc1-service ClusterIP None <none> 9042/TCP,8080/TCP 2d10h service/cluster1-seed-service ClusterIP None <none> <none> 2d10h NAME READY UP-TO-DATE AVAILABLE AGE deployment.apps/cass-operator 1/1 1 1 2d10h NAME DESIRED CURRENT READY AGE replicaset.apps/cass-operator-5f8cdf99fc 1 1 1 2d10h NAME READY AGE statefulset.apps/cluster1-dc1-default-sts 3/3 2d10h <-- back to 3 Clearly I am not doing something right as the stateful set should say 1/1 instead of 1/3 or 3/3. What configuration do I need to change to create a 1 or 2 node cluster? Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10