Skip to main content

TLS Certificates Store

In Traefik Hub API Gateway, certificates are grouped together in certificates stores.

Traefik Only Uses the Default TLSStore

Traefik Hub always looks for one TLSStore named default. That store must live in a namespace that Traefik Hub can see. Because every IngressRoute and IngressRouteTCP automatically use this store, you never have to reference it in your manifests.

  • You cannot create another TLSStore named default in a different namespace.
  • The only TLSStore setting that usually matters is customizing that single default store (if you need different certificates or options). All other names or duplicate default stores are ignored.

Configuration Example

apiVersion: traefik.io/v1alpha1
kind: TLSStore
metadata:
name: default # Only the store with the name default is taken into account
namespace: traefik
spec:
certificates:
- secretName: secret-tls-01
- secretName: secret-tls-02
defaultGeneratedCert:
# Use the certificate resolver myresolver (defined in the static configuration) to generate the default certificate
resolver: myresolver
domain:
main: whoami-default.localhost
sans:
- \*.whoami-default.localhost

Configuration Options

FieldDescriptionDefaultRequired
nameName of the TLS Store. Only the default store name is taken into account yet.True
certificatesList of Kubernetes Secrets, each of them holding a key/certificate pair to add to the store. List item format: secretName: $secret_nameFalse
defaultCertificate.secretNameKubernetes Secret served for connections without a SNI, or without a matching domain.
If no default certificate is provided, Traefik will use the generated one.
Do not use if the option defaultGeneratedCert is set.
False
defaultGeneratedCert.resolverName of the ACME resolver to use to generate the default certificate.
Do not use if the option defaultCertificate is set.
False
defaultGeneratedCert.domain.mainMain domain used to generate the default certificate.
Do not use if the option defaultCertificate is set.
False
defaultGeneratedCert.domain.sansList of Subject Alternative Name used to generate the default certificate.
Do not use if the option defaultCertificate is set.
False
DefaultCertificate vs DefaultGeneratedCert

If both defaultCertificate and defaultGeneratedCert are set, the TLS certificate contained in defaultCertificate.secretName is served. The ACME default certificate is not generated.