Note
Current Release: 2.3.2
The Traefik CertManager manages the handling of certificates of Traefik IngressRoutes, this repository is a fork of the original traefik-certmanager which was created by Rob Kooper.
Cert Manager handles only default Kubernetes Ingress kind.
This manager provides the management so that the Cert Manager
can provide certicates for the Traefik IngressRoute kind.
See documentation @ gjrtimmer.github.io/traefik-certmanager
The following prerequisites must be met before the Traefik CertManager can be used.
See the Install documentation
See the Install documentation for how to install the Traefik CertManager and all prerequisites.
The Traefik CertManager comes with several nice features.
The Support for Legacy CRD (Traefik traefik.containo.us/v1alpha1) was created as a PR
by T. Andrew Manning into the upstream of this fork.
| EnvVar | Default | Notes |
|---|---|---|
| INGRESS_CLASS_FILTER | "" | Ingress Class to filter on, comma seperated, |
| ISSUER_NAME_DEFAULT | letsencrypt | Default ClusterIssuer |
| ISSUER_KIND_DEFAULT | ClusterIssuer | Default ClusterIssuer King |
| CERT_CLEANUP | false | Certificate Cleanup after removal of IngressRoute |
| PATCH_SECRETNAME | false | If there is not a secretName in the IngressRoute patch it by using the name |
| SUPPORT_LEGACY_CRDS | false | Support scanning for Traefik legacy CRDs traefik.containo.us/v1alpha1 |
This will filter the IngressRoutes the Traefik CertManager will process set by the annotation kubernetes.io/ingress.class on the IngressRoute.
The Traefik CertManager supports multiple annotations to be used within the IngressRoute.
| Annotation | Description |
|---|---|
| cert-manager.io/ignore | This will cause the IngressRoute to be skipped |
| kubernetes.io/ingress.class | Value checked against INGRESS_CLASS_FILTER to determine if we need to process it |
| cert-manager.io/cluster-issuer | Tell Traefik CertManager to use this ClusterIssuer |
| cert-manager.io/issuer | Use this issuer, used in combination with cert-manager.io/issuer-kind |
| cert-manager.io/issuer-kind | Use this issuer kind, user in combination with cert-manager.io/issuer |
Warning
Please note that the annotation cluster-issuer is mutualy exclusive with
cert-manager.io/cluster-issuerandcert-manager.io/issuer-kind.This means either use
cert-manager.io/cluster-issuerORcert-manager.io/issuer+cert-manager.io/issuer-kind
Next you install the ClusterIssuer using kubectl apply -f ./manifests/letsencrypt/le-cluster-issuer.yaml
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt
spec:
acme:
email: [email protected]
server: https://acme-v02.api.letsencrypt.org/directory
privateKeySecretRef:
name: lets-encrypt
solvers:
- http01:
ingress:
class: ""
When the Traefik CertManager is starting it will check all existing IngressRoutes. Then it will check if it must filter based on the IngressClass name and see if there is a certificate for them (only for those that have a secretName). Next it will watch the addition and/or deleting of IngressRoutes. If an IngressRoute is removed, it can (false by default) remove the certificate as well.
This is an example of a IngressRoute that will be picked up by this deployment,
if no INGRESS_CLASS_FILTER is set.
apiVersion: traefik.containo.us/v1alpha1
kind: IngressRoute
metadata:
name: traefik-dashboard
namespace: traefik
spec:
entryPoints:
- websecure
routes:
- match: Host(`traefik.example.com`)
kind: Rule
services:
- name: api@internal
kind: TraefikService
tls:
secretName: trafik.example
Say that you have an ClusterIssuer with the name k3s-apps-ca which provides a self-signed certificate
for your k3.local domain and want to configure it, you can simple add the required annotation to the
example above and change the Host.
metadata:
name: traefik-dashboard
namespace: traefik
annotations:
cert-manager.io/cluster-issuer: "k3s-apps-ca"
Content type
Image
Digest
sha256:3dbad8820…
Size
31.1 MB
Last updated
about 2 months ago
docker pull gjrtimmer/traefik-certmanager