-
Notifications
You must be signed in to change notification settings - Fork 536
clarify requirement for port in forwardTo #685
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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 seems like something we should enforce with webhook validation. What should we do if BackendRef points to a Service?
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.
Absolutely, please see #578 (comment). With this patch and the validation bit, the user experience should be good.
I didn't consider that part because I wrongly assumed that was not allowed. Is there a good reason to allow such a thing in the first place? At this level of detail, I personally prefer having only one way to do something.
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.
One potential example - say we end up adding the ability to forward traffic to a Service in another namespace. We have 3 options:
backendRef.Namespace
field, this supports everything if Service can be referenced by BackendRefserviceNamespace
field, this only supports ServiceserviceNamespace
field andbackendRef.Namespace
fieldI'm pretty sure we want to avoid 3, and 2 could eventually lead to 3.
This may be a good argument against the
serviceName
shortcut altogether. I need to think about it more.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 is devolving into a separate conversation on if we should have
serviceName
shortcut or not.Let's take a look at the following two examples:
The easy path is shorter but not significantly so. The two additional lines also help with creating awareness around this extension point. Given how many corner cases exist with this special case, I think it would be best if we drop
serviceName
special case from here and rest of the API as well.@jpeach @bowei @robscott @danehans Would love to hear your take on 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 it be confusing if
backendRef.kind
defaulted toService
? That would make the difference even smaller:Given that we've required
port
to be specified when the backend is a Service, there's no longer a simpleserviceName
only short form anyway.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'd rather take one extra line of YAML over solving the corner cases the shortcut is introducing.
Would love to hear from others.
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 agree with @hbagdi on this one. I don't see the
serviceName
shortcut adding enough value to make the effort worthwhile.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.
If we are thinking about having
backendRef
default to Service then why not do the following:This still provides the shortcut, provides only 1 way of doing things, and is also the minimal number of lines. I hate to be so focused on number of YAML lines, but
forwardTo
is also one of the most heavily used fields in the API so the verbosity will be multiplied.Using a key like
backendName
is also nice because backend is a proper term for thing that's being pointed to. I have already heard people call it "the forwardTo" which feels a bit off.