Skip to content

Conversation

@snorwin
Copy link
Member

@snorwin snorwin commented Oct 17, 2025

What type of PR is this?

/kind gep

What this PR does / why we need it:
In the current version of GEP-91, the semantics of an invalid CACertificateRefs are not fully specified. In addition, it is unclear whether the InsecureFrontendValidationMode condition should ever be removed or set to False.

This PR clarifies the expected behavior by aligning the semantics of invalid references in frontend validation with the patterns already established in BackendTLSPolicy and the approach proposed in #4123 for backend TLS configuration on the Gateway.

Which issue(s) this PR fixes:

N/A

Does this PR introduce a user-facing change?:

NONE

Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. kind/gep PRs related to Gateway Enhancement Proposal(GEP) cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Oct 17, 2025
@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 17, 2025
@snorwin
Copy link
Member Author

snorwin commented Oct 17, 2025

/cc @kl52752 @rikatz

@snorwin
Copy link
Member Author

snorwin commented Oct 17, 2025

/retest

Signed-off-by: Norwin Schnyder <norwin.schnyder+github@gmail.com>
@snorwin snorwin requested a review from kl52752 October 24, 2025 08:16
@snorwin snorwin requested a review from rikatz October 31, 2025 14:30
Copy link
Contributor

@kl52752 kl52752 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Thanks for the PR :)

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kl52752, snorwin
Once this PR has been reviewed and has the lgtm label, please assign shaneutt for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@snorwin
Copy link
Member Author

snorwin commented Nov 18, 2025

/assign @shaneutt

This condition is removed as soon as `FrontendValidationModeType` is changed back to `AllowValidOnly`.

* Introduce a `ObjectReference` structure that can be used to specify `caCertificateRefs` references.
* Invalid `caCertificateRefs` directly affect the `ResolvedRefs` and `Accepted` conditions of the targeted listeners.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +164 to +165
// Reason must be set to `InvalidCACertificateRef` and the Message of
// the Condition must indicate which reference is invalid and why.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +172 to +176
// * It refers to a resource in another namespace UNLESS there is a
// ReferenceGrant in the target namespace that allows the CA
// certificate to be attached. If a ReferenceGrant does not allow this
// reference, the `ResolvedRefs` condition MUST be set with
// the Reason `RefNotPermitted`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Comment on lines +189 to +190
// Implementations MAY choose to support attaching multiple CA certificates
// to a listener, but this behavior is implementation-specific.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤔 can we talk through this one a bit more?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this duplicates the intent of the following:

	// Support: Implementation-specific - More than one reference, other kinds
	// of resources, or a single reference that includes multiple certificates.

It was inspired by the description of the CACertificateRefs in the BackendTLSPolicy:
https://github.com/kubernetes-sigs/gateway-api/blob/main/apis/v1/backendtlspolicy_types.go#L164-L165

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you walk through some scenarios where this is going to be needed, and share your experience and thoughts on why the behavior is "implementation-specific" and is not standardizable?

Copy link
Contributor

@kl52752 kl52752 Nov 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that multiple references is a common case for rotating the certificates. User might want to attach a new CA cert to gateway and be in the state where gateway will check both CA certificates to ensure smooth transition to a new certificate for all clients. Then old CA certificate will be deleted. We can achieve that with a new ConfigMap but having multiple certificates in one map is convenient

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there are use cases where clients connect from different environments and therefore rely on different identity providers (CAs) to sign their client certificates. To support this, we need the ability to configure multiple CACertificateRefs.

The second question is whether this should be implementation-specific. During the refinement of the BackendTLSPolicy, we weren’t able to find a common approach that worked for all. To keep things flexible, we defined only a single CA certificate bundle (specified as ConfigMap) as "Core" and left anything beyond that to implementations. For consistency, I followed the same approach here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/gep PRs related to Gateway Enhancement Proposal(GEP) release-note-none Denotes a PR that doesn't merit a release note. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants