# ============================================================================= # HorizontalPodAutoscaler Template — AKS Deploy Skill # ============================================================================= # Scales the Deployment between min and max replicas based on CPU utilization. # Minimum of 2 replicas ensures HA even at low load (aligns with DS010). # # REPLACE: — your application name (e.g., order-api) # REPLACE: — target namespace (e.g., production) # REPLACE: — minimum replicas (default: 2, must be >= 2 for DS010) # REPLACE: — maximum replicas (e.g., 10) # ============================================================================= apiVersion: autoscaling/v2 kind: HorizontalPodAutoscaler metadata: name: namespace: labels: app: spec: scaleTargetRef: apiVersion: apps/v1 kind: Deployment name: minReplicas: maxReplicas: metrics: - type: Resource resource: name: cpu target: type: Utilization averageUtilization: 70 behavior: scaleDown: stabilizationWindowSeconds: 300 policies: - type: Pods value: 1 periodSeconds: 60 scaleUp: stabilizationWindowSeconds: 0 policies: - type: Pods value: 2 periodSeconds: 60