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

Allow user-defined ports on Configuration #2642

Merged
merged 1 commit into from
Dec 18, 2018

Conversation

dgerd
Copy link

@dgerd dgerd commented Dec 5, 2018

This change allows for a user to add a port to their Container object
in Configuration. The single port provided is used by the queue-proxy to
as the port used to connect to the user container. This port is
available as environment variable "PORT" on the user container and
environment variable "USER_PORT" on the queue-proxy.

This change is built upon PR #2190 by Leon-Liangming. It squashes the
following commits:

  • change queue-proxy user-port env name
  • rebase master, fix uint test
  • remove "activator" istio-proxy , set "sidecar.istio.io/inject" to false
  • add e2e test for user-port && review comments modify && open acitvator's istio-proxy
  • set more validation info about user-port && modify e2e test
  • change validation info && e2e test
  • more review comments modify
  • Allow only 1 unnamed port
  • Passing conformance tests

Related to #2258
Fixes #1241

@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of all the commit author(s), set the cla label to yes (if enabled on your project), and then merge this pull request when appropriate.

@knative-prow-robot knative-prow-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Dec 5, 2018
Copy link
Contributor

@knative-prow-robot knative-prow-robot left a comment

Choose a reason for hiding this comment

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

@dgerd: 0 warnings.

In response to this:

This change allows for a user to add a port to their Container object
in Configuration. The single port provided is used by the queue-proxy to
as the port used to connect to the user container. This port is
available as environment variable "PORT" on the user container and
environment variable "USER_PORT" on the queue-proxy.

This change is built upon PR #2190 by Leon-Liangming. It squashes the
following commits:

  • change queue-proxy user-port env name
  • rebase master, fix uint test
  • remove "activator" istio-proxy , set "sidecar.istio.io/inject" to false
  • add e2e test for user-port && review comments modify && open acitvator's istio-proxy
  • set more validation info about user-port && modify e2e test
  • change validation info && e2e test
  • more review comments modify
  • Allow only 1 unnamed port
  • Passing conformance tests

Related to #2258

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.

@dgerd
Copy link
Author

dgerd commented Dec 5, 2018

/assign @tcnghia

Can you take a pass at this?

cc @evankanderson in case you wanted to take a look as you chimed in on the original PR.

@dgerd
Copy link
Author

dgerd commented Dec 5, 2018

cc @tanzeeb as this is somewhat related to #2539. This PR puts down the prerequisite work for plumbing content-negotiation through the Port[0].Name field.

@tanzeeb
Copy link
Contributor

tanzeeb commented Dec 6, 2018

Hey @dgerd , this is great! Thanks for looking into the named ports as well.

One question, you mentioned

remove "activator" istio-proxy , set "sidecar.istio.io/inject" to false

Is that still part of this PR?

@tcnghia
Copy link
Contributor

tcnghia commented Dec 6, 2018

@tanzeeb removing activator was part of the squashed commit messages from @Leon-Liangming's PR. I think that has been reverted in a following commit in the same PR.

@dgerd
Copy link
Author

dgerd commented Dec 6, 2018

/test pull-knative-serving-upgrade-tests

@tcnghia
Copy link
Contributor

tcnghia commented Dec 7, 2018

/lgtm
/approve

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 7, 2018
@dgerd
Copy link
Author

dgerd commented Dec 7, 2018

/test pull-knative-serving-upgrade-tests

@dgerd
Copy link
Author

dgerd commented Dec 7, 2018

/test pull-knative-serving-integration-tests

@dgerd
Copy link
Author

dgerd commented Dec 7, 2018

/cc @evankanderson

Do you mind taking a pass through this to make sure this correctly implements the spec? It is still missing the Docker EXPOSE lookup from #2258, but otherwise I believe it matches the behavior both defined in the issue and the runtime spec.

@evankanderson
Copy link
Member

This LGTM; I have a few comments, but I don't think any are blocking.

/approve
/hold for comment review/response

@knative-prow-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dgerd, evankanderson, tcnghia

The full list of commands accepted by this bot can be found here.

The pull request process is described here

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

@knative-prow-robot knative-prow-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 11, 2018
@evankanderson
Copy link
Member

Also, the CLA seems angry -- do you know why? (Possibly due to accepted suggestions?)

@tcnghia
Copy link
Contributor

tcnghia commented Dec 11, 2018

@evankanderson my understanding is that the CLA doesn't like it when @dgerd pushed changes from a previous (inactive) PR that weren't his.

@dgerd
Copy link
Author

dgerd commented Dec 11, 2018

@tcnghia is correct. It does not like that this is based on changes from #2190.

@knative-prow-robot knative-prow-robot removed lgtm Indicates that a PR is ready to be merged. labels Dec 11, 2018
@dgerd dgerd force-pushed the 2258-user-port branch 2 times, most recently from 9cf8deb to aa25b3c Compare December 14, 2018 23:32
@knative-metrics-robot
Copy link

The following is the coverage report on pkg/.
Say /test pull-knative-serving-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/serving/v1alpha1/revision_validation.go 93.1% 94.4% 1.3

@mattmoor mattmoor added this to the Serving 0.3 milestone Dec 15, 2018
@mattmoor
Copy link
Member

@evankanderson I'll bypass the CLA bot once things look good. Dan took this over from another PR where the author had signed the CLA, but then went AWOL.

@dgerd
Copy link
Author

dgerd commented Dec 17, 2018

/retest

This change allows for a user to add a port to their Container object
in Configuration. The single port provided is used by the queue-proxy to
as the port used to connect to the user container. This port is
available as environment variable "PORT" on the user container and
environment variable "USER_PORT" on the queue-proxy.

This change is built upon PR knative#2190 by Leon-Liangming. It squashes the
following commits:

* change queue-proxy user-port env name
* rebase master, fix uint test
* remove "activator" istio-proxy , set "sidecar.istio.io/inject" to false
* add e2e test for user-port && review comments modify && open acitvator's istio-proxy
* set more validation info about user-port && modify e2e test
* change validation info && e2e test
* more review comments modify
* Allow only 1 unnamed port
* Passing conformance tests

Related to knative#2258

Reduce number of type conversions

Allow h2c and http1 on for port name

Code Review Comments

Clean up port validation
@dgerd
Copy link
Author

dgerd commented Dec 17, 2018

/test pull-knative-serving-integration-tests

@adrcunha
Copy link
Contributor

/retest

@evankanderson
Copy link
Member

/lgtm

One followup comment, but this mostly looks good.

@knative-prow-robot knative-prow-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 17, 2018
@mattmoor
Copy link
Member

My understanding is that the outstanding comment is going to go into a follow up, so I'm going to bypass CI to get this merged, since Prow won't be able to bypass the CLA check.

@mattmoor mattmoor merged commit e980938 into knative:master Dec 18, 2018
@bradhoekstra
Copy link
Contributor

@dgerd What happens if the user picks 8012 (RequestQueuePort) or 8022 (RequestQueueAdminPort) as their port?

@dgerd
Copy link
Author

dgerd commented Dec 18, 2018

@bradhoekstra I will create a PR to disallow those two fields.

I also created a bug for the QueueProxy as choosing those ports actually sort-of worked or at least passed tests.

#2752

dgerd pushed a commit to dgerd/serving that referenced this pull request Dec 18, 2018
This change prevents the user from choosing ports 8012 nad 8022 as they
are currently reserved by the QueueProxy sidecar container.

Ref knative#2752
Ref knative#2642
dgerd pushed a commit to dgerd/serving that referenced this pull request Dec 21, 2018
This change prevents the user from choosing ports 8012 nad 8022 as they
are currently reserved by the QueueProxy sidecar container.

Ref knative#2752
Ref knative#2642
knative-prow-robot pushed a commit that referenced this pull request Dec 21, 2018
* Don't allow port to conflict with QueueProxy

This change prevents the user from choosing ports 8012 nad 8022 as they
are currently reserved by the QueueProxy sidecar container.

Ref #2752
Ref #2642

* Move and use constants in webhook
@gongzili456
Copy link

so, how to use user_port config, my knative version is 0.2.3, I try set it in Dockerfile and deployment file, not work.

@dgerd
Copy link
Author

dgerd commented Dec 29, 2018 via email

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. lgtm Indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set readiness probe port based on user's configuration