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(gateway): add GatewayInstance controller #3476

Merged

Conversation

michaelbeaumont
Copy link
Contributor

@michaelbeaumont michaelbeaumont commented Dec 10, 2021

Summary

  • Add new controller to handle GatewayInstances.
  • Refactor existing Gateway API controller

Blocked by #3469

Issues resolved

Closes #3451
Closes #3446

@codecov-commenter
Copy link

codecov-commenter commented Dec 10, 2021

Codecov Report

Merging #3476 (34b6bd7) into master (0d1cd23) will decrease coverage by 0.03%.
The diff coverage is 3.35%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3476      +/-   ##
==========================================
- Coverage   51.56%   51.53%   -0.04%     
==========================================
  Files         917      917              
  Lines       55482    55551      +69     
==========================================
+ Hits        28611    28628      +17     
- Misses      24584    24640      +56     
+ Partials     2287     2283       -4     
Impacted Files Coverage Δ
...ime/k8s/controllers/gateway_instance_controller.go 0.00% <0.00%> (ø)
...ns/runtime/k8s/controllers/gatewayapi/condition.go 0.00% <0.00%> (ø)
...e/k8s/controllers/gatewayapi/gateway_controller.go 0.00% <0.00%> (ø)
pkg/plugins/runtime/k8s/plugin.go 1.12% <0.00%> (ø)
pkg/plugins/runtime/k8s/plugin_gateway.go 0.00% <0.00%> (ø)
pkg/core/policy/dataplane_matcher.go 50.87% <100.00%> (+1.78%) ⬆️
pkg/plugins/runtime/gateway/generator.go 78.62% <100.00%> (ø)
pkg/plugins/runtime/gateway/match/gateway.go 70.00% <100.00%> (ø)
pkg/xds/generator/direct_access_proxy_generator.go 85.88% <0.00%> (+1.17%) ⬆️
pkg/dns/vips_allocator.go 73.75% <0.00%> (+1.41%) ⬆️
... and 4 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0d1cd23...34b6bd7. Read the comment docs.

@michaelbeaumont michaelbeaumont force-pushed the feat/gateway_instance_ctrl branch 5 times, most recently from ffef539 to b071a23 Compare December 11, 2021 01:17
@michaelbeaumont michaelbeaumont marked this pull request as ready for review December 11, 2021 01:31
@michaelbeaumont michaelbeaumont requested a review from a team as a code owner December 11, 2021 01:31
@michaelbeaumont michaelbeaumont force-pushed the feat/gateway_instance_ctrl branch 2 times, most recently from f18e15a to e9c5877 Compare December 13, 2021 20:21
pkg/plugins/runtime/k8s/plugin_gateway.go Outdated Show resolved Hide resolved
pkg/plugins/runtime/k8s/plugin_gateway.go Outdated Show resolved Hide resolved
pkg/plugins/runtime/k8s/plugin_gateway.go Outdated Show resolved Hide resolved
@michaelbeaumont michaelbeaumont force-pushed the feat/gateway_instance_ctrl branch 6 times, most recently from a985034 to ed5cf80 Compare December 14, 2021 19:42
Copy link
Contributor

@jpeach jpeach left a comment

Choose a reason for hiding this comment

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

This looks good to me. We spin take any remaining items out into separate github issues.

@michaelbeaumont
Copy link
Contributor Author

michaelbeaumont commented Dec 15, 2021

This is blocked by #3546 setting the tags correctly on the Dataplane. We can either:

  • Lookup the GatewayInstance tags in the PodReconciler, similar to how we look up Services with normal Pods.
  • Create the Dataplanes in the GatewayInstanceReconciler

The second option is tricky since we have a number of assumptions that Dataplanes are named after Pods. We would need to maintain spec.replicas Dataplanes and match them to the Pods created by the ReplicaSet.
I prefer the first option, it seems less complex to use the owner reference on the Deployment to fetch the GatewayInstance.

@jpeach
Copy link
Contributor

jpeach commented Dec 15, 2021

Lookup the GatewayInstance tags in the PodReconciler, similar to how we look up Services with normal Pods.

When you build the deployment, could you smash the tags into an annotation on the pod (using a JSON blob as the value)?

@michaelbeaumont
Copy link
Contributor Author

Lookup the GatewayInstance tags in the PodReconciler, similar to how we look up Services with normal Pods.

When you build the deployment, could you smash the tags into an annotation on the pod (using a JSON blob as the value)?

Yes I think so, I decided against this on account of the "hacky" factor but yes, it's worth exploring

@michaelbeaumont
Copy link
Contributor Author

michaelbeaumont commented Dec 16, 2021

@jpeach works quite well and perhaps not as ugly as I thought.
Going to merge this, if you see anything in the newest commits, let me know.

@michaelbeaumont michaelbeaumont merged commit aac424e into kumahq:master Dec 16, 2021
@michaelbeaumont michaelbeaumont deleted the feat/gateway_instance_ctrl branch December 16, 2021 07:21
@lahabana lahabana added this to the gateway preview release milestone Feb 14, 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
4 participants