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

Set Elasticsearch Pod default memory limit to 2Gi #1810

Merged
merged 1 commit into from
Sep 27, 2019

Conversation

sebgl
Copy link
Contributor

@sebgl sebgl commented Sep 27, 2019

Similar to how we set a default request of 2Gi to prevent the Pod from
being scheduled on a node without at least 2Gi memory, let's set a
default memory request of 2Gi. Which should prevent the Pod from being
the first one evicted on a node running out of memory.

Those defaults can be overridden by the user, or disabled entirely by
providing an empty ({}) memory requests or limits.
If either limits or requests is provided by the user (or both), we don't
apply our default resources requirements.

No default CPU is set.

Fixes the ES part of #1454.

Similar to how we set a default request of 2Gi to prevent the Pod from
being scheduled on a node without at least 2Gi memory, let's set a
default memory request of 2Gi. Which should prevent the Pod from being
the first one evicted on a node running out of memory.

Those defaults can be overridden by the user, or disabled entirely by
providing an empty ({}) memory requests or limits.

No default CPU is set.
@sebgl sebgl added v1.0.0-beta1 >enhancement Enhancement of existing functionality labels Sep 27, 2019
DefaultResources = corev1.ResourceRequirements{
Requests: map[corev1.ResourceName]resource.Quantity{
corev1.ResourceMemory: resource.MustParse("2Gi"),
},
Limits: map[corev1.ResourceName]resource.Quantity{
corev1.ResourceMemory: resource.MustParse("2Gi"),
},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Technically, we don't have to apply both Requests and Limits: if only Limits are set, Kubernetes defaults to set Requests to the same value.
However I tend to prefer making both clearly explicit here (the comment helps understanding their respective role).

@sebgl sebgl merged commit 9d4caa0 into elastic:master Sep 27, 2019
@pebrc pebrc changed the title Set a default memory limit of 2Gi for the ES Pod Set Elasticsearch Pod default memory limit to 2Gi Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
>enhancement Enhancement of existing functionality v1.0.0-beta1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants