Skip to content

Conversation

@davidjumani
Copy link

What type of PR is this?
Add one of the following kinds:
/kind gep

What this PR does / why we need it:
Updates the status of the Gateway to include AttachedListeners which is the count of successful ListenerSet attachments to the gateway. Ref: slack thread

Does this PR introduce a user-facing change?:

Adds the `AttachedListeners` conditions to the Gateway status which is the count of successful ListenerSet attachments to the gateway

@k8s-ci-robot k8s-ci-robot added kind/gep PRs related to Gateway Enhancement Proposal(GEP) release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Oct 30, 2025
@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 30, 2025
@davidjumani davidjumani changed the title Update gateway status to include AttachedListeners api: Update gateway status to include AttachedListeners Oct 30, 2025
Copy link
Contributor

@howardjohn howardjohn left a comment

Choose a reason for hiding this comment

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

I am going to take a contrarian point of view here and say maybe we shouldn't add this. AttachedRoutes, IMO, is an extremely high-cost status field to update with extremely little value.

Our implementation spends like 20% of its CPU calculating AttachedRoutes...

If we do decide to add it though, the PR itself LGTM

@rikatz
Copy link
Member

rikatz commented Nov 3, 2025

@howardjohn regardless of the implementation detail (which I see your point and agree about the performance caveat), I am wondering that we need a way to let the Gateway owner know that there are some ListenerSets attached to the Gateway.

Do you suggest some different approach for it?

@howardjohn
Copy link
Contributor

A ListenersAttached: bool instead of int is one approach that maybe could be acceptable tradeoff.

FWIW the implementation detail is not specific to any implementation, it necessarily at least doubles the number of status writes to the API server on a route creation/deletion.

@rikatz
Copy link
Member

rikatz commented Nov 3, 2025

ok, seems reasonable.

@robscott @youngnick for some comments, we can change for a boolean instead. I think it is important for an admin at least to know something is attached to the gateway

@davidjumani
Copy link
Author

davidjumani commented Nov 4, 2025

A ListenersAttached: bool instead of int is one approach that maybe could be acceptable tradeoff.

Thanks @howardjohn - The AttachedListenerSets status condition should suffice if this is the case

@youngnick
Copy link
Contributor

I'm sorry, but the fact that implementing something can be difficult for one implementation doesn't decrease the utility of the integer field for me.

I disagree that attachedRoutes is a low-utility field, having the number there is much closer to what would be the most useful (having a list of all the routes), while still being less loaded on the apiserver than a full list.

I am happy with the integer as it currently stands.

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: davidjumani, youngnick

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 10, 2025
@howardjohn
Copy link
Contributor

It's not "difficult for 1 implementation". It's expensive for all implementations. There is no possibile way to avoid an explosion of writes as each route triggers a listenerset write

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/gep PRs related to Gateway Enhancement Proposal(GEP) release-note Denotes a PR that will be considered when it comes time to generate release notes. 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.

5 participants