Skip to content

Commit

Permalink
Merge pull request #47 from PDOK/hpa-scaling-policies
Browse files Browse the repository at this point in the history
feat: add scaling policies to HPA
  • Loading branch information
kad-korpem authored Feb 7, 2025
2 parents d4c9d93 + a924322 commit 8f0e643
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions internal/controller/ogcapi_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,28 @@ func (r *OGCAPIReconciler) mutateHorizontalPodAutoscaler(ogcAPI metav1.Object, h
},
},
},
Behavior: &autoscalingv2.HorizontalPodAutoscalerBehavior{
ScaleDown: &autoscalingv2.HPAScalingRules{
StabilizationWindowSeconds: int32Ptr(900),
Policies: []autoscalingv2.HPAScalingPolicy{
{
Type: autoscalingv2.PodsScalingPolicy,
Value: 1,
PeriodSeconds: 300,
},
},
},
ScaleUp: &autoscalingv2.HPAScalingRules{
StabilizationWindowSeconds: int32Ptr(0),
Policies: []autoscalingv2.HPAScalingPolicy{
{
Type: autoscalingv2.PodsScalingPolicy,
Value: 1,
PeriodSeconds: 60,
},
},
},
},
}
if err := ensureSetGVK(r.Client, hpa, hpa); err != nil {
return err
Expand Down

0 comments on commit 8f0e643

Please sign in to comment.