Skip to content

Refactor/eks/managed nodes/system reserved and kube reserved#2382

Closed
wcarlsen wants to merge 19 commits into
masterfrom
refactor/eks/managed-nodes/system-reserved-and-kubeReserved
Closed

Refactor/eks/managed nodes/system reserved and kube reserved#2382
wcarlsen wants to merge 19 commits into
masterfrom
refactor/eks/managed-nodes/system-reserved-and-kubeReserved

Conversation

@wcarlsen

@wcarlsen wcarlsen commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Describe your changes

This is a stacked PR depending on #2380 to be merged first.

We remove variables:

  • kube_reserved_cpu (kubelet reserved CPU) since, this doesn't scale with max_pods. The scaling is calculated in this fashion (6% of the first core + 1% of the second core + 0.5% of the third and fourth core + 0.25% of the remainding cores.
  • kube_memory (kubelet reserved memory) scales with Max Pods, but EKS doesn't handle overwrites to to Max Pods in terms of reserved memory. The calculation is as following 255Mi + (11Mi * Max_pods).
  • I'm also removing systemReserved completely, since AWS EKS team doesn't set because it requires a bunch of system knowledge see this link for Kubernetes docs on the topic https://kubernetes.io/docs/tasks/administer-cluster/reserve-compute-resources/#general-guidelines.
  • Migrated instance_type from launch template to node group to better support mixed instance types.
  • Added check block to throw a warning when instance types with lower than 110 max pods

Issue ticket number and link

Checklist before requesting a review

Is it a new release?

  • Apply a release tag release:(major|minor|patch), following semantic versioning in this guide or norelease if there is no changes to the Terraform code

wcarlsen added 6 commits June 11, 2026 10:07
…bled by default

Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
… github.com:dfds/infrastructure-modules into remove/eks/addon/vpc-cni/prefix-delegation-variable
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
@wcarlsen wcarlsen requested a review from a team as a code owner June 11, 2026 11:36
@wcarlsen wcarlsen added the release:major Triggers a major release label Jun 11, 2026
@DFDS-Snyk

DFDS-Snyk commented Jun 11, 2026

Copy link
Copy Markdown

Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
Open Source Security 0 0 0 0 0 issues
Licenses 0 0 0 0 0 issues
Code Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

wcarlsen added 2 commits June 11, 2026 14:08
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
@wcarlsen

Copy link
Copy Markdown
Contributor Author

After speaking with @SEQUOIIA and @rifisdfds we decided to:

wcarlsen added 2 commits June 19, 2026 09:01
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
wcarlsen added 4 commits June 20, 2026 19:11
… Ready state under extreme CPU and memory pressure

Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
… github.com:dfds/infrastructure-modules into refactor/eks/managed-nodes/system-reserved-and-kubeReserved
… max_pods of 110 and stop setting instance_types on launch_template

Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
@wcarlsen wcarlsen force-pushed the refactor/eks/managed-nodes/system-reserved-and-kubeReserved branch from 0193217 to 04afcbb Compare June 23, 2026 12:57
…emplate

Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
@wcarlsen

wcarlsen commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

This PR fails when being rolled back to master branch and not on applying feature branch see https://github.com/dfds/infrastructure-modules/actions/runs/28049163804/job/83038273166. The issue on master comes from a change on this PR migrating instance_type from launch_template resource to node_group resource to improve support for mixed instance_types. When it rolls back to master it cannot because there no changes really happening to the launch_template, but the instance_type parameter isn't set on the nodegroup and then it fails.

So the failing check on this PR is not from applying the changes, it is from the rollback.

@samidbb

samidbb commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@wcarlsen would you please update the description to reference the docs mentioning about the the calculation in regards to scaling of kubelet reserved CPU ?

@wcarlsen

wcarlsen commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@wcarlsen would you please update the description to reference the docs mentioning about the the calculation in regards to scaling of kubelet reserved CPU ?

Sure thing. It is pretty hard to find and it is a combination of a lot of unofficial links and some AWS Batch documentation for AWS EKS. Basically AWS uses the same calculation for CPU as GKE and AKS and on memory they diverge.

If I find some good links I will add them, but any changes to this branch breaks master when rolling back. So it will have to wait until after tomorrow.

You probably have to be more specific with what you mean with docs? Is in a comment in the code or in the description of this PR or somewhere else?

@wcarlsen

wcarlsen commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@wcarlsen would you please update the description to reference the docs mentioning about the the calculation in regards to scaling of kubelet reserved CPU ?

Sure thing. It is pretty hard to find and it is a combination of a lot of unofficial links and some AWS Batch documentation for AWS EKS. Basically AWS uses the same calculation for CPU as GKE and AKS and on memory they diverge.

If I find some good links I will add them, but any changes to this branch breaks master when rolling back. So it will have to wait until after tomorrow.

You probably have to be more specific with what you mean with docs? Is in a comment in the code or in the description of this PR or somewhere else?

Here is the links from AWS Batch on EKS kubeReserved:

and here are links to the official go code setting these values:

Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
@wcarlsen wcarlsen force-pushed the refactor/eks/managed-nodes/system-reserved-and-kubeReserved branch from 3774a3b to 01872f8 Compare June 29, 2026 11:32
wcarlsen added 2 commits June 29, 2026 13:34
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
Signed-off-by: Willi Carlsen <carlsenwilli@gmail.com>
@wcarlsen wcarlsen force-pushed the refactor/eks/managed-nodes/system-reserved-and-kubeReserved branch from e2cc25b to 4175cc6 Compare June 29, 2026 12:08
@wcarlsen

wcarlsen commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

This one mixes in different concept so replacing it with this PR #2395

@wcarlsen wcarlsen closed this Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:major Triggers a major release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants