cancel
Showing results for 
Search instead for 
Did you mean: 
Chetan_Tiwary_
Community Manager
Community Manager
  • 468 Views

Explain Openshift resource manifest

Explain this openshift resource manifest

 

apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: hpa-resource-metrics-memory
  namespace: default
spec:
...
  minReplicas: 20
...
  behavior:
    scaleDown:
      stabilizationWindowSeconds: 300
      policies:
      - type: Pods
        value: 4
        periodSeconds: 30
      - type: Percent
        value: 10
        periodSeconds: 60
      selectPolicy: Max
    scaleUp:
      selectPolicy: Disabled
Labels (4)
Tags (1)
12 Replies
  • 76 Views

This OpenShift Horizontal Pod Autoscaler (HPA) manifest automatically adjusts the number of pod replicas based on resource metrics like memory usage.

Explanation:

  • apiVersion: Specifies the HPA API version (autoscaling/v2beta2), which supports advanced scaling policies.
  • kind: Defines the resource type as HorizontalPodAutoscaler.
  • metadata: Contains metadata such as the HPA name and namespace.
  • minReplicas: Sets the minimum number of pods to 20 (the cluster will never scale below this number).
  • behavior: Controls how the HPA scales pods:

Scale Down Policy:

  • stabilizationWindowSeconds: Waits 300 seconds (5 minutes) before scaling down to avoid frequent fluctuations.
  • policies: Defines two methods for scaling down:
    • Pods Type: Remove up to 4 pods every 30 seconds.
    • Percent Type: Remove 10% of pods every 60 seconds.
  • selectPolicy: Chooses the Max policy, meaning the most aggressive scaling policy will be applied.

Scale Up Policy:

  • selectPolicy: Set to Disabled, which means pods will not scale up automatically.

    Summary
    This HPA automatically scales down pods based on memory usage, with a minimum of 20 pods. It removes pods gradually to avoid sudden changes, prioritizing the fastest possible scale-down method. Scaling up is completely disabled.
0 Kudos
afordona
Cadet
Cadet
  • 48 Views

Summary of the OpenShift manifest for the HorizontalPodAutoscaler (HPA):

Minimum Replicas: Ensures at least 20 pod replicas are maintained.
Scale Down Behavior:
Stabilization window of 300 seconds.
Policies to scale down by a maximum of 4 pods every 30 seconds or 10% every 60 seconds.
Uses the policy with the maximum value.
Scale Up Behavior: Scaling up is disabled,

0 Kudos
Asma-Alfayyad
Mission Specialist
Mission Specialist
  • 28 Views

This manifest defines a HorizontalPodAutoscaler to automatically scale the number of pod replicas based on resource usage, in this case, memory.

  • The HorizontalPodAutoscaler ensures at least 20 replicas are running at all times.
  • When scaling down, it allows reductions of up to 4 pods in 30 seconds and 10% of the total pods in 1 minute, but it won’t scale down too quickly (due to the 5-minute stabilization window).
  • Scaling up is disabled in this configuration, meaning the system won't automatically add more pods based on memory usage.
0 Kudos
Join the discussion
You must log in to join this conversation.