-
Notifications
You must be signed in to change notification settings - Fork 593
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement Gateway certificateRef #2474
Comments
This one doesn't seem as possible to fudge with managed gateways as AllowedRoutes. You could add scan the listeners and fill in certificates during Gateway reconciliation, but as the comments note, there are some problems with this:
More briefly, loading additional certificates is not compatible with replacing listeners entirely. There are a few approaches I think we could take here:
@shaneutt re the 3rd option what complications do you know of from the initial Gateway implementation re trying to support (mostly) user-provided Gateway configurations? Should we be okay so long as we're able to dictate the port used? I don't think we'd be able to ensure that a Listen exists for every kong.conf listen, but I'm kinda okay with that, since it's probably a one-off for most people to put at least one Listen in place for everything they've configured elsewhere. |
To my understanding the only user-provided Gateway configurations we support are the |
The Kong certificates are a combination of the certificate (the actual PEM cert and key) and SNIs (the hostnames where we'll serve them). Certificates alone aren't of much use. In the Gateway context, you can only provide a single Hostname (SNI) per Listen, so if we only have, say, 4 Listens, you can't use more than 4 certificates, and realistically we'd use none because our generated Listens have no Hostnames. We can accomodate this with a single Gateway, it just needs to have one Listen for every certificate+SNI pair. This is option 3, and it entails wiping out most of the code we use to generate listeners from Kong's environment. We'd presumably still use some environment information to override user-provided ports. A Listen TLSConfig can include multiple certificates, but the stated purpose of this is to provide an alternate certificate for a hostname, e.g. you want to provide both RSA and ECDSA certificates. It's not intended to provide one certificate for |
Per discussion with @scseanchow we plan to defer and implement option 3 after the next release, unless I happen to get it done faster than expected. |
So for
I have a draft at #2555. This does not do certificate anything yet, just the refactor above. There are a number of changes and questions of note here:
|
It's interesting you bring this up, because I've been considering something similar for the Gateway Operator. As it turns out, I think the main reason for this status currently is so that the |
Unlike Ingress, certificates for Gateway API Routes are loaded via Gateway configuration, not configuration on individual routes. Our current Gateway implementation does not handle the CertificateRefs field and we do not load certificates for Gateway API Routes.
The spec only provides references to TLS Secrets, which do not include any dedicated field we can populate Kong SNIs from. We need to either:
These are compatible with one another. The annotation can serve as an override. I recommend just using all hostnames pending demand for the ability to omit some hostnames that a certificate is valid for or serve it for additional hostnames that it is not valid for. I do not expect any common use case to require changing the set of matched hostnames.
The text was updated successfully, but these errors were encountered: