Skip to content

Scaling Up and Down

Aleks Volochnev edited this page Mar 6, 2021 · 9 revisions

4. Scaling Up and Down

✅ Step 1: Get current running config.

For many basic config options, you can change values in the values.yaml file. Next, we will scale our cluster using this method.

Check our current running values. This command exposes all the current running values in the system.

helm get manifest k8ssandra

Notice how each of the yaml files that make up the deployment is displayed here and there is a bunch... Yeah Kubernetes is just an OCEAN of YAML.

✅ Step 2: Scale the cluster up.

We can use the linux tool grep to filter the output to find specific values. To find the current number of Cassandra nodes we run the following command.

helm get manifest k8ssandra | grep size

Notice output size: 1.

This is the current number of cassandra nodes. Next, we are going to scale up to three nodes.

While there are a few ways to make this change with Helm, we will edit a file as it's recommended way with k8s environment.

Edit the file k8ssandra.yaml and set the cluster size to 2. Apply the changes.

helm upgrade k8ssandra k8ssandra/k8ssandra -f k8ssandra.yaml

Check the size again, it should be size: 2 now

helm get manifest k8ssandra | grep size

Watch the changes live:

watch kubectl get pods

✅ Step 3: Scale the cluster down

Historically, one of the most difficult operations with Cassandra has been to scale down a cluster. With K8ssandra's dynamic elasticity, it is now just as easy as scaling up. Let's try it!

Edit the file k8ssandra.yaml and set the cluster size to 1. Apply the changes.

helm upgrade k8ssandra k8ssandra/k8ssandra -f k8ssandra.yaml

Check the size again, it should be back to size: 1 now.

helm get manifest k8ssandra | grep size -m 1

Next Step

Proceed to the Step V