Traefik v2.0: Help setting up TCP w/TLS for MySQL

Is anyone able to help guide me or point me in the direction of a tutorial that demonstrates how set up traefik so that I am able to use a different domain for each mysql instance. As I understand it, in order to use a rule that defines a specific hostname for my mysql container it needs to have TLS enabled. I have given the official mysql image the following labels:

- "traefik.tcp.routers.mysql.rule=HostSNI(`mysql.local`)"
- "traefik.tcp.routers.mysql.entrypoints=mysql"
- "traefik.tcp.routers.mysql.tls=true"

But I'm unsure of how to actually tell mysql about the key and certificate? Any help would be much appreciated.

1 Like

It would be nice to see mysql example, I'm currently trying to do a setup with postgresql, still without success.
btw you can find mongo examples here https://github.com/containous/slides/tree/master/demo/traefik-v2

I tried it a while back with no luck, in the end I set up using STunnel.

Just tried to do this again with 2.2 failed still Creating a TCP Router for Docker Swarm kind of annoying since they alluded to this in their 2.0 announcement https://containo.us/blog/traefik-2-0-6531ec5196c2/

Do you have some code for STunnel+mysql?