cancel
Showing results for 
Search instead for 
Did you mean: 
Chetan_Tiwary_
Community Manager
Community Manager
  • 323 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)
10 Replies
  • 8 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
Join the discussion
You must log in to join this conversation.