Skip to content

feat: add support for cluster-level settings for non xRoute-generated backend refs - #3954

Merged
guydc merged 11 commits into
envoyproxy:mainfrom
liorokman:backendref-cluster-settings
Aug 6, 2024
Merged

guydc merged 11 commits into
envoyproxy:mainfrom
liorokman:backendref-cluster-settings

Conversation

@liorokman

Copy link
Copy Markdown
Contributor

Which issue(s) this PR fixes:
Fixes #3069

@liorokman
liorokman requested a review from a team as a code owner July 25, 2024 07:35
@liorokman
liorokman marked this pull request as draft July 25, 2024 07:35
@codecov

codecov Bot commented Jul 25, 2024 •

Copy link
Copy Markdown

Codecov Report

Attention: Patch coverage is 82.35294% with 69 lines in your changes missing coverage. Please review.

Please upload report for BASE (main@3497600). Learn more about missing BASE report.

Files Patch % Lines
internal/gatewayapi/clustersettings.go 83.94% 23 Missing and 25 partials ⚠️
internal/gatewayapi/backendtrafficpolicy.go 73.21% 10 Missing and 5 partials ⚠️
internal/gatewayapi/securitypolicy.go 33.33% 2 Missing and 2 partials ⚠️
internal/gatewayapi/envoyextensionpolicy.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #3954   +/-   ##
=======================================
  Coverage        ?   67.61%           
=======================================
  Files           ?      185           
  Lines           ?    22578           
  Branches        ?        0           
=======================================
  Hits            ?    15265           
  Misses          ?     6217           
  Partials        ?     1096           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@liorokman

Copy link
Copy Markdown
Contributor Author
  1. Due to CEL limitations, I had to cap the number of backend refs at 16 items. Otherwise, the CEL validation cost was too big and the API server refused the CRDs.
  2. At least one traffic configuration is configurable for ext-proc and ext-auth, but makes no sense. This is the consistent hashing loadbalancing scheme. Regardless, I don't see an easy way to prevent specifying this configuration in all places due to the code reuse between the translation of ext-auth and ext-proc and the BackendTrafficPolicy code.

@liorokman
liorokman marked this pull request as ready for review July 25, 2024 14:18
@liorokman

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread api/v1alpha1/shared_types.go Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

thinking out loud - how does BackendSettings or Settings sound ?
cc @envoyproxy/gateway-reviewers

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

-1 on BackendConfig *ClusterSettings it's confused.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Renamed to BackendSettings

@zhaohuabing zhaohuabing Aug 4, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

My preference is embed ClusterSetting > Settings > ClusterSetting > BackendSetting. :-)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I renamed it to BackendSettings because when looking at the yaml file, simply Settings or ClusterSettings make less sense there. The context is missing - that these are settings that apply to the Backend being configured.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Yeah, you're right, BackendSettings makes much more sense in YAML files.

@liorokman
liorokman force-pushed the backendref-cluster-settings branch from df60652 to fe0ea54 Compare August 1, 2024 13:20
@liorokman

Copy link
Copy Markdown
Contributor Author

/retest

@liorokman
liorokman force-pushed the backendref-cluster-settings branch 2 times, most recently from 7e54b08 to 28dab19 Compare August 2, 2024 15:26
@liorokman

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread api/v1alpha1/shared_types.go Resolved
@liorokman

Copy link
Copy Markdown
Contributor Author

/retest

zhaohuabing
zhaohuabing previously approved these changes Aug 4, 2024

@zhaohuabing zhaohuabing left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Overall, this looks great! Adding a few lines of comments on BackendCluster and ClusterSettings would help people understand it better.

guydc
guydc previously approved these changes Aug 5, 2024

@guydc guydc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Lior Okman <[email protected]>
installable. Unlimited arrays cause CEL validation costs to be higher
than what the API server will accept.

Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
clusters, so treat it as such.

Signed-off-by: Lior Okman <[email protected]>
Signed-off-by: Lior Okman <[email protected]>
Update the PR to include HTTP2 settings as well.

Signed-off-by: Lior Okman <[email protected]>
@liorokman
liorokman dismissed stale reviews from guydc and zhaohuabing via 591ee2f August 6, 2024 07:39
@liorokman
liorokman force-pushed the backendref-cluster-settings branch from 8ed3949 to 591ee2f Compare August 6, 2024 07:39
@liorokman

Copy link
Copy Markdown
Contributor Author

@guydc , @zhaohuabing : please re-review after rebasing to make the PR mergeable.

The rebase changes include supporting the HTTP2 settings as well for non xRoute-generated backend refs.

Signed-off-by: Lior Okman <[email protected]>
@liorokman

Copy link
Copy Markdown
Contributor Author

/retest

@guydc guydc left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM!

@zhaohuabing

Copy link
Copy Markdown
Member

/retest

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.

Support cluster settings for non-xRoute BackendRefs

5 participants