Manual, Horizontal, and Vertical scaling

The source code for this section is contained in the 04_02 branch of the GitHub repository for this course.

With OpenShift, you can easily scale your applications to meet changing demands. Scaling can be done in two ways: horizontally or vertically.

Horizontal scaling consists of adding or removing nodes from the cluster, or adding or removing pods from a node. These operations increase or decrease the number of resources available for your applications, such as CPU, memory, disk, and network. Horizontal scaling is useful when you need to handle more traffic, distribute the load, or improve availability and resilience.

Vertical scaling means adjusting the resource limits and requests of the pods that run your applications. This way, you can optimize the resource utilization of your nodes and pods, and ensure that your applications have enough resources to perform well. Vertical scaling is useful when you need to fine-tune the performance, efficiency, or quality of service of your applications.

OpenShift provides several tools and features to help you scale your applications horizontally or vertically. For example:

  • You can use a HorizontalPodAutoscaler (HPA) to automatically scale the number of pods based on CPU or memory utilization metrics. The HPA monitors the pods and adjusts the replica count of the workload object (such as Deployment, StatefulSet, etc.) that manages them.

  • You can use a VerticalPodAutoscaler (VPA) to automatically adjust the resource limits and requests of the pods based on historical and current resource usage data. The VPA reviews the pods and updates them with optimized resource values before they are admitted to a node.

  • You can use a cluster autoscaler (CA) to automatically scale the number of nodes in the cluster based on the demand for resources. The CA monitors the cluster and adds or removes nodes as needed.

  • You can use machine sets to manually scale the number of nodes in a specific zone or region. Machine sets are groups of machines that have the same configuration and role.

manual scaling
Figure 1. Scaling an application manually through the OpenShift console