-
Notifications
You must be signed in to change notification settings - Fork 22
chore: Normalize how resources
are set for each container
#175
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
Conversation
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.
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
Comments suppressed due to low confidence (1)
charts/invenio/templates/worker-beat-deployment.yaml:91
- Unconditionally rendering an empty resources block may lead to unexpected behavior if Kubernetes does not accept an empty mapping. Consider conditionally rendering the resources block only when the provided value is non-empty.
resources: {{- toYaml .Values.workerBeat.resources | nindent 10 }}
There may be additional |
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.
Just to questions:
- Could we comment similarly to the one you linked on the nginx chart?
We usually recommend not to specify default resources and to leave this as a conscious...
- Since we are, essentially, removing default values for resources, do you think there is a way to warn users about this change? Other than release notes
☺️
Excellent suggestion! I'll see to it.
Oh yeah, right. That. 🫤 I guess we could add a warning in NOTES.txt that shows up if resources are unset. I don't think I've seen that before, and it might be a bit annoying to maintain over time, but I think that would provide a pretty good help to users. Sounds reasonable? |
This change removes the redundant default values for worker-beat's `resources` field and sets the new default to `{}`, aligned with Bitnami's standard.
This change unsets the default resources configured for the chart's dependencies.
@egabancho I've updated the comments now, so I think that's been resolved. I've also added some logic to NOTES for printing a warning if Resulting message looks like this: |
LGTM! |
Description
This PR normalizes how we set
resources
for each container and initContainer, first by standardizing how we include the values in the templates and secondly by resouces to{}
by default, aligned with Bitnami's standard.Here's one example of Bitnami documenting their reasoning for it:
— https://github.com/bitnami/charts/blob/7345c0bb2842b73f299aacd2af37147bd7b714cd/bitnami/nginx/values.yaml#L331-L334
We don't have to follow Bitnami's standard, but I think it's reasonable to do so. Unless we are very confident that a container has some upper/lower bound on its resource utilization, it's probably best to condition the chart user to always set the resources explicitly.
Considering how Kubernetes hide the exact capacity of CPU cores etc., it's pretty much impossible to set resource requests/limits that work the same for everyone. This strategy also reduces the need to make additional changes when updating the chart's default images in the future.
Fixes #109
Checklist
Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:
Frontend
Reminder
By using GitHub, you have already agreed to the GitHub’s Terms of Service including that: