Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

helm: allow overriding hpa behavior #6037

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions operations/helm/charts/grafana-agent/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Unreleased

- Update `rbac` to include necessary rules for the `otelcol.processor.k8sattributes` component. (@rlankfo)

- Allow setting behavior for horizontal pod autoscaler. (@captncraig)

0.29.0 (2023-11-30)
-------------------

Expand Down
1 change: 1 addition & 0 deletions operations/helm/charts/grafana-agent/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ use the older mode (called "static mode"), set the `agent.mode` value to
| configReloader.resources | object | `{"requests":{"cpu":"1m","memory":"5Mi"}}` | Resource requests and limits to apply to the config reloader container. |
| configReloader.securityContext | object | `{}` | Security context to apply to the Grafana configReloader container. |
| controller.affinity | object | `{}` | Affinity configuration for pods. |
| controller.autoscaling.behavior | object | `{}` | Behavior section of the HPA spec. Used if you want to customize scale up or down behavior from the defaults. |
| controller.autoscaling.enabled | bool | `false` | Creates a HorizontalPodAutoscaler for controller type deployment. |
| controller.autoscaling.maxReplicas | int | `5` | The upper limit for the number of replicas to which the autoscaler can scale up. |
| controller.autoscaling.minReplicas | int | `1` | The lower limit for the number of replicas to which the autoscaler can scale down. |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
type: statefulset
autoscaling:
enabled: true
behavior:

Check failure on line 6 in operations/helm/charts/grafana-agent/ci/create-statefulset-autoscaling-values.yaml

View workflow job for this annotation

GitHub Actions / lint-test

6:14 [trailing-spaces] trailing spaces
scaleDown:
selectPolicy: Disabled
agent:
resources:
requests:
Expand Down
4 changes: 4 additions & 0 deletions operations/helm/charts/grafana-agent/templates/hpa.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ spec:
apiVersion: apps/v1
kind: {{ .Values.controller.type }}
name: {{ include "grafana-agent.fullname" . }}
{{- with .Values.controller.autoscaling.behavior }}
behavior:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.controller.autoscaling }}
minReplicas: {{ .minReplicas }}
maxReplicas: {{ .maxReplicas }}
Expand Down
2 changes: 2 additions & 0 deletions operations/helm/charts/grafana-agent/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,8 @@ controller:
targetCPUUtilizationPercentage: 0
# -- Average Memory utilization across all relevant pods, a percentage of the requested value of the resource for the pods. Setting `targetMemoryUtilizationPercentage` to 0 will disable Memory scaling.
targetMemoryUtilizationPercentage: 80
# -- Behavior section of the HPA spec. Used if you want to customize scale up or down behavior from the defaults.
behavior: {}

# -- Affinity configuration for pods.
affinity: {}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ spec:
apiVersion: apps/v1
kind: statefulset
name: grafana-agent
behavior:
scaleDown:
selectPolicy: Disabled
minReplicas: 1
maxReplicas: 5
metrics:
Expand Down
Loading