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

Generate rke2-canal resource bounds from template values rather than hardcoding. #359

Merged
merged 2 commits into from
Jul 14, 2023

Conversation

AJMansfield
Copy link
Contributor

@AJMansfield AJMansfield commented Jul 12, 2023

Proposed Changes

This PR adds additional resources helm value configuration options to rke2-canal. It replaces the previously-hardcoded 250m CPU request on the calico-node container with a helm-configured request, and also adds the option to the flannel-node container.

I've added the remaining unused resource bound keys as comments for documentation purposes (aside from the calico.resources.requests.cpu key that's set by default to preserve the existing 250m bound). I don't know if the bounds the comments suggest are reasonable for the same median use-case as that 250m bound, but I don't figure it matters much; anyone configuring them should be doing their own profiling on their own hardware anyway.

Types of Changes

This is a non-breaking change to enhance existing functionality with the addition of a standard feature.

Verification

This patch does not result in any changes to the template output from helm, unless the new configuration keys it adds are overridden; the default rendered output manifests is byte-for-byte identical to the pre-patch version.

The code pattern used in the added code is the standard way to implement resource bounds configuration in helm, as seen already in use in other packages in this repository such as rke2-multus or rke2-coredns.

Further Comments

For my specific use case, this change makes it possible for me to scale the default request down, and make it a better fit for the small 4-core nodes I'm running. With this change I can just add a HelmChartConfig with the appropriate resource bounds keys to my RKE2 server manifests folder (i.e. /var/lib/rancher/rke2/server/manifests/canal-resources.yaml), rather than needing Kustomize or some other workaround.

@brandond
Copy link
Member

Thanks! Please sign-off all of your commits for DCO!

Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
@AJMansfield
Copy link
Contributor Author

AJMansfield commented Jul 14, 2023

Thanks! Please sign-off all of your commits for DCO!

Done!

Also, updated the PR comment to follow the new PR template I saw was being pushed through.

@brandond brandond merged commit 35ef849 into rancher:main-source Jul 14, 2023
github-actions bot pushed a commit that referenced this pull request Jul 14, 2023
…hardcoding. (#359)

* use template values to set resource bounds
* packageVersion increment

Signed-off-by: Anson Mansfield <amansfield@mantaro.com>
@manuelbuil
Copy link
Contributor

@AJMansfield Could you create a PR in rke2 so that it starts using the new chart? Something like this PR rancher/rke2@33caf61. No hurry, we are already in code freeze for the July release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants