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

k8s: Improve kubeReserved to handle Null max-pods #1472

Merged
merged 1 commit into from
Apr 9, 2021

Conversation

gthao313
Copy link
Member

@gthao313 gthao313 commented Apr 8, 2021

Description of changes:
Improve kubeReserved to handle Null max-pods. When settings.kubernetes.max-pods returns Null, Bottlerocket should not reserve anything for kube-reserved.memory.

Testing done:
Since Those changes in different version kube-config are an identical change, and it works the same way in all versions, so we just need build aws-k8s-1.19-x86_64 and aws-k8s-1.19-aarch64 images to do test.

My repository does not have this change k8s: update eni-max-pods, so c6g.large is still qualified to be a test instance.

c6g.large
Userdata

[settings.kubernetes.kube-reserved]
memory = "100Mi"
cpu = "1"
ephemeral-storage = "2Gi"
bash-5.0# cat etc/kubernetes/kubelet/config
ca/etc/kubernetes
kubeReserved:
  cpu: "1"
  memory: "100Mi"
  ephemeral-storage: "1Gi"

Default

bash-5.0# cat etc/kubernetes/kubelet/config
ca/etc/kubernetes
kubeReserved:
  cpu: "70m"
  ephemeral-storage: "1Gi"

m5g.large ( we have this instance data)
default

kubeReserved:
  cpu: "70m"
  memory: "574Mi"
  ephemeral-storage: "1Gi"

Userdata

[settings.kubernetes.kube-reserved]
memory = "100Mi"
cpu = "1"
ephemeral-storage = "2Gi"
bash-5.0# cat etc/kubernetes/kubelet/config
ca/etc/kubernetes
kubeReserved:
  cpu: "1"
  memory: "100Mi"
  ephemeral-storage: "1Gi"

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@gthao313 gthao313 merged commit 1e37cf5 into bottlerocket-os:develop Apr 9, 2021
@tjkirch tjkirch added this to the 1.0.8 milestone Apr 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants