-
Notifications
You must be signed in to change notification settings - Fork 245
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/deployment: add resources requests and limits for helm and Kustomize #1631
Merged
k8s-ci-robot
merged 1 commit into
kubernetes-sigs:master
from
TessaIO:chore-add-resources-limits-and-requests
Apr 2, 2024
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
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.
Setting
limits.memory: 4Gi
means you're ok with an OOM Kill at that number. Hence, the expectation is for the master pod to requesting more memory.Setting a lower
requests.memory
is not helping at all. Let's say you get an OOM Kill, then the scheduler spawns a new pod in a node with enough memory according to the requests, but not enough for the limits. This is perfectly fine for the scheduler, but your pod will die again.Because of the above and because memory cannot be returned to the pool (after GC for example), this is why the recommendation is to set limits equal to requests for memory. You only help the scheduler this way.
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.
Thanks @cmontemuino for the feedback. I think one reason to set limits is to really oom kill the pod if it get's crazy (with memory leaks like #1614). It might be better to set it to 8Gi than 4Gi, though. The memory consumption very heavily depends on the number of nodes in the cluster (on the ballpark of ~1.5MB per node or so, it seems). We probablty want the default deployment to work in a wide variety of clusters so we cannot set requests to 4Gi or 8Gi as it's total waste (or cannot be satisfied) in smaller clusters and lowering limits to 128Mi will cause problems in bigger clusters. Thoughts?
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.
I believe that setting proper resource constraints should be up to administrator of specific cluster. Our example deployment manifests should only provide some guidance. Some platforms operators would prefer to OOM
nfd-master
quicker not to occupy resources from other components other would prefer to do it later etc. There is no golden rule.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.
In my clusters I am setting limits 25% above actual usage. As I prefer to be alerted about OOMs in my control plane quicker than later so It's easier to triage issues wrt to resource starving but I understand that other can disagree with this approach 😄
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.
@marquiz -- I'm not suggesting to left limits unset. What I'm saying is to use the same value for both
resources.limits.memory
andresources.requests.memory
.Having them with different values won't help because memory is not an "elastic" resource.
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.
@cmontemuino as I explained I don't think we can do that. We don't want to set requests=limits=4Gi as that will hurt/block small clusters and similarly we don't want to set requests=limits=128Mi (or smth on that range) because we'll get oom'ed in bigger clusters.
I think we should document the resource requests/limits better, though.
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.
Any suggestions?
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.
@marquiz -- got it 👍
Thus it becomes a documentation issue. It must be super clear what implications are there when having different limits and requests for memory. Otherwise OOM Kill will start happening for smaller clusters; and likely non-availability for clusters with memory-pressure scenarios.
Would you like me to try documenting it in a 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.
@cmontemuino please do, thanks for volunteering, really appreciated 👍