Open juanluisvaladas opened 4 months ago
My go-to choice would be https://github.com/inetaf/tcpproxy/ for couple reasons:
Nginx: Runs on everything except RISC-V
I'm pretty sure nginx runs on RISC-V.
alpine-ci-rv-2:~# uname -a
Linux alpine-ci-rv-2 5.10.113+ #1 SMP PREEMPT Tue Apr 23 11:57:43 UTC 2024 riscv64 Linux
alpine-ci-rv-2:~# apk add nginx
fetch http://dl-cdn.alpinelinux.org/alpine/edge/main/riscv64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/edge/community/riscv64/APKINDEX.tar.gz
(1/4) Installing pcre (8.45-r3)
(2/4) Installing nginx (1.26.1-r2)
Executing nginx-1.26.1-r2.pre-install
Executing nginx-1.26.1-r2.post-install
(3/4) Installing nginx-openrc (1.26.1-r2)
(4/4) Installing nginx-vim (1.26.1-r2)
Executing busybox-1.36.1-r26.trigger
OK: 354 MiB in 105 packages
alpine-ci-rv-2:~# nginx -version
nginx version: nginx/1.26.1
The issue is marked as stale since no activity has been recorded in 30 days
The issue is marked as stale since no activity has been recorded in 30 days
Problem statement
After some investigation it was found that the all hosts reply to ARP requests to the virtual IP because the host has that virtual ip in the interface dummyvip0.
This behavior can be avoided easily by setting the sysctl
net.ipv4.conf.<interface>.arp_ignore = 1
. However this "randomly" breaks hairpining with IPVS. On other circumstances this could be avoided entirely using iptablesnat
table withPREROUTING
andPOSTROUTING
rules, however in the scenario of calico + kube-proxy I have not been able to do this.I think we'll need to have the following behavior: 1- When CPLB runs in controller+worker, forbid virtualServers in keepalived 2- For load balancing, introduce a reverse proxy. This could be something external like haproxy, nginx or envoy or an embedded library.
Reverse proxy
Golang library:
1- inetaf tcpproxy: Very simple, well written and uses Apache 2 license (my favourite option) 2- Caddy: links kubernetes libraries and isn't even up to date. Most likely very painful in the future 3- Golang's httputil/reverseproxy.go). We need a TCP reverse proxy because mTLS. We simply can't use this. 4- Kube-proxy: Userspace proxy doesn't exist anymore
External process
1- Nginx: Runs on everything except RISC-V (I've seen a fork on github) alpine build is less than 1Mb uncompressed and less than 500k. It has a few dependencies which aren't statically linked but I doubt it'd get much larger anyway:
2- Apache: similar numbers, haven't found any information about RISC-V. 3- Haproxy: Doesn't say anything about RISC-V support but I've seen compilations for RISC-V, I'm not sure if they are modified. Haproxy build for alpine is 3.2Mb uncompressed and 1.4Mb compressed. It links dynamically a few libraries:
it could be statically linked and we can probably compile it in a way that doesn't require some of these...
4- Envoy: Envoy latest release nearly 70Mb for x86 architecture, gzip compressed around 24Mb and it also has limitations on the architectures it can run on.