-
Notifications
You must be signed in to change notification settings - Fork 524
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
Add additional IPVS modules like ip_vs_lc
#2409
Comments
ip_vs_sh
ip_vs_sh
Hi @diranged, I just checked our 5.10 kernel config and it does seem like we have most of the IPVS modules enabled (including
Please feel free to re-open this issue if you see we're missing anything! |
@etungsten You're right ... the one that fails for me is
|
ip_vs_sh
ip_vs_lc
Main problem is, that on Bottlerocket OS only:
modules are loaded and I cannot find a way, how to load ip_vs_sed / ip_vs_lc modules during boot. Setting:
does not help. |
I would love to see |
@foersleo what do you think? |
I have had a first look at this, and from the image I can see all the ip_vs modules are in the image:
I also am able to load the modules manually in a dev instance:
So from a OS perspective they are there and healthy. Can someone provide any pointers as to how you are configuring your node so I can have a closer look at how it is failing to load the appropriate modules. |
Looking further in our packages, we seem to load only the The commit introducing it in kubernetes-1.22 variant has some more info on why we need to do it this way: 7919d89 tl;dr: The insmod binary used by kube-proxy is not able to load our compressed modules. So it seems to be the fix here would be to load all available ipvs modules before starting kube-proxy, so that every user can go on and configure as needed. |
Digging a bit around in kubernetes proxier code there is some interesting bits in there: Proxier will only ever attempt to load the following ip_vs modules: That also explains why our workaround only covers It seems that lately (past 1.26) the handling of ipvs has been changed fundamentally, but lets cross that bridge when we get there. All of the above is mostly background and does not help to resolve the issue at hand, which is to get the users the ability to load the ipvs modules they want/need. A simple workaround would be to just load all ipvs modules similarly to the ones we already load, however, I am not convinced that is a solution that resonates well with some of the core concepts of Bottlerocket (keep the footprint small and reduce unused code). Even the current setup does load more code than needed into the kernel, when kube-proxy is used in a mode that does not rely on ipvs (i.e. iptables). I am looking at how we might be able to load these on demand or how to make this configurable. |
@rubroboletus the reason why this didn't work is because the API doesn't load kernel modules, instead it prevents modules from being loaded @foersleo FWIW, after #2772 bootstrap containers can be used to load kernel modules, like this: chroot /.bottlerocket/rootfs modprobe vfio_pci Or insmod /.bottlerocket/rootfs/lib/modules/<KERNEL_VERSION>/kernel/drivers/vfio/pci/vfio-pci.ko.xz |
As an end user, I would really appreciate, if IPVS support for kube-proxy would "just work" without need to set up additional configuration via bootstrap-container/userdata. |
I understand that yet another configuration layer might not be the best user experience. Ideally the appropriate scheduler module would be loaded automatically, and as far as I understand that is what the ipvs handling is currently moving to in kubernetes. There has been a some efforts to restructure how ipvs is handled in the proxy code and as far as I understand the new variant would attempt to load the appropriate scheduler by going through the kernels own mechanism of adding a service with the specified scheduler (See kubernetes/kubernetes#114669 and related issues/PRs for the cleanup done in ipvs handling). (I yet, have to test if that is actually working in Bottlerocket, and it would be a while to land, given that these changes seem to be landing in kubernetes 1.27). Which leaves us with the question of how to handle the issue for current versions of Bottlerocket. As far as I can tell there is the following options we currently have:
I think all of these solutions have their pros and cons, depending from which side we are looking at it. I will do some testing with some of these options and will have a look at if this is going to work without much headache in future kubernetes releases and see if there is a sweet spot we can get towards. |
So the nr 3 solution is?: Settings:
Where "MY-CONTAINER-URI" is a custom container image hosted publicly that looks like this?
Or whichever module you want to load. Correct? |
BTW, can I use a muscl image like alpine to execute the |
@Raboo Yes, that would be the way to use solution 3. However, if I see that correctly the patch linked by @arnaldo2792 has not been released yet in an official release, so the bootstrap containers with Bottlerocket up to v1.12 would not have the right capabilities to load modules. You would have to use a self-built Bottlerocket from the latest develop branch. The choice of base image for that bootstrap container should not really matter, as long as it supports the commands you want to use ( |
Ok I've prepared some bootstrap containers to load specified ip_vs modules that are not loaded by default for when v1.13 is released, check out https://github.com/Raboo/bottlerocket-modprobe. Everything is described in the README. |
I have had a look at this one again. @Raboo I have tried one of your container images in an eks cluster and it unfortunately did not work as expected:
I am no container expert myself, so I am not quite sure what the issue is here. To verify that the mechanism itself works I created an image with the following Dockerfile and it worked out as expected:
|
There was a problem with my entrypoint, try now. |
Thank you! I have tried with the fixed variant of containers provided by @Raboo and confirmed this works as expected. The module is loaded and the bootstrap-container is running successfully. To configure an eks node group through eksctl with a bootstrap-container that loads the
If you want to stall the booting on failing of your bootstrap container you just add With that I think we can close this issue. There is an easy way to load the necessary modules on bottlerocket. |
Followup discussion: #3050 |
As EKS released 1.27, which seems to include improvements around IPVS modules detection/usage, can this be prioritized? I haven't tested it personally yet though, maybe it works fine now, without messing with modprobe in bootstrap containers. |
Originally posted by @diranged in #1726 (comment)
The text was updated successfully, but these errors were encountered: