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

Feat/service import backend support #1705

Merged
merged 11 commits into from Aug 23, 2023

Conversation

tanujd11
Copy link
Member

What type of PR is this?

Feature

What this PR does / why we need it:
Adds serviceImport Backend for Routes.

Which issue(s) this PR fixes:

Fixes #9

@tanujd11 tanujd11 requested a review from a team as a code owner July 25, 2023 07:43
@tanujd11
Copy link
Member Author

Can someone re-trigger the CI? Looks like the upload to codecov broke in the run.

@arkodg
Copy link
Contributor

arkodg commented Jul 25, 2023

/retest

@arkodg
Copy link
Contributor

arkodg commented Jul 25, 2023

thanks for picking this feature up @tanujd11 ! would be great if this land in v0.6
quick q - isn't this feature blocked on #1494 which is adding EndpointSlice support ?

@codecov
Copy link

codecov bot commented Jul 25, 2023

Codecov Report

Merging #1705 (865aa0e) into main (3fbaa78) will decrease coverage by 0.18%.
The diff coverage is 63.07%.

@@            Coverage Diff             @@
##             main    #1705      +/-   ##
==========================================
- Coverage   65.22%   65.04%   -0.18%     
==========================================
  Files          86       86              
  Lines       12318    12452     +134     
==========================================
+ Hits         8034     8099      +65     
- Misses       3772     3832      +60     
- Partials      512      521       +9     
Files Changed Coverage Δ
internal/gatewayapi/translator.go 97.33% <ø> (ø)
internal/gatewayapi/zz_generated.deepcopy.go 0.00% <0.00%> (ø)
internal/provider/kubernetes/helpers.go 78.52% <0.00%> (-1.35%) ⬇️
internal/provider/kubernetes/predicates.go 53.94% <40.90%> (-2.39%) ⬇️
internal/provider/kubernetes/controller.go 48.17% <59.04%> (-1.08%) ⬇️
internal/provider/kubernetes/routes.go 43.72% <66.66%> (+0.65%) ⬆️
internal/gatewayapi/validate.go 90.19% <80.00%> (-1.29%) ⬇️
internal/gatewayapi/helpers.go 81.13% <100.00%> (+0.74%) ⬆️
internal/gatewayapi/resource.go 57.50% <100.00%> (+7.50%) ⬆️
internal/gatewayapi/route.go 88.37% <100.00%> (+0.08%) ⬆️

@tanujd11
Copy link
Member Author

tanujd11 commented Jul 25, 2023

@arkodg , I think this can go in with using ClusterSetIP type which will have VIPs in multi cluster service import. EndpointSlice can be used once that PR gets in. It will be similar to service backend.

@arkodg
Copy link
Contributor

arkodg commented Jul 25, 2023

Rethinking, you're right @tanujd11, this PR can go in by itself.
Will review this soon once we start working on v0.6 features.

@arkodg
Copy link
Contributor

arkodg commented Aug 3, 2023

did a first pass, it looks good ! added some minor comments

Copy link
Member

@Xunzhuo Xunzhuo left a comment

Choose a reason for hiding this comment

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

This is awesome, but there are some conflcts : )

It would be a nice feat in v0.6.0.

@arkodg
Copy link
Contributor

arkodg commented Aug 4, 2023

ptal @envoyproxy/gateway-maintainers, a decision also needs be made here on whether we want the ServiceImport API to be opt in or not

@arkodg arkodg added the kind/decision A record of a decision made by the community. label Aug 4, 2023
@tanujd11 tanujd11 force-pushed the feat/service-import-backend branch from b2ac94a to 36113fe Compare August 7, 2023 10:32
@tanujd11
Copy link
Member Author

tanujd11 commented Aug 7, 2023

@arkodg, if we are removing the serviceImport CRD from EG chart, then it automatically becomes the a Opt-in feature where user needs to install the CRD to use this feature. I can add a validation to check if the CRD exist before someone uses serviceImport as part of the backend. for example if the user has mentioned serviceImport as backendRef and the CRD does not exist, we can reject the config with status backendRef kind does not exist

@tanujd11
Copy link
Member Author

tanujd11 commented Aug 7, 2023

/retest

@arkodg
Copy link
Contributor

arkodg commented Aug 7, 2023

@arkodg, if we are removing the serviceImport CRD from EG chart, then it automatically becomes the a Opt-in feature where user needs to install the CRD to use this feature. I can add a validation to check if the CRD exist before someone uses serviceImport as part of the backend. for example if the user has mentioned serviceImport as backendRef and the CRD does not exist, we can reject the config with status backendRef kind does not exist

great idea, +1 to this, but from an implementation perspective, won't the provider layer error out if it tries to Watch the ServiceImport resource w/o have a CRD installed ?

arkodg
arkodg previously approved these changes Aug 7, 2023
Copy link
Contributor

@arkodg arkodg 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 adding this !

@tanujd11
Copy link
Member Author

tanujd11 commented Aug 7, 2023

great idea, +1 to this, but from an implementation perspective, won't the provider layer error out if it tries to Watch the ServiceImport resource w/o have a CRD installed ?

You are right, the current one is throwing error. Should we implement a way to check the presence of CRD for watching also. Or is there any other way in your mind to tackle this

@arkodg
Copy link
Contributor

arkodg commented Aug 7, 2023

@tanujd11 can you share the error you are seeing ?

one way to solve the opt in problem is add a knob in EnvoyGateway.ExtensionApis

@Xunzhuo
Copy link
Member

Xunzhuo commented Aug 9, 2023

LGTM after conflicts are resolved and CI passed.

@tanujd11
Copy link
Member Author

@arkodg , can you take a relook at this work? I have added the knob at the place suggested by you. I will work on the doc in a subsequent PR

zirain
zirain previously approved these changes Aug 18, 2023
@arkodg
Copy link
Contributor

arkodg commented Aug 18, 2023

had a chat with @tanujd11 who is trying to implement the functionality w/o having to add an explicit API knob

Xunzhuo
Xunzhuo previously approved these changes Aug 21, 2023
Copy link
Member

@Xunzhuo Xunzhuo left a comment

Choose a reason for hiding this comment

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

Looks like this PR has been rebased a couple of times, maybe we should get this in higher priority, in case more rebases. Thanks @tanujd11, mind having another rebase to fix conflicts?

Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
@tanujd11 tanujd11 dismissed stale reviews from Xunzhuo and zirain via e4c3241 August 22, 2023 17:24
@arkodg
Copy link
Contributor

arkodg commented Aug 22, 2023

hey @tanujd11 just took a peek at your PR, the approach of using the o/p. of discoveryClient.ServerResources() to check if the service import API exists in the API server is a great way to decide on whether to watch the resource or not.

@arkodg
Copy link
Contributor

arkodg commented Aug 22, 2023

seeing some test yaml fail, recommend running make testdata to fix it

Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
arkodg
arkodg previously approved these changes Aug 22, 2023
Copy link
Contributor

@arkodg arkodg left a comment

Choose a reason for hiding this comment

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

LGTM, added some minor nits around error string
thanks for adding this !

Signed-off-by: tanujd11 <dwiveditanuj41@gmail.com>
@zirain
Copy link
Contributor

zirain commented Aug 23, 2023

can you add a user face doc in following PR.

@arkodg arkodg merged commit ed0533f into envoyproxy:main Aug 23, 2023
18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/decision A record of a decision made by the community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Multi-Cluster Services using ServiceImport as a BackendRef
4 participants