Now I am using HostSNI(
*)
to mapping the TCP service like mysql\postgresql...
in traefik 2.2.1 in Kubernetes cluster v1.18 . beacuse I am in my local machine and did not have a valid certification. This is the config:
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRouteTCP
metadata:
name: mysql-ingress-tcp-route
namespace: middleware
spec:
entryPoints:
- mysql
routes:
- match: HostSNI(`*`)
services:
- name: report-mysqlha
port: 3306
is config works fine in my local machine. But I still want to know the side effect to using
HostSNI(
)
mapping stratege. What is the disadvantege to using HostSNI(
)
not a domain name? Is it possible to using a fake domain name in my local machine?
As of the latest Traefik docs (2.4 at this time):
If both HTTP routers and TCP routers listen to the same entry points, the TCP routers will apply before the HTTP routers
It is important to note that the Server Name Indication is an extension of the TLS protocol. Hence, only TLS routers will be able to specify a domain name with that rule. However, non-TLS routers will have to explicitly use that rule with * (every domain) to state that every non-TLS request will be handled by the router.
Therefore, to answer your questions:
HostSNI(`*`)
is the only reasonable way to use an ingressRouteTCP
without tls -- since you're explicitly asking for a TCP router and TCP doesn't speak TLS.
ingressRouteTCP
and HostSNI(`some.fqdn.here`)
with a tls:
section, but it does appear to be a supported configuration as per 2entrypoint
(i.e. mysql
) will be routed via this ingressRouteTCP
ingressRoute
with the same entrypoint
, the ingressRouteTCP
would take precedence as per 1mysql
services via the same entrypoint: mysql
, you wouldn't be able to based on this configuration