Scaling StatefulSets
Let's see how to scale StatefulSets up and down.
We'll cover the following
Each time Kubernetes scales up a StatefulSet, it creates new Pods and PVCs. However, when scaling down, Kubernetes only terminates Pods. This means future scale-up operations only need to create new Pods and connect them back to the original PVCs. Kubernetes and the StatefulSet controller handle all of this without our help.
Modifying the Replica Count
We currently have three StatefulSet Pods and three PVCs. Edit the sts.yml
file, change the replica count from 3 to 2, and save the changes.
Get hands-on with 1400+ tech skills courses.