aws / containers-roadmap

This is the public roadmap for AWS container services (ECS, ECR, Fargate, and EKS).
https://aws.amazon.com/about-aws/whats-new/containers/
Other
5.22k stars 321 forks source link

[EKS] Support for swap memory with Kubernetes #1714

Open asortino opened 2 years ago

asortino commented 2 years ago

Tell us about your request EKS alpha support for using swap memory

Which service(s) is this request for? EKS

Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard? In Kubernetes v1.22, alpha support for using swap memory was introduced. However, on EKS changelog for Kubernetes v1.22 this feature does not appear.

agalligari commented 2 years ago

It would be great at least for EC2 managed node groups

Pablo-platypus commented 1 year ago

any updates on this?

dims commented 1 year ago

It is still alpha as of today (Kubernetes folks are working on 1.27 and it's not on the table for 1.27 either) https://github.com/kubernetes/kubernetes/blob/090025f5e6525b77017c6874b96e2569a6a597c4/pkg/features/kube_features.go#L566-L570

wm-nimesh commented 1 year ago

Moved to beta in 1.28 -> https://kubernetes.io/blog/2023/08/15/kubernetes-v1-28-release/#beta-support-for-enabling-swap-space-on-linux

OrBin commented 1 year ago

Any update on this? Is there any workaround besides just waiting until it's stable?

dims commented 1 year ago

@OrBin see requirements for this feature, it needs cgroups v2 on your node ( https://kubernetes.io/blog/2023/08/24/swap-linux-beta/#how-do-i-use-it ) our default AMI(s) do not have cgroups v2 yet. So you would need a custom AMI with an operating system with cgroups v2 with a custom kublet configuration as mentioned in the blog. There is no configuration on the apiserver side to make it work with 1.28 i think. So if you really want to try you will have to do what i mentioned before. When we get to AL2023, things like this will be easier to enable by default.

OrBin commented 1 year ago

@OrBin see requirements for this feature, it needs cgroups v2 on your node ( kubernetes.io/blog/2023/08/24/swap-linux-beta/#how-do-i-use-it ) our default AMI(s) do not have cgroups v2 yet. So you would need a custom AMI with an operating system with cgroups v2 with a custom kublet configuration as mentioned in the blog. There is no configuration on the apiserver side to make it work with 1.28 i think. So if you really want to try you will have to do what i mentioned before. When we get to AL2023, things like this will be easier to enable by default.

Your answer applies for Kubernetes 1.28, right? I am actually using an older version, so I don't think the cgroup version is an issue for me.

dims commented 1 year ago

@OrBin the feature is NOT available in any other version of k8s by default.

goloveychuk commented 7 months ago

I see that eks now uses al2023, which have cgroups2. What is left to support swap?

dims commented 7 months ago

please watch https://github.com/kubernetes/enhancements/issues/2400

LouAdrienCEL commented 3 months ago

+1

cartermckinnon commented 2 months ago

This is supported on the AL2023-based EKS AMI's, you'll just need to pass the necessary options to kubelet in your NodeConfig. We do not currently plan to enable this feature by default.

This feature will not be supported on AL2-based EKS AMI's, as cgroupv2 is not supported there.