Terminate TLS at an external ingress or proxy
This is a How-to for operators.
Introduction​
By default Epinio manages TLS itself.
It creates a cert-manager Certificate for its own hosts and for every application route,
and each Ingress references the resulting secret in its tls: block.
Some clusters already terminate TLS somewhere else,
for example a Traefik instance that serves a trusted wildcard *.<domain> certificate as its default.
In that setup the Epinio-managed certificates get in the way:
the ingress controller serves them instead of the trusted wildcard.
Setting ingress.tls.enabled to false hands TLS to the external edge.
Disable Epinio-managed TLS​
Set the value when installing or upgrading Epinio:
helm upgrade --install epinio epinio/epinio \
--namespace epinio \
--set global.domain=<your-domain> \
--set ingress.tls.enabled=false
Or in a values file:
ingress:
tls:
enabled: false
The default is true, which keeps today's behavior.
What changes​
The Ingress resources are still created and routing is unchanged.
Only the TLS parts are left out.
| Resource | ingress.tls.enabled: true (default) | ingress.tls.enabled: false |
|---|---|---|
Epinio API, UI and Dex Ingress | tls: block with an Epinio-managed secret | No tls: block, no cert-manager issuer annotation |
Application route Certificate | Created for each route | Not created |
Application route Ingress | tls: block with the route's secret | No tls: block |
| Gateway API application chart | HTTPS listener when httpsRedirect is set | HTTP listener only, httpsRedirect is ignored |
| Routing secrets | Used for matching routes | Not used |
Without a tls: block the ingress controller presents its own default certificate.
The Traefik annotations router.entrypoints: websecure and router.tls: "true" stay in place,
so Traefik still serves those hosts over HTTPS with its default certificate.
The internal certificates are unaffected.
The registry and Dex certificates are still issued from the epinio-ca PKI,
so components that mount them, such as epinio-server, keep working.
Application routes follow this setting from Epinio 1.14.4,
with the application charts epinio-application 0.1.27,
epinio-application-gateway-api 0.1.27 and epinio-application-stateful 0.1.25.
Earlier versions apply the setting to Epinio's own hosts only.
Existing applications​
Changing the value doesn't touch applications that are already running.
Each application picks up the change the next time it's deployed, for example with epinio push.
When that deployment also moves the application to a newer chart version, the pods restart, because the chart version is part of their labels.
Turning TLS off removes the route Certificate resources on the next deployment.
cert-manager doesn't delete the secrets those certificates created,
so you can remove them by hand once nothing references them.
Custom application charts​
Epinio passes the setting to application charts as epinio.tls.
A custom application chart has to read it
to skip its own Certificate and tls: block.
A chart that ignores epinio.tls keeps creating certificates.
Treat a missing value as true, the way the built-in charts do:
{{- if ne $.Values.epinio.tls false }}
tls:
...
{{- end }}
Check the result​
After pushing an application, confirm that no Certificate exists for it
and that its Ingress has no tls: block:
kubectl get certificates --namespace <workspace>
kubectl get ingress --namespace <workspace> \
--output jsonpath='{range .items[*]}{.metadata.name}{" tls="}{.spec.tls}{"\n"}{end}'
Then open the application URL in a browser and check that the certificate presented is the edge's.