Skip to content

Commit

Permalink
executor: support using custom metrics with autoscaler (#109)
Browse files Browse the repository at this point in the history
Provide the ability to use a custom set of metrics for the autoscaler.
This enable folks who rely on a custom metric adapter, such as (1), to
use a different metric name than the default name straight from out
application.

(1): https://cloud.google.com/kubernetes-engine/docs/tutorials/autoscaling-metrics
  • Loading branch information
sluongng authored Sep 24, 2024
1 parent 26ed98b commit 6a00b1a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 17 deletions.
18 changes: 11 additions & 7 deletions charts/buildbuddy-executor/templates/autoscaler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,15 @@ spec:
{{- .Values.autoscaler.behavior | toYaml | nindent 4 }}
{{ end }}
metrics:
- type: Pods
pods:
metric:
name: buildbuddy_remote_execution_queue_length
target:
type: AverageValue
averageValue: {{ .Values.autoscaler.averageQueueLength }}
{{- if .Values.autoscaler.metrics }}
{{- .Values.autoscaler.metrics | toYaml | nindent 4 }}
{{- else }}
- type: Pods
pods:
metric:
name: buildbuddy_remote_execution_queue_length
target:
type: AverageValue
averageValue: {{ .Values.autoscaler.averageQueueLength }}
{{- end }}
{{ end }}
29 changes: 19 additions & 10 deletions charts/buildbuddy-executor/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,25 @@ autoscaler:
# averageQueueLength: 5
# ## Optional scaling behavior
# ## https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#scaling-policies
# # behavior:
# # scaleDown:
# # stabilizationWindowSeconds: 600
# # policies:
# # - type: Pods
# # value: 2
# # periodSeconds: 10
# # - type: Percent
# # value: 10
# # periodSeconds: 60
# behavior:
# scaleDown:
# stabilizationWindowSeconds: 600
# policies:
# - type: Pods
# value: 2
# periodSeconds: 10
# - type: Percent
# value: 10
# periodSeconds: 60
# ## Optional custom metrics
# metrics:
# - type: Pods
# pods:
# metric:
# name: my_custom_metric
# target:
# type: AverageValue
# averageValue: 5

podDisruptionBudget:
enabled: false
Expand Down

0 comments on commit 6a00b1a

Please sign in to comment.