Skip to content

TLS certificates

cert-manager issues Let’s Encrypt certificates (90 days, renewed 30 days before expiry). Every CertificateRequest must be approved by a policy, and RCS enables certificates per tenant, in two separate parts:

NamesIssuerEnablement
<tenant>.kestrel.arbutus.cloud, *.<tenant>.kestrel.arbutus.cloudClusterIssuers letsencrypt-prod and letsencrypt-stagingPlatform certificates
Any other domainYour own Issuer in your namespaceCustom-domain certificates: ask RCS before you create the Issuer

Without the matching enablement, requests are never approved (see Troubleshooting). Open a ticket to enable either. Keys must be RSA, 2048 bits or more; ECDSA is denied.

Add the annotation and a tls block to the Ingress (complete example):

metadata:
annotations:
cert-manager.io/cluster-issuer: letsencrypt-prod
traefik.ingress.kubernetes.io/router.entrypoints: websecure
traefik.ingress.kubernetes.io/router.tls: "true"
spec:
tls:
- hosts:
- myapp.<tenant>.kestrel.arbutus.cloud
secretName: myapp-tls # created by cert-manager
  • The ClusterIssuers validate with ACME DNS01 against RCS’s own DNS, so a certificate can be READY: True before the hostname resolves. The DNS record, requested by ticket, makes the site reachable; it doesn’t affect the certificate. See Ingress: tenant hostnames and DNS.
  • Let’s Encrypt allows 50 certificates per registered domain per week. For tenant hostnames that domain is arbutus.cloud, shared by every Kestrel tenant and other RCS clusters, so use letsencrypt-staging while testing. Browsers don’t trust staging certificates.
  • For a wildcard (*.<tenant>.kestrel.arbutus.cloud), create a Certificate with issuerRef: {kind: ClusterIssuer, name: letsencrypt-prod}. Wildcard Ingress hosts are still rejected, so list concrete hosts on each Ingress and reuse the Secret.

Before you start:

  • RCS has enabled custom-domain certificates for your tenant.
  • For HTTP01, the hostname is a CNAME to kestrel.arbutus.cloud. See Ingress: custom domains.

Create an Issuer in each namespace that needs one, then replace the Ingress’s cert-manager.io/cluster-issuer annotation with cert-manager.io/issuer: <issuer-name>. While testing, set server to https://acme-staging-v02.api.letsencrypt.org/directory.

Needs no DNS credentials, only the CNAME. It can’t issue wildcard certificates.

apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-http01
namespace: <tenant>-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: you@example.com # Let's Encrypt expiry notices
privateKeySecretRef:
name: letsencrypt-http01-account-key # created by cert-manager
solvers:
- http01:
ingress:
ingressClassName: traefik
serviceType: ClusterIP # required: the default NodePort solver Service is denied by Capsule

Use DNS01 only for wildcard certificates or names you can’t point at Kestrel. You supply API credentials for the provider that hosts your zone; Kestrel provides none for custom domains. See cert-manager’s DNS01 providers. This example uses Cloudflare; other providers differ only in the solver block and the Secret. The Cloudflare token needs Zone: Read and DNS: Edit on your zone:

Terminal window
kubectl create secret generic cloudflare-api-token -n <tenant>-prod --from-literal=api-token=<token>
apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: letsencrypt-dns01
namespace: <tenant>-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: you@example.com
privateKeySecretRef:
name: letsencrypt-dns01-account-key
solvers:
- dns01:
cloudflare:
apiTokenSecretRef:
name: cloudflare-api-token
key: api-token

To manage the token in Git, seal it as a SealedSecret.

Create a Certificate directly for a wildcard, or for one Secret shared by several Ingresses in a namespace. Reference its secretName in each Ingress’s tls block and leave the cert-manager annotation off those Ingresses.

apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: example-com
namespace: <tenant>-prod
spec:
secretName: example-com-tls
issuerRef:
kind: Issuer
name: letsencrypt-dns01 # wildcards need DNS01
privateKey:
algorithm: RSA # ECDSA is denied
size: 2048
dnsNames:
- example.com
- "*.example.com"

You can read Certificates, CertificateRequests, Orders and Challenges in your namespaces. Each symptom below comes from one step of issuance:

flowchart LR
  ing["Ingress or Certificate"] --> cr["CertificateRequest"]
  cr --> ap{"approver-policy"}
  ap -- "no policy for your tenant or Issuer" --> none["APPROVED and DENIED empty"]
  ap -- "name, commonName, key or usage not allowed" --> den["DENIED: True"]
  ap -- "approved" --> acme["ACME challenge"]
  acme --> ready["Secret written, READY: True"]
  ready -. "DNS record" .-> site["Site reachable"]

Check the CertificateRequest’s APPROVED column first:

Terminal window
kubectl get certificate,certificaterequest -n <namespace>
kubectl describe certificaterequest <name> -n <namespace>
kubectl describe challenge -n <namespace>
SymptomCauseFix
APPROVED and DENIED both emptyCertificates not enabled for your tenant, or not for your own IssuersAsk RCS to enable platform certificates, custom-domain certificates, or both
DENIED: TrueName not under <tenant>.kestrel.arbutus.cloud (platform issuers), a commonName other than <tenant>.kestrel.arbutus.cloud, key not RSA ≥ 2048, or a non-server usage such as client authFix dnsNames / tls.hosts or privateKey, and drop commonName (or the cert-manager.io/common-name annotation); use your own Issuer for other domains
READY: True, but the hostname doesn’t resolveNo DNS recordRequest the record, or fix your custom domain’s CNAME
HTTP01 Challenge stays pendingHostname doesn’t resolve to kestrel.arbutus.cloud, or describe challenge shows NodePort service types are forbidden for the tenantFix the CNAME; set serviceType: ClusterIP on the solver
DNS01 Challenge stays pendingTXT record not created or not yet visible: bad credentials, wrong Secret name or key, token not scoped to the zone, or propagation delayRead describe challenge and fix the credentials Secret; cert-manager retries
Order fails with a 429 mentioning too many certificatesLet’s Encrypt rate limitWait out the weekly window; test with staging
Browser warning showing Traefik’s default certificateSecret missing, or tls.hosts doesn’t match the requested hostCheck the annotation spelling and that tls.hosts matches rules[].host