Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Let's encrypt, Kubernetes and Traefik on GKE

I am trying to setup Traefik on Kubernetes with Let's Encrypt enabled. I managed yesterday to retrieve the first SSL certificated from Let's Encrypt but am a little bit stuck on how to store the SSL certificates.

I am able to create a Volume to store the Traefik certificates but that would mean that I am limited to a single replica (when having multiple replicas am I unable to retrieve a certificate since the validation goes wrong most of the times due to that the volume is not shared).

I read that Traefik is able to use something like Consul but I am wondering if I have to setup/run a complete Consul cluster to just store the fetched certificates etc.?

like image 374
Jeroen Rinzema Avatar asked Nov 06 '22 22:11

Jeroen Rinzema


1 Answers

You can store the certificate in a kubernetes secret and you reference to this secret in your ingress.

spec:
  tls:
  - secretName: testsecret

The secret has to be in same namespace the ingress is running in. See also https://docs.traefik.io/user-guide/kubernetes/#add-a-tls-certificate-to-the-ingress

like image 79
chriscross Avatar answered Nov 15 '22 09:11

chriscross