Ipv4 no masq#11791
Ipv4 no masq#11791rdesaintleger wants to merge 2 commits intok3s-io:masterfrom rdesaintleger:ipv4-no-masq
Conversation
Signed-off-by: Rodolphe de Saint Léger <rdesaintleger@gmail.com>
Signed-off-by: Rodolphe de Saint Léger <rdesaintleger@gmail.com>
|
I don't think we really want to add any more top-level flags for flannel. The ADR you're touching here never made it past discussion, but we've recently considered bringing it up again. If we did do this, I think the option you're proposing should go in --flannel-opt instead of being a new top-level flag. |
|
I can remove the global flag and implement the If I understand well the ADR and discussions in #6557 and #6897
Can I go with the ADR implementation now or do I have to wait for its status to change ? Is implementing the ADR is the way to go is the option name |
|
We're discussing internally. |
|
Hi, I did not see progress on the flannel ADR. May I suggest to deprecate the
Except for the deprecation period, this would not add a new flannel top-level flag but replace the existing one, adding the ability to disable ipv4 masquerading. I can implement (or help to) this solution as well as the the flannel opt if you wish. Please let me know. |
|
Dropping PR. Found a way to do it using kube-router. Kube-router can replace flannel/metallb, announces its routes over BGP and allows k3s to run in an unprivileged incus container. For those who can use Virtual machines, cilium should be a better shot. |
Proposed Changes
Add the flag
--flannel-ipv4-no-masqto k3s to disable IPv4 masquerade. Default k3s behaviour do not change and IPv4 masquerade is still activated if the flag is not specified.Disabling NAT allows to replacing with regular BGP routing/advertisement using metallb FRR (for example). In my case metallb advertise local connected routes for each nodes as well as LoadBalancer services.
Types of Changes
This change is a new feature for the k3s flannel configuration (both for command line and yaml config). The advantage of flannel CNI beside being light is to be able to run in unprivileged incus/lxd/lxc containers.
Verification
I've installed my node with the following command line (in a debian bookworm unprivileged incus container) :
If you wish to check with BGP routing I also give the metallb configuration:
First install the metallb CRD
kubectl apply -f https://raw.githubusercontent.com/metallb/metallb/v0.14.9/config/manifests/metallb-frr-k8s.yamlThen apply the following configuration (adjust IPs according to your installation)
Testing
Did not write a test.
Linked Issues
User-Facing Change
NONE
Further Comments
I've seeked a long time the lighest solution for machines which have from 2G to 4G RAM. I've tested calico and cilium which either privileged containers or virtual machine/bare metal. So far, the best solution for me is to stick with flannel. The only problem that I had was with the hardcoded masquerade. This is why I did this PR.