Skip to content

Add appProtocol to EndpointSlice.Port#83815

Merged
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
howardjohn:appprotocol
Nov 12, 2019
Merged

Add appProtocol to EndpointSlice.Port#83815
k8s-ci-robot merged 1 commit intokubernetes:masterfrom
howardjohn:appprotocol

Conversation

@howardjohn
Copy link
Copy Markdown
Contributor

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?:

Added appProtocol field to EndpointSlice Port

@k8s-ci-robot
Copy link
Copy Markdown
Contributor

Welcome @howardjohn!

It looks like this is your first PR to kubernetes/kubernetes 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kubernetes has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. labels Oct 11, 2019
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Oct 11, 2019
@k8s-ci-robot k8s-ci-robot requested review from gmarek and sttts October 12, 2019 00:01
@howardjohn
Copy link
Copy Markdown
Contributor Author

/assign @robscott

@robscott
Copy link
Copy Markdown
Member

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 make update first and commit/amend the changes. Usually hack/update-bazel.sh is sufficient for small changes, but when types are added/changed, I usually end up having to run a full make update.

@fejta-bot
Copy link
Copy Markdown

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.

@howardjohn
Copy link
Copy Markdown
Contributor Author

@robscott thanks, I had some issues running it but I think I got everything to run

@robscott
Copy link
Copy Markdown
Member

/ok-to-test
/cc @freehan

@k8s-ci-robot k8s-ci-robot requested a review from freehan October 14, 2019 17:06
@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 14, 2019
@freehan freehan self-assigned this Oct 14, 2019
@robscott
Copy link
Copy Markdown
Member

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.

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.

Need to have more detail comment about the format and default values. Plus examples

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.

@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.

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.

@thockin Any thoughts on how we should limit/validate AppProtocol?

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.

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-protocol are 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

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.

I think there are 2 options:

  1. Treat these as constants. Constants start with capital letters, acronyms are in caps. e.g. HTTP, DNSOverHTTPS, MySQL, MyCustomProtocol

  2. 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?

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 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)

Copy link
Copy Markdown
Member

@robscott robscott Oct 25, 2019

Choose a reason for hiding this comment

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

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.

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.

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

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.

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?

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.

I think that strikes a great balance here. There's only so much that can be validated, but this provides clear guidance.

@k8s-ci-robot k8s-ci-robot added sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/network Categorizes an issue or PR as relevant to SIG Network. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Oct 16, 2019
@BenTheElder
Copy link
Copy Markdown
Member

/retest

2 similar comments
@BenTheElder
Copy link
Copy Markdown
Member

/retest

@howardjohn
Copy link
Copy Markdown
Contributor Author

/retest

@robscott robscott mentioned this pull request Oct 25, 2019
8 tasks
Copy link
Copy Markdown
Contributor

@freehan freehan left a comment

Choose a reason for hiding this comment

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

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 29, 2019
@k8s-ci-robot k8s-ci-robot added area/dependency Issues or PRs related to dependency changes sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. and removed lgtm "Looks good to me", indicates that a PR is ready to be merged. labels Nov 4, 2019
@howardjohn
Copy link
Copy Markdown
Contributor Author

Test says /home/prow/go/src/k8s.io/kubernetes/api/openapi-spec is out of date. Please run hack/update-openapi-spec.sh but ./build/run.sh hack/update-openapi-spec.sh makes no changes and I cannot run hack/update-openapi-spec.sh directly since I have some version mismatches or something. Not sure what I can do here @robscott

@robscott
Copy link
Copy Markdown
Member

robscott commented Nov 7, 2019

/retest

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.

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.

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.

Thanks! my ide is dumb and keeps adding this

@robscott
Copy link
Copy Markdown
Member

robscott commented Nov 7, 2019

/retest

Copy link
Copy Markdown
Member

@thockin thockin left a comment

Choose a reason for hiding this comment

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

Thanks!

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 11, 2019
@thockin thockin added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 11, 2019
@k8s-ci-robot
Copy link
Copy Markdown
Contributor

[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

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@howardjohn
Copy link
Copy Markdown
Contributor Author

howardjohn commented Nov 11, 2019 via email

@k8s-ci-robot k8s-ci-robot merged commit 7d1f9b4 into kubernetes:master Nov 12, 2019
@k8s-ci-robot k8s-ci-robot added this to the v1.17 milestone Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/dependency Issues or PRs related to dependency changes cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/apps Categorizes an issue or PR as relevant to SIG Apps. sig/cluster-lifecycle Categorizes an issue or PR as relevant to SIG Cluster Lifecycle. sig/instrumentation Categorizes an issue or PR as relevant to SIG Instrumentation. sig/network Categorizes an issue or PR as relevant to SIG Network. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants