-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Support NVMe SSD root volumes #349
Comments
/cc @Jeffwan |
If you uses Nitro instances (c5, m5, etc) the root volume will be NVMe by default:
Why do you need a second EBS volume? |
I'm talking about the d family instances specifically. Like the m5d.large instance type. These types don't use an EBS volume as a root device, instead they use a hardware-based SSD that is directly attached to the instance. To be more specific, we use EKS for our Gitlab server inside of AWS. Our gitlab CI/CD runners use a dedicated EKS cluster. Since we are spinning up and down nodes many times throughout the day to match load of our CI jobs, we need only a small amount of disk space but very high throughput (docker pull/push and npm install being ran in parallel for dozens of jobs uses a ton of IOPs). It's more cost efficient for us to use the instance types that provide hardware NVMe SSDs as a root volume, and it seems like it's an easy thing to implement given that the Amazon Linux 2 OS provides driver support for these SSDs by default and the EKS AMIs are based off of them. Please let me know if I'm missing something. From my testing, the AMIs require an EBS volumes with at least 20GB no matter the instance type. |
With that said, I imagine that using these instances probably already works without any configuration changes. This may simply be an AMI requirement for an EBS volumes that isn't necessarily required. If someone knows how to get around the requirement that the AMI have an EBS volume attached, I can test it and maybe use it without a problem. |
So now I'm realizing that this isn't specific to EKS at all, that amazon doesn't allow the NVMe SSD to be the root device? If this is true, I'm probably just really dumb and you can close this issue :) |
With m5d family, NVMe volume is attached to each instance as ephemeral volume (non EBS volume).
See https://aws.amazon.com/ec2/instance-types/ Yep, and for this case NVMe won't be root device. |
Thanks so much! |
@phillycheeze we are facing the same issue, we are trying to use NVMe as root device to improve the performance of our Gitlab runners. Our current bottleneck is the IOPs. Did you manage to find a solution? |
I had the same idea to put the root fs on NVMe for my GitLab runner. I haven't found a way to do it, but instead I just put That can be done by adding #!/bin/sh
mkfs.ext4 /dev/nvme0n1
mkdir -p /var/lib/docker
mount /dev/nvme0n1 /var/lib/docker I use a Debian Buster AMI, the paths may be different on other distros. |
Thanks for this important clue @johan13 . We found that the following code fragment (based upon your suggestion) works for us, when inserted into our userdata, e.g. for r5d AWS instances. As you can see, in particular we found that we must stop/start the docker daemon.
|
Thanks a lot for the hints. I have one more finding on top of this thread. This means:
So to make the most of the SSD storage we use this preBootstrap snippet:
Tested on kubernetes versions 1.18 and 1.19, aws instance type c5d.4xlarge and gitlab runner chart 0.28. |
Thanks for this important clue @johan13 @jae-63 @wojtek-at-mambu. https://docs.aws.amazon.com/eks/latest/userguide/launch-templates.html#launch-template-user-data Amazon EC2 user data in launch templates:
|
Thank you all for your inputs. If I understand correctly, now containerd is the default container runtime (since Kubernetes 1.24). Has anyone managed to do the same thing with containerd ? |
So I swapped You may want to use it until the next AMI release as @cartermckinnon mentioned.
|
for future reference if anyone lands here , the EKS AL2 and AL2023 amis provide a script to automate this https://github.com/awslabs/amazon-eks-ami/blob/master/files/bin/setup-local-disks which can also be run from the |
gives 404. Probably it was already removed and we should use https://github.com/awslabs/amazon-eks-ami/blob/main/nodeadm/doc/api.md#localstorageoptions |
What would you like to be added:
The AWS EKS AMIs should support the root volume of NVMe SSD instance types within AWS.
When going through the Launch Instance flow of an eks-ami in the AWS console, it requires you to attach a second EBS volume on instance types that have an NVMe SSD root volume.
Why is this needed:
For workloads that require high disk-throughput, these instance types provide higher bandwidth over EBS volumes.
The text was updated successfully, but these errors were encountered: