Trying to make a Traefik reverse proxy sending port 80 and 443 traffic to kubernetes on another server. Important to notice that HTTPS traffic must be passthrough and thus sent encrypted as is because kubernetes is already managing this.
part of traefik.toml
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.websecure]
address = ":443"
example.toml
[tcp]
[tcp.routers]
[tcp.routers.k8sSecureRouter]
rule = "HostSNI(`*`)"
service = "k8sSecure"
entryPoints = ["websecure"]
[tcp.routers.k8sSecureRouter.tls]
passthrough = true
[tcp.routers.k8sRouter]
rule = "Host(`*`)"
service = "k8s"
entryPoints = ["web"]
[tcp.services]
[tcp.services.k8s.loadBalancer]
[[tcp.services.k8s.loadBalancer.servers]]
address = "192.168.1.10:80"
[tcp.services.k8sSecure.loadBalancer]
[[tcp.services.k8sSecure.loadBalancer.servers]]
address = "192.168.1.10:443"
HTTPS traffic works as expected, but HTTP gets an empty reply after some lag. Everything should be fine though, because calling the kubernetes server directly works perfectly with both protocols.