Generate rke2-canal resource bounds from template values rather than hardcoding. #359
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Proposed Changes
This PR adds additional
resources
helm value configuration options torke2-canal
. It replaces the previously-hardcoded 250m CPU request on thecalico-node
container with a helm-configured request, and also adds the option to theflannel-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
orrke2-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.