Skip to content
This repository has been archived by the owner on Jan 6, 2025. It is now read-only.

Commit

Permalink
HPA add customMetric and behavior based scaling (#60)
Browse files Browse the repository at this point in the history
HPA add `customMetric` and `behavior` based scaling

Signed-off-by: AB <[email protected]>
  • Loading branch information
bhataprameya authored Dec 7, 2023
1 parent 256102a commit 7faade1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ For more information on configuring the HTTP component, refer to the [Benthos HT
| autoscaling.maxReplicas | Sets max numbers of replicas | 100 |
| autoscaling.targetCPUUtilizationPercentage | Sets desired CPU autoscaling threshold | 80 |
| autoscaling.targetMemoryUtilizationPercentage | Sets desired memory autoscaling threshold | 80 |
| autoscaling.behavior | Custom scale-up and scale-down behaviors | {} |
| autoscaling.customMetric | Target a custom metric for autoscaling | {} |
| nodeSelector | Sets node selector configuration | {} |
| tolerations | Sets tolerations configuration | [] |
| affinity | Sets affinity configuration | {} |
Expand Down
7 changes: 7 additions & 0 deletions templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,11 @@ spec:
name: cpu
targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }}
{{- end }}
{{- with .Values.autoscaling.customMetric -}}
{{ toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,21 @@ autoscaling:
maxReplicas: 100
targetCPUUtilizationPercentage: 80
# targetMemoryUtilizationPercentage: 80

# autoscaling.customMetric -- Target a custom metric for autoscaling.
customMetric: {}
# - type: Pods
# pods:
# metric:
# name: utilization
# target:
# type: AverageValue
# averageValue: 95

# autoscaling.behavior -- Configure separate scale-up and scale-down behaviors.
behavior: {}
# scaleDown:
# stabilizationWindowSeconds: 300

nodeSelector: {}

Expand Down

0 comments on commit 7faade1

Please sign in to comment.