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
Added kubeReserved
calculation support for mixed instance NodeGroups
#2378
Added kubeReserved
calculation support for mixed instance NodeGroups
#2378
Conversation
f6316b1
to
579b18a
Compare
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.
Hi @elementalvoid thank you for this PR. The code looks good in general and I only had one minor comment. There is a change that we need to make though and it's regarding the mentioning of fleets. Please revise the PR and make sure there is no mention of it since eksctl uses ASGs instead.
pkg/nodebootstrap/userdata.go
Outdated
if _, ok := obj["kubeReserved"]; !ok { | ||
obj["kubeReserved"] = api.InlineDocument{} | ||
} | ||
obj["kubeReserved"].(api.InlineDocument)["ephemeral-storage"] = info.DefaultStorageToReserve() | ||
obj["kubeReserved"].(api.InlineDocument)["cpu"] = info.DefaultCPUToReserve() | ||
obj["kubeReserved"].(api.InlineDocument)["memory"] = info.DefaultMemoryToReserve() |
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.
Perhaps these can be extracted into a func setKubereserved(*obj, *info)
to avoid duplicating these in lines 138-143
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 created the new function but the signature is different than suggested. Rather than passing in the kubeReserved
document and mutating it, I pass only the info
and return the required document. Let me know if this works!
2c5f7e5
to
aa55da1
Compare
kubeReserved
calculation support for mixed instance NodeGroups
Thanks @martina-if! I squashed my commits together to keep things clean and to reword the original message removing Fleet mentions there too. Separately, GitHub status is warning about being out of date from the base branch. Do you want me to rebase or leave it as is? |
aa55da1
to
56a2c66
Compare
Hi @elementalvoid thanks for the changes. They look good except one minor thing on the docs side. Yes, please rebase the changes on top of the latest master. Also, can you post here proof of manual testing of this feature? That helps us merge it faster and keeps instructions on how to test new features. |
Support for calculating CPU, RAM, and Storage reservations via `kubeReserved` was added to eksctl in v0.16. However, it only supported NodeGroups with a single instance type. ASGs can have multiple instance types and were not included in the calculation. This change enables calculation of kubeReserved for mixed instances too. Since multiple instance types are supported it calculates the reservation based on the smallest instance type in the distribution. Additional kubeReserved tests covering unknown innstance types. The new tests ensure that unknown instance types are properly ignored during calculation of kubeReserved.
56a2c66
to
aa0c44c
Compare
I've rebased onto the current master branch and found/replaced the remaining Here's the manual test run:The test
|
Hi @elementalvoid @martina-if looking at this PR and the website documentation, I am confused about the behavior of However this PR makes it sound like |
Hi @whereisaaron! @martina-if linked a related issue above -- an ask to improve documentation on this feature. Automatic So long as you do not specify the What my PR did was expand that automatic calculation to include ASGs with multiple instance types as the original implementation only calculated them for single instance type ASGs. I hope that helps. |
Thanks @elementalvoid for the reply, and thanks @whereisaaron for the feedback, this is very useful since it helps us assign the right priority to things. I've raised the priority of #2091. Hopefully we will be able to include it in next week's planning. |
Description
Support for calculating CPU, RAM, and Storage reservations via
kubeReserved
was added toeksctl
inv0.16
. However, it only supportedNodeGroups with a single instance type. ASGs can have multiple
instance types and were not included in the calculation.
This change enables calculation of
kubeReserved
for mixed instances too.Since multiple instance types are supported it calculates the reservation
based on the smallest instance type in the distribution.
Additional
kubeReserved
tests covering unknown innstance types. The new testsensure that unknown instance types are properly ignored during calculation
of
kubeReserved
.Checklist
README.md
, or theuserdocs
directory)area/nodegroup
), target version (e.g.version/0.12.0
) and kind (e.g.kind/improvement
)