Skip to content
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

Add reference grant to support httprouting for different namespace #347

Merged
merged 9 commits into from
Nov 11, 2024

Conversation

varungup90
Copy link
Collaborator

@varungup90 varungup90 commented Oct 31, 2024

Add support for cross-namespace routing: #336

}

func (m *ModelRouter) createReferenceGrant(name, namespace string) {
referenceGrant := gatewayv1beta1.ReferenceGrant{
Copy link
Collaborator

Choose a reason for hiding this comment

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

a quick question, if we set namespace here, do we still need reference grant object?
image

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

httproute will be created in aibrix namespace where gateway class is that where httproute object needs to. Service backend ref is in different namespace, hence the need to create reference grant.

Copy link
Collaborator

Choose a reason for hiding this comment

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

em. httproute has to be created in aibrix-system? we did create it in separate namespace right?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

previously I was using deployment namespace for httproute but all the local testing was based on the deployment in the aibrix-system. httproute need to be in namespace as gateway class to be accepted.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I point was If we add a namespace reference in gateway, it is supposed to work, right? I did workaround in downstream. can you check it? We should separate the control plane and data plane.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

For httproute to be accepted, there are two conditions. 1) httproute and gateway need to be in same namespace and 2) is httproute and backend service are in different namespace then a reference grant is needed.

Error if httproute and gateway are in different namespace.
img_v3_02ge_c66c95f9-964a-4042-9491-368323d5415h

Error if httproute and backend service are in different namespace and no reference grant is present.
img_v3_02ge_7632dbb8-8b1a-4601-801c-1e368eabd53h

@Jeffwan Jeffwan merged commit 8364605 into main Nov 11, 2024
9 checks passed
@Jeffwan Jeffwan deleted the add-reference-grant branch November 11, 2024 19:21
gangmuk pushed a commit that referenced this pull request Jan 25, 2025
)

* Add reference grant to support httprouting for different namespace

* lint fix

* create reference grant per namespace

* refactor validate routing strategy

* undo nit comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants