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

add autoscaling for deployment to helm chart #3221

Merged

Conversation

therealmanny
Copy link
Contributor

PR Description

This change adds autoscaling value for deployment to the helm chart. Provides the ability to scale app agent receiver deployment.

Which issue(s) this PR fixes

None

Notes to the Reviewer

In this pull request, I am assuming it is a good idea to run more than one app agent receiver integration configured grafana agent replicas forwarding telemetry to the same location. If this is wrong, you can reject this pull request. Thanks!

PR Checklist

  • CHANGELOG updated
  • Documentation added
  • Tests updated

minReplicas: {{ .minReplicas }}
maxReplicas: {{ .maxReplicas }}
metrics:
{{- with .targetCPUUtilizationPercentage }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it always make sense to scale based on both cpu and memory? If we scale by memory, but are not so concerned about cpu, can we do that?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we can scale by only memory or CPU. The documentation is updated to reflect that targetCPUUtilizationPercentage or targetMemoryUtilizationPercentage can be diable by setting them to 0. Thanks!

@captncraig
Copy link
Contributor

If you want to merge your other change in, I think we can make a 0.10.0 release with these. You can update chart.yaml and the changelog for that.

Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! I'm a little nervous about this one, actually. I think we definitely want to support HPAs at some point, but I don't think we have a good grip on how to use them effectively when configuring the agent as a whole.

If we're going to merge this, I think it there should probably be a section in the chart's readme which explains how to use the controller.autoscaling section and specifically what use cases it works with. Since you mentioned the app agent receiver, we can probably start there and expand it out as we gain more knowledge.

@captncraig do you think this is something we can merge and support today or should we hold off for a while?

@@ -0,0 +1,34 @@
{{- if and (eq .Values.controller.type "deployment") .Values.controller.autoscaling.enabled }}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be possible to use an HPA with a StatefulSet too?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it is possible to use an HPA with a StatefulSet. But to reduce the nervousness about this change, it is only targeted toward deployment. If we are comfortable with adding HPA for StatefulSet, I can make the change to add it. Thanks!

@captncraig
Copy link
Contributor

I agree with your concerns, but am still ok merging it, as long as the language is clear. This will not reshard or anything like that, and it may create a lot of redundant work if your config is not suited. This will be extremely useful once we have native clustering though.

@rfratto
Copy link
Member

rfratto commented Mar 9, 2023

@therealmanny would you like to take a shot at adding a header to document this to the chart's readme, or would you prefer for us to do it?

@therealmanny
Copy link
Contributor Author

@therealmanny would you like to take a shot at adding a header to document this to the chart's readme, or would you prefer for us to do it?

@rfratto I can take a shot at documenting this to the chart's readme.

Copy link
Member

@rfratto rfratto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, a little feedback on the README and we can get this merged!

operations/helm/charts/grafana-agent/README.md Outdated Show resolved Hide resolved
@rfratto
Copy link
Member

rfratto commented Mar 22, 2023

Thanks for the contribution!

@rfratto rfratto enabled auto-merge (squash) March 22, 2023 17:53
@rfratto rfratto merged commit c5aa62c into grafana:main Mar 22, 2023
@github-actions github-actions bot added the frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed. label Mar 4, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
frozen-due-to-age Locked due to a period of inactivity. Please open new issues or PRs if more discussion is needed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants