I do not know if it is even possible but this is what I am trying to achieve
I have k3s cluster and Traefik is a part of k3s, so for all ingress purposes I am using it and it works well for http ingress .
Deployed mongodb cluster (community operator) with ReplicaSet/StatefullSet and headless service.
So far I can't find any solution on exposing this headless service.
My attempts to create an IngressRouteTCP failed. service/traefik in kube-system namespace
IngressrouteTCP does not use HOST header to match the incoming connection. It is not intended to be used like HTTP, that's why the Host header is not available. It is only specific to HTTP. Instead of that please use HostSNI.
I have tried HostSNI('*') and still doesn't work.
kubectl apply throws the following error:
error validating data: ValidationError(IngressRouteTCP.spec.entryPoints): invalid type for us.containo.traefik.v1alpha1.IngressRouteTCP.spec.entryPoints: got "map", expected "array"; if you choose to ignore these errors, turn validation off with --validate=false
I still do not understand how entryPoints are configured in IngressRouteTCP. If I can't use a host name (using HostSNI('*')) and can't provide a port in entryPoint, how traefik controller knows that it needs to handle these particular requests? It is very vague to me.
I can't use - kind: Rule it throws the error also.
the rancher k3s documentation recommends to use treafik-config.yaml and not treafik-override.yaml.
This seems to be the standard method for helm installs. k3s merges traefik.yaml and traefik-config.yaml on any start/restart of k3s and watchdog this directory for changes as well . (acts more or less like a treafik provider). Later changes on traefik-config.yaml are recognized and applied dynamicly out of the box by k3s.
I assume you are using a single k3s master, not a HA setup.
Try this treafik-config.yaml and put it to /var/lib/rancher/k3s/server/manifests/