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

@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
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 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

@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

//
// * It refers to a resource that cannot be resolved (e.g., the
// referenced resource does not exist) or is misconfigured (e.g., a
// ConfigMap does not contain a key named `ca.crt`). In this case, the
Copy link
Contributor

Choose a reason for hiding this comment

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

In the improvement proposal for the backend TLS configuration #4123 you included a section about further validation of the referenced certificate, that should be implementation specific:

  // Implementations MAY choose to perform further validation of the certificate
  // content (e.g., checking expiry or enforcing specific formats). In such cases,
  // an implementation-specific Reason and Message MUST be set.

Should we include a similar section for the CA certificate content (e.g., non-empty, at least one valid PEM-encoded TLS CA certificate bundle, ...)? or should this validation be required?

Copy link
Contributor

Choose a reason for hiding this comment

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

there is an implementation specific behaviour that ConfigMap can contains 'More than one certificate in a ConfigMap with different keys or more than one reference, or other kinds of resources'. Can you include that?

This condition remains set to `True` even if `FrontendValidationModeType` is later 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
Contributor

@root30 root30 Oct 17, 2025

Choose a reason for hiding this comment

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

Should we also discuss and specify how the Accepted and Programmed Condition of the Gateway are affected

Accepted:

  • if at least one listener is valid
  • all listeners are invalid
  • ...

Programmed:

  • e.g. no Listeners can be programmed due to validation issues (e.g., Mode = AllowValidOnly everywhere and all CA certificates are invalid).
  • ...

Copy link
Member Author

@snorwin snorwin Oct 17, 2025

Choose a reason for hiding this comment

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

The semantics describing how invalid listeners affect gateway's Accepted condition with the reason ListenersNotValid (https://github.com/kubernetes-sigs/gateway-api/blob/main/apis/v1/gateway_types.go#L1203) are already defined. Therefore, I omitted the indirect influence on the Gateway status here.

The Programmed condition may be affected if the data plane rejects the configuration, e.g., due to an invalid CA certificate. However, such behavior depends on implementation-specific validations performed by the data plane.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a listener name or direct reference in this condition?


* 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.
A listener is considered targeted if and only if it is serving HTTPS and either its port matches the port of the
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you split this entry to default and per port? There are 2 distinct fields and it will be easier to explain which Listeners are impacted

This condition remains set to `True` even if `FrontendValidationModeType` is later 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
Contributor

Choose a reason for hiding this comment

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

Is there a listener name or direct reference in this condition?

//
// * It refers to a resource that cannot be resolved (e.g., the
// referenced resource does not exist) or is misconfigured (e.g., a
// ConfigMap does not contain a key named `ca.crt`). In this case, the
Copy link
Contributor

Choose a reason for hiding this comment

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

there is an implementation specific behaviour that ConfigMap can contains 'More than one certificate in a ConfigMap with different keys or more than one reference, or other kinds of resources'. Can you include that?

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.

4 participants