Horizontal Scaling Properties

Kubernetes horizontal scaling, also known as horizontal pod autoscaling (HPA), is a feature that allows you to adjust the number of running instances (pods) of a deployment or replica set based on the observed CPU or memory utilization. The goal is to ensure optimal resource utilization and keep a consistent level of performance for your applications.

Horizontal Scaling Properties describes the horizontal scaling properties:

Table 1. Horizontal Scaling Properties
Name Description
autoscaling.enabled Set this to true to enable horizontal scaling. The default value is false.
autoscaling.additionalLabels Labels for the horizontal pod autoscaler.
autoscaling.annotations Annotations for the horizontal pod autoscaler.
autoscaling.minReplicas The minimum number of replicas when horizontal scaling is enabled. The default value is 1.
autoscaling.maxReplicas The maximum number of replicas when horizontal scaling is enabled. The default value is 10.
autoscaling.metrics Configuration for horizontal scaling metrics when horizontal scaling is enabled, for example:

    metrics:
    - resource:
        name: cpu
        target:
          averageUtilization: 60
          type: Utilization
      type: Resource
    - resource:
        name: memory
        target:
          averageUtilization: 60
          type: Utilization
      type: Resource
This is an example of a horizontal scaling properties configuration:
autoscaling:
  enabled: true
  minReplicas: 2
  maxReplicas: 100
  metrics:
    - type: Resource
      resource:
        name: cpu
        target:
          type: Utilization
          averageUtilization: 80
    - type: Resource
      resource:
        name: memory
        target:
          type: Utilization
          averageUtilization: 80