Skip to content

[provider/kubernetes]: Watch Service objects under httpRouteReconciler#194

Merged
danehans merged 6 commits intoenvoyproxy:mainfrom
chauhanshubham:service-handling-httproute
Aug 10, 2022
Merged

[provider/kubernetes]: Watch Service objects under httpRouteReconciler#194
danehans merged 6 commits intoenvoyproxy:mainfrom
chauhanshubham:service-handling-httproute

Conversation

@chauhanshubham
Copy link
Copy Markdown
Member

Adds a Service watcher in httpRouteReconciler to watch for Service CRUDs.
This also pushes affected HTTPRoutes for reconciliation when referenced
Service objects are created/updated/deleted.

Other minor updates include -
Fixing gatewayReconciler issue to initialise obj list. Object list variable should be
initialised before calling client.List(...). Prior to this it was being set to nil which
caused issues in the controller workflow.
Cleanup DefaultEnvoyGateway on server startup

Resolves #189

@chauhanshubham chauhanshubham requested a review from a team as a code owner August 5, 2022 12:52
@chauhanshubham chauhanshubham changed the title [provider/kubernetes]: Include watch for Service objects under httpRouteReconciler [provider/kubernetes]: Watch Service objects under httpRouteReconciler Aug 5, 2022
@chauhanshubham chauhanshubham force-pushed the service-handling-httproute branch from ecb7d2c to c6eee2d Compare August 5, 2022 15:59
@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Aug 5, 2022

thanks for picking this issue up @chauhanshubham ! hoping this PR can be reworked on once #193 is merged so that the Service resources can be appended into the provider ResourceTable

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Aug 5, 2022

Codecov Report

Merging #194 (7ebecf2) into main (a603060) will decrease coverage by 0.12%.
The diff coverage is 26.92%.

@@            Coverage Diff             @@
##             main     #194      +/-   ##
==========================================
- Coverage   60.09%   59.97%   -0.13%     
==========================================
  Files          24       25       +1     
  Lines        2035     2071      +36     
==========================================
+ Hits         1223     1242      +19     
- Misses        740      748       +8     
- Partials       72       81       +9     
Impacted Files Coverage Δ
internal/cmd/server.go 24.32% <0.00%> (ø)
internal/cmd/xdstest.go 3.65% <ø> (ø)
internal/envoygateway/config/config.go 0.00% <0.00%> (ø)
internal/provider/kubernetes/httproute.go 25.00% <22.22%> (-2.03%) ⬇️
internal/provider/kubernetes/gateway.go 67.00% <100.00%> (+7.00%) ⬆️
internal/provider/kubernetes/helpers.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@chauhanshubham chauhanshubham force-pushed the service-handling-httproute branch from a44e44e to 7ebecf2 Compare August 5, 2022 17:48
@chauhanshubham
Copy link
Copy Markdown
Member Author

chauhanshubham commented Aug 5, 2022

thanks for picking this issue up @chauhanshubham ! hoping this PR can be reworked on once #193 is merged so that the Service resources can be appended into the provider ResourceTable

Sure, having a look at that right now, will include changes once the PR gets merged. I'm guessing we'll just need HTTPRoute to be published, when associated Service CRUD happens. At the consuming side, we can get the referenced Service NamespaceName (and then obj spec) from HTTPRoute spec itself.

@arkodg
Copy link
Copy Markdown
Contributor

arkodg commented Aug 5, 2022

thanks for picking this issue up @chauhanshubham ! hoping this PR can be reworked on once #193 is merged so that the Service resources can be appended into the provider ResourceTable

Sure, having a look at that right now, will include changes once the PR gets merged. I'm guessing we'll just need HTTPRoute to be published, when associated Service CRUD happens. At the consuming side, we can get the referenced Service NamespaceName (and then obj spec) from HTTPRoute spec itself.

yeah that approach sgtm

minor doc changes

Signed-off-by: Shubham Chauhan <[email protected]>
obj list variable should be initialized before calling client.List.
Prior to this it was set to nil which caused crashes in the controller.

Signed-off-by: Shubham Chauhan <[email protected]>
Add a Service watcher in httpRouteReconciler to watch for Service
CRUDs. Also push affected HTTPRoutes for reconciliation on referenced
Service objects CRUD.

Signed-off-by: Shubham Chauhan <[email protected]>
Signed-off-by: Shubham Chauhan <[email protected]>
@chauhanshubham chauhanshubham force-pushed the service-handling-httproute branch from 7ebecf2 to 30469a3 Compare August 6, 2022 08:45
Copy link
Copy Markdown
Contributor

@danehans danehans left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!

Copy link
Copy Markdown
Contributor

@kflynn kflynn left a comment

Choose a reason for hiding this comment

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

Looks pretty sane from here...

Copy link
Copy Markdown
Member

@Alice-Lilith Alice-Lilith left a comment

Choose a reason for hiding this comment

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

lgtm

@danehans danehans merged commit deaef4e into envoyproxy:main Aug 10, 2022
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.

Add Service Watch to HTTPRoute Controller

6 participants