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

Support weight on HTTPRoute.ForwardTo #3560

Closed
stevesloka opened this issue Apr 8, 2021 · 4 comments · Fixed by #3569
Closed

Support weight on HTTPRoute.ForwardTo #3560

stevesloka opened this issue Apr 8, 2021 · 4 comments · Fixed by #3569
Assignees
Labels
area/gateway-api Issues or PRs related to the Gateway (Gateway API working group) API. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor.

Comments

@stevesloka
Copy link
Member

Weight specifies the proportion of HTTP requests forwarded to the backend referenced by the ServiceName or BackendRef field. This is computed as weight/(sum of all weights in this ForwardTo list). For non-zero values, there may be some epsilon from the exact proportion defined here depending on the precision an implementation supports. Weight is not a percentage and the sum of weights does not need to equal 100.

If only one backend is specified and it has a weight greater than 0, 100% of the traffic is forwarded to that backend. If weight is set to 0, no traffic should be forwarded for this entry. If unspecified, weight defaults to 1.

// ref: https://gateway-api.sigs.k8s.io/spec/#networking.x-k8s.io/v1alpha1.HTTPRouteForwardTo

@stevesloka stevesloka added kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor. area/gateway-api Issues or PRs related to the Gateway (Gateway API working group) API. labels Apr 8, 2021
@stevesloka
Copy link
Member Author

//ref: kubernetes-sigs/gateway-api#596

@stevesloka stevesloka self-assigned this Apr 12, 2021
stevesloka added a commit to stevesloka/contour that referenced this issue Apr 12, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes projectcontour#3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
@xaleeks xaleeks added this to Unprioritized in Contour Project Board via automation Apr 13, 2021
@xaleeks xaleeks moved this from Unprioritized to 1.15 release in Contour Project Board Apr 13, 2021
@xaleeks
Copy link

xaleeks commented Apr 13, 2021

@stevesloka Seems you're working on it so I'm tagging it 1.15. The behavior in Gateway API here seems consistent with that of HTTPProxy, in that weights do not have to add to 100 and will be adjusted accordingly by proportionality.

Curious on our approach here for a feature that's not consistent with our CRD, I guess we just need to support both right? Concern is It can cause a bit of confusion as we continue to bring httproute and tlsroute up to parity to httpproxy.

Something for you to think about here as well @youngnick

@stevesloka
Copy link
Member Author

Curious on our approach here for a feature that's not consistent with our CRD

I don't understand the question @xaleeks? Specifically for weights with gateway-api, they function the same short of returning a 503 when all are zero, but we spent months on a design to also apply that to HTTPProxy.

More generically, if the behaviors are different we'd have to match the API's design. For example, Gateway could allow for conflicts with path prefixes and it's resolved with timestamps, but with HTTPProxy that can't happen.

@xaleeks
Copy link

xaleeks commented Apr 13, 2021

Thanks @stevesloka , sorry my wording was confusing. Behavior for this feature in question is consistent. I meant to ask 'Curious as to what we should do if we come across a feature in httproute that doesn't behave consistently with a similar thing in httpproxy' and you answered it.

We are just responsible for maintaining both for the time being, and if they diverge we still need to implement the gateway API.

stevesloka added a commit to stevesloka/contour that referenced this issue Apr 14, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes projectcontour#3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
stevesloka added a commit to stevesloka/contour that referenced this issue Apr 14, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes projectcontour#3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
stevesloka added a commit to stevesloka/contour that referenced this issue Apr 16, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes projectcontour#3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
stevesloka added a commit to stevesloka/contour that referenced this issue Apr 19, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes projectcontour#3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
stevesloka added a commit to stevesloka/contour that referenced this issue Apr 19, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes projectcontour#3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
stevesloka added a commit to stevesloka/contour that referenced this issue Apr 20, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes projectcontour#3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
stevesloka added a commit to stevesloka/contour that referenced this issue Apr 20, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes projectcontour#3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
stevesloka added a commit to stevesloka/contour that referenced this issue Apr 20, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes projectcontour#3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
stevesloka added a commit that referenced this issue Apr 21, 2021
Adds weight processing to the HTTPRoute.ForwardTos. If not specified,
defaults to the API default of "1". If set to zero, and all other services
are also set to zero or are invalid, an HTTP 503 response is returned.

Fixes #3560

Signed-off-by: Steve Sloka <slokas@vmware.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/gateway-api Issues or PRs related to the Gateway (Gateway API working group) API. kind/feature Categorizes issue or PR as related to a new feature. lifecycle/needs-triage Indicates that an issue needs to be triaged by a project contributor.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants