How to update MTU of AWS EC2 running bottlerocket os? #3338
Replies: 1 comment 1 reply
-
Great question @tskinner-oppfi. My first thought, as an equivalent to the Amazon Linux instructions, would be to create a bootstrap container to make the same This could be a race between the bootstrap container setting the value, and the MTU being assigned via DHCP. With EC2, the default ends up being I think to support this properly Bottlerocket might need a new setting exposed to override this. If you would like to see this capability, would you mind submitting a feature request issue? I'm not sure when it could be added, but at least that would help track the request and see if anyone else is also looking for this capability to help prioritize things. Notes Just in case anyone is curious, here is what I did to change this setting with a bootstrap container. This will not work, but maybe it can give some clues. First I created a script to be called by the container called #!/usr/bin/env bash
sudo ip link set dev eth0 mtu 1600
ip link show Then created a Dockerfile with: FROM public.ecr.aws/amazonlinux/amazonlinux:latest
COPY ./bootstrap-script.sh /
RUN chmod +x /bootstrap-script.sh
# Both sudo and ip are needed to make the `ip link set` call work properly
RUN yum install -y sudo iproute
ENTRYPOINT ["/bootstrap-script.sh"] Built the container and published to a private ECR registry. Then set a test node's user data to have: [settings.bootstrap-containers.bootstrap]
source = "123456789.dkr.ecr.us-east-2.amazonaws.com/bootstrap:latest"
mode = "always" I could see in the system log (
But by the time the rest of the system initialization happened and I was able to connect and run
|
Beta Was this translation helpful? Give feedback.
-
I'd like to migrate to bottlerocket os for my EKS clusters but I currently change the MTU via a user data script using commands described here https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/network_mtu.html#set_mtu
How can I change the MTU of bottlerocket instances?
Beta Was this translation helpful? Give feedback.
All reactions