-
Notifications
You must be signed in to change notification settings - Fork 95
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
Configurable resource requirements for APIManager components #454
Conversation
👍 per component is per container.
Good. Intuitive and common sense.
Agree. REPLACE behavior is easier and enough. Merge behavior (with defaults) can be confusing and requires not standard data structure type in the CRD to define resource requirements. REPLACE behavior requires, though, to know existing defaults. A user may want to update cpu limit and leave cpu requests, memory limits and memory requests "as defaults". So the user needs to create structure with desired cpu limit and copy other values from defaults. For example:
For that, default values should be documented. |
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.
Overall LGTM.
Left some comments. I also miss some option provider tests.
1eb1f5e
to
cd676ba
Compare
Remanining tests added. Documentation pending. |
Added documentation |
67bede6
to
4736a01
Compare
fix the broken link and merge. |
4736a01
to
cd50357
Compare
DeploymentConfig-level ResourceRequirement attributes in the CR have priority over spec.resourceRequirementsEnabled setting and overwrite the values set by it
DeploymentConfig-level ResourceRequirement attributes in the CR have priority over spec.resourceRequirementsEnabled setting and overwrite the values set by it
DeploymentConfig-level ResourceRequirement attributes in the CR have priority over spec.resourceRequirementsEnabled setting and overwrite the values set by it
DeploymentConfig-level ResourceRequirement attributes in the CR have priority over spec.resourceRequirementsEnabled setting and overwrite the values set by it
cd50357
to
7b3bf5a
Compare
Code Climate has analyzed commit 7b3bf5a and detected 15 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
This PR adds configurable resource requirements for APIManager components.
Summary of the implemented behaviour
Detailed implemented behaviour
Possible use case scenarios
values on the corresponding resources attribute provided at component level in the APIManager CR
corresponding resources attribute provided at component level in the APIManager CR
resources attribute provided at component level in the APIManager CR as the empty map value
{}
Unsupported scenarios
Basically the ones that involve a potentially desired merge behavior between global defaults and custom values:
Allowing those unsupported scenarios would require us to stop using the v1.ResourceRequirements type provided by Kubernetes in our CR and provide our own type where we can differentiate between setting resource requests to nil or empty, as the Kubernetes implementation treats those values with the same behavior, which is not enforcing them in that case.
The alternative implementation: