-
Notifications
You must be signed in to change notification settings - Fork 492
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
Clarify docs on invalid serviceName #756
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -93,7 +93,9 @@ type TCPRouteRule struct { | |||||||
Matches []TCPRouteMatch `json:"matches,omitempty"` | ||||||||
|
||||||||
// BackendRefs defines the backend(s) where matching requests should be | ||||||||
// sent. | ||||||||
// sent. If unspecified or invalid, the rule performs no forwarding; if | ||||||||
// no filters are specified that would result in a response being sent, | ||||||||
// a HTTP 503 status code is returned. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Missed this the first time, but the HTTP 503 bit doesn't make sense for TCP or other L4 protocols. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Close the connection for TCP and ignore the packet for UDP? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this?
Suggested change
For UDP, the only option is to drop the packet on the floor. |
||||||||
// | ||||||||
// Support: Core for Kubernetes Service | ||||||||
// Support: Custom for any other resource | ||||||||
|
Original file line number | Diff line number | Diff line change | ||||||
---|---|---|---|---|---|---|---|---|
|
@@ -128,7 +128,9 @@ type TLSRouteRule struct { | |||||||
Matches []TLSRouteMatch `json:"matches,omitempty"` | ||||||||
|
||||||||
// BackendRefs defines the backend(s) where matching requests should be | ||||||||
// sent. | ||||||||
// sent. If unspecified or invalid, the rule performs no forwarding; if | ||||||||
// no filters are specified that would result in a response being sent, | ||||||||
// a HTTP 503 status code is returned. | ||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above with TCPRoute, it's not always given that TLSRoutes are using HTTP, so maybe something like this:
Suggested change
|
||||||||
// | ||||||||
// Support: Core for Kubernetes Service | ||||||||
// Support: Custom for any other resource | ||||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we further clarify what invalid means?
Does a regular k8s Service with no endpoints count as invalid?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, wouldn't hurt to clarify that a Service with no endpoints should also not have traffic forwarded for it either. Maybe something like this:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be nice to clarify too if you have multiple backendrefs what happens. From the discussion in the issue, you'd lad balance across some valid and some that return 503s?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I personally think it makes more sense to leave the weighting as requested. IE if a user says that 80% of requests should go to an invalid backend, could we just make that 80% of requests 503? Although that's harsh, it may be better than the alternative of sending all traffic to an alpha endpoint, a failure that could potentially go unnoticed for a long time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just feel we need to call out whatever behavior is decided. In my head, you'd set status for the invalid but skip the invalid services for serving. But that's ok if others don't agree. 🙃
Given this model, if you only had one invalid service defined for a route, you'd serve 503s, bit would you set a status on the route?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was the consensus in the linked issue #638.
You could set an unresolved refs condition somewhere to report the inability to resolve an invalid service name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, something like this?
With another bit added afterwards:
That makes sense to me. (With apologies to @howardjohn for writing your PR for you :) )