This message was deleted.
# k3d
a
This message was deleted.
c
why are you mapping 2,767 ports into a docker container? possible doesn’t mean good idea.
also, 4gb is not very much memory these days.
as the screenshot says, there is an iptables rule and proxy process for each and every port you map
b
because this page: https://k3d.io/v5.4.3/usage/exposing_services/ references this video:

https://www.youtube.com/watch?v=5HaU6338lAk

which says to do it
c
the examples all suggest exposing a single port, but then explain that you can expose all of them, although it may freeze your system.
given the warning about freezing your system, I would not read that as something that you should do unless you like maybe getting locked out of your dev host until you reboot it
b
Sounds like someone noticed it can lock a system and added a warning without any effort to see if there might be a work-around.
I've got to try, but if its something the implementation doesn't allow, then it would be impossible.
c
I mean I think it works, its just that you’re essentially fork-bombing your host with all the proxy processes, so you need to throw a fair bit of resources at it if you want to do that
w
Sounds like someone noticed it can lock a system and added a warning without any effort to see if there might be a work-around.
This is exactly what I did... after some research. Unfortunately, there is no such thing as "slowing it down" - It's not k3d creating the proxy processes and iptables rules, it's Docker. k3d is just telling Docker "Hey give me this container with all those ports mapped" - there's no way to tell Docker "do it slowly" or "don't use that many processes", unfortunately. Here are some older issues around this: https://github.com/k3d-io/k3d/issues/433 & https://github.com/k3d-io/k3d/issues/1362 The video you linked is even part of this feature request: https://github.com/k3d-io/k3d/issues/326 In fact, it works on "beefier" machines.
FWIW: NodePorts are usually not that common to be used. Unless you want to use hundreds of them, I'd recommend to either specify the known ones upfront when creating the cluster or to make use of the
k3d cluster edit <NAME> --port-add 1234:1234@loadbalancer
feature to add new port mappings to the running cluster.
b
Thank you.