Replies: 1 comment
-
|
We should probably have something in our docs too, but here's the relevant envoy docs that describe the logic for multiple certs on the same gateway listener (in TLS listener becomes a filter-chain in envoy): This is the TL;DR:
If there are multiple listeners - I believe the filtering the SNI using the listener hostname happens first, and then the certificate selection logic described above. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Background
An interesting use case was discussed on the sig-network-gateway-api channel on Kubernetes Slack of configuring single
Gatewaywith single HTTPS listener, but multiple non-wildcard TLS certificates attached:and
HTTPRoute-s for every hostname:Since the https://gateway-api.sigs.k8s.io/geps/gep-851/ replaced
CertificateRefwithCertificateRefsto allow multiple certificates, such configuration is valid according to the Gateway API 1.4 specification.However, https://gateway-api.sigs.k8s.io/reference/1.4/spec/#listenertlsconfig makes it clear
certificateRefssupport for multiple certificates is implementation-specific, quoting:Does kgateway support multiple certificates?
In general case, yes. Since, I think, merge of #12895 the kgateway features:
and there is also this foot note in that PR:
In a specific case, I think, there is room for clarification.
First, I found that multiple certificates support is documented in https://kgateway.dev/docs/envoy/latest/setup/listeners/sni/
But, it 1) discusses a different use case than the one I copied from the Kubernetes Slack above 2) may be confusing, I think, because it says "Serve multiple hosts on the same HTTPS listener" but the
Gatewayconfiguration there clearly presents multiple (two) listeners. Why the document repeats "the same listener" wording? Because internally it merges the configuration into one listener what effectively expose the gateway via single IP?I think it is may be worth to list possible use cases and clarify their support in kgateway:
Gateway:a) single TLS certificate in single secret, then single or multiple secrets listed in
certificateRefsb) multiple TLS certificates in single secret, then single secret listed in
certificateRefsGateway:a) single certificate in single secret listed in
certificateRefsper single listenerb) multiple certificates per listener, complex case of the 1. above.
where each "TLS certificate" above can be:
Are there any limitations of what kinds of certificates can be attached?
Outcome of this discussion may make it easier to decide on improvements of the documentation and the tests too.
Beta Was this translation helpful? Give feedback.
All reactions