Add appProtocol to EndpointSlice.Port#83815
Conversation
|
Welcome @howardjohn! |
|
Hi @howardjohn. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
/assign @robscott |
|
Hey @howardjohn, this looks like a great start, thanks! One thing I forgot to mention is code generation. For e2e tests to pass and things to build, you'll need to run |
|
This PR may require API review. If so, when the changes are ready, complete the pre-review checklist and request an API review. Status of requested reviews is tracked in the API Review project. |
|
@robscott thanks, I had some issues running it but I think I got everything to run |
|
/ok-to-test |
|
Thanks for the work on this! This is in the process of getting formal approval in an associated KEP PR here: kubernetes/enhancements#1286. I think everyone's on board with this, but I don't think we'll be able to merge this until the associated enhancement PR gets merged. |
pkg/apis/discovery/types.go
Outdated
There was a problem hiding this comment.
Need to have more detail comment about the format and default values. Plus examples
There was a problem hiding this comment.
@freehan @howardjohn what formats should we allow here? I think the label validation that John added is a good start here. Should we limit this to a length shorter than the current 63 characters we get from that validation? Would a protocol ever include non alphanumeric characters? Should we enforce all uppercase or lowercase values so we don't get different https and HTTPS values? I think we agreed that the default value is nil/there isn't one, right?
My naive thought would be to leave the upper limit at 63, require alphanumeric characters only, and require uppercase letters, but I'm very open to other ideas.
There was a problem hiding this comment.
@thockin Any thoughts on how we should limit/validate AppProtocol?
There was a problem hiding this comment.
My thoughts:
- Length limit - 63 seems reasonable, I cannot imagine needing a longer protocol really and its pretty standard across Kubernetes
- Character set: I assume values like
mycompany.com/our-custom-protocolare not something that would really be used here. If that is the case, all uppercase sounds good. We may also want to support a-?
Some examples of things someone might want to set with various constraints:
DNSOVERHTTPS, DNS-OVER-HTTPS, DNS-Over-HTTPS, dns-over-https
HTTP, http
MYSQL, MY-SQL, mySql, mysql
Based on this, I think - is required, but I don't think there is value to mixing cases.
And agree, default value is nil
There was a problem hiding this comment.
I think there are 2 options:
-
Treat these as constants. Constants start with capital letters, acronyms are in caps. e.g.
HTTP,DNSOverHTTPS,MySQL,MyCustomProtocol -
Treat this as a label key. Un-prefixed names would be reserved for standardized values, prefixed names would be for non-standard values. E.g.
http,dns-over-https,mysql,mycompany.com/my-custom-protocol
I don't think any other options make sense. Between those two, I don't feel VERY strongly - I have a slight lean toward label-style, but it's a little weird if we expect the vast majority of use-cases to be the non-prefixed. Which do we expect more of?
There was a problem hiding this comment.
I am not sure that standardized values is the best approach here. There are a lot of protocols out there (wikipedia lists about 50 and there are of course many more less standardized one). I think it would be hard to hit the sweet spot of having the list of "standard" protocols not too small or too large. It would also be a bit awkward UX to be able to specify MySQL but then I have another database and now I have to specify postgresql.org/psql or something. It seems a bit arbitrary. What do you think?
Since the protocol is given meaning by the application consuming it, I think just allowing arbitrary strings here makes the most sense.
I don't have any opinion on the exact character set here though, as long as its not just upper case letters (DNSOVERHTTPS is awkward)
There was a problem hiding this comment.
I agree with that. It would be hard to settle on a set of standard app protocols here. Maybe instead it would make sense to have actual validation be limited to a simple character set and max length, but provide guidance on how protocols should be represented. As an example, a potential comment could look like this:
The application protocol for this port.
May contain alphanumeric characters as well as `.`, `-`, and `/`.
Must be no longer than 63 characters.
The following application protocols should consistently be represented as:
- HTTP
- HTTPS
- DNS
...
I don't know, just throwing something out there.
There was a problem hiding this comment.
The application protocol for this port.
May contain alphanumeric characters as well as `.`, `-`, and `/`.
Must be no longer than 63 characters.
Examples: HTTP, HTTPS, TCP
Would something like that make sense? It still feels a little weird to have a list of "blessed" protocols, even if its just in the docs. I don't care too much either way though
There was a problem hiding this comment.
If the intention is to allow semi-arbitrary strings, the precedent that jumps to mind is Condition Reason:
Reason string `json:"reason,omitempty" protobuf:"bytes,5,opt,name=reason"`
// Human-readable message indicating details about last transition.
// +optional
Message string `json:"message,omitempty" protobuf:"bytes,6,opt,name=message"`
In other words, comment that the convention is CamelCase and then don't validate it very much. Validating that it is less than 63 seems appropriate and as for character set, maybe ASCII?
Alternatively, there is a spec for this: https://tools.ietf.org/html/rfc6335
How about we blend ideas. Somethng like:
This field follows standard Kubernetes label syntax. Un-prefixed names are reserved for IANA standard service names (as per RFC-6335 and http://www.iana.org/assignments/service-names). Non-standard protocols should use prefixed names.
What do you think?
There was a problem hiding this comment.
I think that strikes a great balance here. There's only so much that can be validated, but this provides clear guidance.
7391bfd to
bef0e83
Compare
|
/retest |
2 similar comments
|
/retest |
|
/retest |
bef0e83 to
c04cdad
Compare
|
Test says |
|
/retest |
There was a problem hiding this comment.
Not sure how this file got added in (maybe somewhere in the build process?) but I don't think it should be part of this PR.
There was a problem hiding this comment.
Thanks! my ide is dumb and keeps adding this
0297f07 to
0310d17
Compare
|
/retest |
0310d17 to
d00794c
Compare
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: freehan, howardjohn, thockin The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest
…On Mon, Nov 11, 2019 at 2:13 PM Kubernetes Prow Robot < ***@***.***> wrote:
@howardjohn <https://github.com/howardjohn>: The following test *failed*,
say /retest to rerun them all:
Test name Commit Details Rerun command
pull-kubernetes-e2e-gce d00794c
<d00794c>
link
<https://prow.k8s.io/view/gcs/kubernetes-jenkins/pr-logs/pull/83815/pull-kubernetes-e2e-gce/1194002541013110786/> /test
pull-kubernetes-e2e-gce
Full PR test history
<https://prow.k8s.io/pr-history?org=kubernetes&repo=kubernetes&pr=83815>. Your
PR dashboard <https://gubernator.k8s.io/pr/howardjohn>. Please help us
cut down on flakes by linking to
<https://git.k8s.io/community/contributors/devel/sig-testing/flaky-tests.md#filing-issues-for-flaky-tests>
an open issue
<https://github.com/kubernetes/kubernetes/issues?q=is:issue+is:open> when
you hit one in your PR.
Instructions for interacting with me using PR comments are available here
<https://git.k8s.io/community/contributors/guide/pull-requests.md>. If
you have questions or suggestions related to my behavior, please file an
issue against the kubernetes/test-infra
<https://github.com/kubernetes/test-infra/issues/new?title=Prow%20issue:>
repository. I understand the commands that are listed here
<https://go.k8s.io/bot-commands>.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#83815?email_source=notifications&email_token=AAEYGXLE5PJAQIVR4AZ5HBLQTHKJZA5CNFSM4JAAJY52YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEDYJ3LI#issuecomment-552639917>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEYGXI75D2SA7GNQQRMXCTQTHKJZANCNFSM4JAAJY5Q>
.
|
What type of PR is this?
/kind api-change
What this PR does / why we need it:
This optional field will allow specifying information about the
application protocol used by the endpoint, such as http, grpc, etc. This
field is a string such arbitrary protocols can be specified.
Does this PR introduce a user-facing change?: