From 50bb69b7968c26228694eef48cd629bda0b3de70 Mon Sep 17 00:00:00 2001 From: Daniel Tomcej Date: Mon, 9 Dec 2019 03:16:05 -0600 Subject: [PATCH] Document LE caveats with Kubernetes on v2 --- docs/content/https/acme.md | 7 +++++++ docs/content/providers/kubernetes-crd.md | 17 +++++++++++++++++ docs/content/providers/kubernetes-ingress.md | 14 ++++++++++++++ 3 files changed, 38 insertions(+) diff --git a/docs/content/https/acme.md b/docs/content/https/acme.md index d23cf4317..9b86ce7b8 100644 --- a/docs/content/https/acme.md +++ b/docs/content/https/acme.md @@ -84,6 +84,13 @@ If there are less than 30 days remaining before the certificate expires, Traefik !!! info "" Certificates that are no longer used may still be renewed, as Traefik does not currently check if the certificate is being used before renewing. +## Using LetsEncrypt with Kubernetes + +When using LetsEncrypt with kubernetes, there are some known caveats with both the [ingress](../providers/kubernetes-ingress.md) and [crd](../providers/kubernetes-crd.md) providers. + +!!! info "" + If you intend to run multiple instances of Traefik with LetsEncrypt, please ensure you read the sections on those provider pages. + ## The Different ACME Challenges !!! important "Defining a certificates resolver does not result in all routers automatically using it. Each router that is supposed to use the resolver must [reference](../routing/routers/index.md#certresolver) it." diff --git a/docs/content/providers/kubernetes-crd.md b/docs/content/providers/kubernetes-crd.md index c992d3164..8305b2705 100644 --- a/docs/content/providers/kubernetes-crd.md +++ b/docs/content/providers/kubernetes-crd.md @@ -12,6 +12,23 @@ we ended up writing a [Custom Resource Definition](https://kubernetes.io/docs/co See the dedicated section in [routing](../routing/providers/kubernetes-crd.md). +## LetsEncrypt Support with the Custom Resource Definition Provider + +By design, Traefik is a stateless application, meaning that it only derives its configuration from the environment it runs in, without additional configuration. +For this reason, users can run multiple instances of Traefik at the same time to achieve HA, as is a common pattern in the kubernetes ecosystem. + +When using a single instance of Traefik with LetsEncrypt, no issues should be encountered, however this could be a single point of failure. +Unfortunately, it is not possible to run multiple instances of Traefik 2.0 with LetsEncrypt enabled, because there is no way to ensure that the correct instance of Traefik will receive the challenge request, and subsequent responses. +Previous versions of Traefik used a [KV store](https://docs.traefik.io/v1.7/configuration/acme/#storage) to attempt to achieve this, but due to sub-optimal performance was dropped as a feature in 2.0. + +If you require LetsEncrypt with HA in a kubernetes environment, we recommend using [TraefikEE](https://containo.us/traefikee/) where distributed LetsEncrypt is a supported feature. + +If you are wanting to continue to run Traefik Community Edition, LetsEncrypt HA can be achieved by using a Certificate Controller such as [Cert-Manager](https://docs.cert-manager.io/en/latest/index.html). +When using Cert-Manager to manage certificates, it will create secrets in your namespaces that can be referenced as TLS secrets in your [ingress objects](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls). +When using the Traefik Kubernetes CRD Provider, unfortunately Cert-Manager cannot interface directly with the CRDs _yet_, but this is being worked on by our team. +A workaround it to enable the [Kubernetes Ingress provider](./kubernetes-ingress.md) to allow Cert-Manager to create ingress objects to complete the challenges. +Please note that this still requires manual intervention to create the certificates through Cert-Manager, but once created, Cert-Manager will keep the certificate renewed. + ## Provider Configuration ### `endpoint` diff --git a/docs/content/providers/kubernetes-ingress.md b/docs/content/providers/kubernetes-ingress.md index 95aeeeda3..2a269863a 100644 --- a/docs/content/providers/kubernetes-ingress.md +++ b/docs/content/providers/kubernetes-ingress.md @@ -47,6 +47,20 @@ spec: servicePort: 80 ``` +## LetsEncrypt Support with the Ingress Provider + +By design, Traefik is a stateless application, meaning that it only derives its configuration from the environment it runs in, without additional configuration. +For this reason, users can run multiple instances of Traefik at the same time to achieve HA, as is a common pattern in the kubernetes ecosystem. + +When using a single instance of Traefik with LetsEncrypt, no issues should be encountered, however this could be a single point of failure. +Unfortunately, it is not possible to run multiple instances of Traefik 2.0 with LetsEncrypt enabled, because there is no way to ensure that the correct instance of Traefik will receive the challenge request, and subsequent responses. +Previous versions of Traefik used a [KV store](https://docs.traefik.io/v1.7/configuration/acme/#storage) to attempt to achieve this, but due to sub-optimal performance was dropped as a feature in 2.0. + +If you require LetsEncrypt with HA in a kubernetes environment, we recommend using [TraefikEE](https://containo.us/traefikee/) where distributed LetsEncrypt is a supported feature. + +If you are wanting to continue to run Traefik Community Edition, LetsEncrypt HA can be achieved by using a Certificate Controller such as [Cert-Manager](https://docs.cert-manager.io/en/latest/index.html). +When using Cert-Manager to manage certificates, it will create secrets in your namespaces that can be referenced as TLS secrets in your [ingress objects](https://kubernetes.io/docs/concepts/services-networking/ingress/#tls). + ## Provider Configuration ### `endpoint`