Hello,
I have a setup where I currently have a wildcard certificate that I manage manually (*.domain.com), and a wildcard for internal only services (*.home.arpa).
So I have a dynamic config file that looks like this :
tls:
certificates:
- certFile: "/etc/traefik/certs/wildcard.crt"
keyFile: "/etc/traefik/certs/wildcard.key"
- certFile: "/etc/letsencrypt/live/domain.com/fullchain.pem"
keyFile: "/etc/letsencrypt/live/domain.com/privkey.pem"
stores:
default:
defaultCertificate:
certFile: "/etc/traefik/certs/wildcard.crt"
keyFile: "/etc/traefik/certs/wildcard.key"
Now I want to switch to something more dynamic and with a single management being Traefik for all my external services (my internal wildcard is 10years, so I don't have an issue there).
I’ve configured the ACME resolver in my traefik config :
entryPoints:
web:
address: ":80"
http:
redirections:
entryPoint:
to: "websecure"
scheme: "https"
websecure:
address: ":443"
certificatesResolvers:
le:
acme:
email: superadmin@email.com
storage: acme.json
httpChallenge:
entryPoint: web
And when I tried to switch a docker container with the following labels :
labels:
- "traefik.enable=true"
- "traefik.http.routers.myrouter.rule=Host(`example.domain.com`)"
- "traefik.http.routers.myrouter.entrypoints=web,websecure"
- "traefik.http.routers.myrouter.tls=true"
- "traefik.http.routers.myrouter.tls.certresolver=le"
- "traefik.http.services.myrouter.loadbalancer.server.port=80"
Then I re-upped the container, config is applied :
docker inspect mycontainer| jq '.[].Config.Labels' | grep traefik
"traefik.enable": "true",
"traefik.http.routers.myrouter.entrypoints": "web,websecure",
"traefik.http.routers.myrouter.rule": "Host(`example.domain.com`)",
"traefik.http.routers.myrouter.tls": "true",
"traefik.http.routers.myrouter.tls.certresolver": "le",
"traefik.http.services.myrouter.loadbalancer.server.port": "80"
Yet when I inspect the website with a new browser, the used certificate is still the wildcard one.
Is there a way to keep using the wildcard one for containers I haven't migrated yet and use the certresolver at the same time?
Thank you for your help