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

Add https-listener service port name #887

Merged
merged 1 commit into from
Jan 8, 2021

Conversation

MarcelMue
Copy link
Member

@MarcelMue MarcelMue commented Jan 5, 2021

Changes

This is a change following discussions in #881 - it introduces a second port name when TLS is used and changes the port behaviour to keep container ports static and only change service port when configured.

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Release Notes

Add https-listener service port name if TLS is used.

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Jan 5, 2021
@tekton-robot tekton-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 5, 2021
@tekton-robot
Copy link

Hi @MarcelMue. Thanks for your PR.

I'm waiting for a tektoncd 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.

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.

@tekton-robot tekton-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 5, 2021
@dibyom
Copy link
Member

dibyom commented Jan 5, 2021

/ok-to-test

@tekton-robot tekton-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 Jan 5, 2021
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 82.5% 80.3% -2.2

Copy link
Contributor

@savitaashture savitaashture left a comment

Choose a reason for hiding this comment

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

Overall looks good to me 👍

few questions around default values

// eventListenerServiceTLSPortName defines service TLS port name for EventListener Service
eventListenerServiceTLSPortName = "https-listener"
// eventListenerContainerPort defines the port exposed by the EventListener Container
eventListenerContainerPort = 8000
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason to change default port value from 8080 to 8000 ?

@@ -543,7 +538,7 @@ func getContainer(el *v1alpha1.EventListener, c Config) corev1.Container {
Args: []string{
"--el-name=" + el.Name,
"--el-namespace=" + el.Namespace,
"--port=" + strconv.Itoa(port),
"--port=" + strconv.Itoa(eventListenerContainerPort),
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this change to make EventListener pod to run on 8000 always ?

if thats the case we need to document about this and also we need to document when this config/controller.yaml used and update the flag description here

Copy link
Member Author

Choose a reason for hiding this comment

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

The idea was together with @dibyom :
Changing the port for the deployment / container to be static while only making the service configurable. This causes two effects.

  1. Less work templating because we only need to change the port in the service instead of everywhere.
  2. Logic becomes easier to understand because configuration is only applied to the service and not to the deployment / container and so on.

I chose port 8000 because noone from outside should consume it - they should interact with the service instead (where it remains 8080 / 8443 by default). Additionally it makes clear (to me at least) that it could be either protocol (8080 implies HTTP).

return corev1.Container{
Name: "event-listener",
Image: *c.Image,
Ports: []corev1.ContainerPort{{
ContainerPort: int32(port),
ContainerPort: int32(eventListenerContainerPort),
Copy link
Contributor

Choose a reason for hiding this comment

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

This changes indicates that for https connection also it uses 8000 port for container I mean the target port is always constant for (http and https) connection right?

Copy link
Contributor

@khrm khrm left a comment

Choose a reason for hiding this comment

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

/test pull-tekton-triggers-integration-tests

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 82.5% 80.3% -2.2

@dibyom
Copy link
Member

dibyom commented Jan 6, 2021

Ok so I think I found one place we were using the deployment's port -- our E2E test 😬

I think the value is being set here: https://github.com/tektoncd/triggers/blob/master/test/eventlistener_test.go#L381

(For this PR I think its fine to just switch that port to the new one, I'm working on updating some of the E2E tests -- I can take a stab at changing it to portforward to the service instead of the pod then)

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 82.5% 80.3% -2.2

@MarcelMue MarcelMue force-pushed the introduce-port-names branch from 4e9cc04 to 947b7c2 Compare January 7, 2021 14:09
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 7, 2021
@MarcelMue MarcelMue force-pushed the introduce-port-names branch from 947b7c2 to 441f651 Compare January 7, 2021 14:15
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 7, 2021
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 82.5% 80.3% -2.2

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

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

@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 7, 2021
Copy link
Contributor

@savitaashture savitaashture left a comment

Choose a reason for hiding this comment

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

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 8, 2021
@tekton-robot tekton-robot merged commit d74327a into tektoncd:master Jan 8, 2021
@MarcelMue MarcelMue deleted the introduce-port-names branch January 8, 2021 10:52
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. 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. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants