/area networking
Currently every time when creating a new Route/Knative Service, a new TLS certificate needs to be requested because the TLS certificate only supports the hosts of the Route. This is not efficient:
As cert-manager can also issue wildcard certificate, it would be very nice to support wildcard certificates within Knative and reuse wildcard certificates across the Routes in a whole namespace or even the whole cluster.
A separate controller could be built. It watches Namespace and requests wildcard certificate with the DNS Name format defined in config-network ConfigMap.
For example, for a DomainTemplate "{{.Name}}.{{.Namespace}}.{{.Domain}}", it could request a wildcard cert with DNS name *.{{.Namespace}}.{{.Domain}}.
If users define some specific format for DomainTemplate, e.g. {{.Name}}-{{.Namespace}}.{{.Domain}}, the wildcard certificate (*.{{.Domain}}) could be even shared within the whole cluster.
TLS certificates could be requested by reconciling Knative Certificate object.
We need to check the format of DomainTemplate as not every format works with this solution. Theoretically, the DomainTemplate could be arbitrary format, e.g. "{{.Namespace}}.{{.Name}}.{{.Domain}}". In this case, the namespace-level wildcard cert has no meaning as every time when a Route is created, a new cert is still needed.
We also need to provide a knob to whitelist namespaces. And we probably don't need to request certs for some system namespaces (e.g. kube-system).
/cc @mattmoor @tcnghia @greghaynes
Forgot to mention another related work item:
After we support wildcard certificate, Route controller should look for the wildcard certificate first, and fall back to the Route-level certificate if there is no available wildcard cert.
thanks for writing this up! I think @rmoe would like to take this on
Most helpful comment
thanks for writing this up! I think @rmoe would like to take this on