-
Notifications
You must be signed in to change notification settings - Fork 560
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
chore: add support for not setting replicas helm chart #6373
chore: add support for not setting replicas helm chart #6373
Conversation
So opened the draft PR as you requested @dimitarvdimitrov. For reference this is how loki helm chart handles it https://github.com/grafana/helm-charts/blob/main/charts/loki-distributed/templates/ingester/statefulset-ingester.yaml#L15 |
operations/helm/charts/mimir-distributed/templates/distributor/distributor-dep.yaml
Outdated
Show resolved
Hide resolved
thanks for pointing this out. I think having |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current approach LGTM.
Are we doing this only for the distributor deployment? I think the next steps are to document the behaviour in the values.yaml and add maybe a comment over that complex if
expression to explain the purpose of it (especially the check for int64 and float64, which isn't trivial). And finally a Changelog entry in the operations/helm/..../CHANGELOG.md
Will do, I was planning to add it for distributor, querier, and query-frontend. Just wanted to get the logic right first. |
61f6092
to
285ad25
Compare
Looking into the faild pipeline. |
Seems to be because I forgot to do this:
Looking into it more. |
Turns out it was caused by this, disabling it helped. |
@@ -8,7 +8,10 @@ metadata: | |||
{{- toYaml .Values.distributor.annotations | nindent 4 }} | |||
namespace: {{ .Release.Namespace | quote }} | |||
spec: | |||
# If replicas is not number (when using values file it's float64, when using --set arg it's int64) and is false (i.e. null) don't set it | |||
{{- if or (or (kindIs "int64" .Values.distributor.replicas) (kindIs "float64" .Values.distributor.replicas)) (.Values.distributor.replicas) }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to have this in a named template, so we don't repeat ourselves, but I think I can address this in a follow-up PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for the contribution and I appreciate the patience 🙂
What this PR does
Introduces support for not setting replicas, specifically so you can use autoscaling with components which are safe to autoscale.
As I mentioned here #3430 (comment) I did some testing,
I started with
but helm complains when it's not null:
So I tried:
when replicas is a number i.e. the default
1
it works.When it's set to null the replicas is not set, good.
But when it's set to 0 it's also unset. Now this is not a common case imho but it would break.
Would that be okay or should I look for another way to do it?
Which issue(s) this PR fixes or relates to
Fixes # #3430 (comment)
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]