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

Make the webhook port number configurable #5696

Merged
merged 1 commit into from
Nov 10, 2022

Conversation

sel
Copy link
Contributor

@sel sel commented Oct 28, 2022

Changes

Previously the webhook listened on a fixed port, 8443, which is
likely to clash with other services when the webhook is run on the
host network in Kubernetes, which is required when using some CNI
implementations, notably Calico on EKS [1].

Enable configuration of the webhook listen port through the environment
variable WEBHOOK_PORT by using the existing API from the KNative SDK.

[1] https://projectcalico.docs.tigera.io/getting-started/kubernetes/managed-public-cloud/eks#install-eks-with-calico-networking

Submitter Checklist

As the author of this PR, please check off the items in this checklist:

  • Has Docs included if any changes are user facing
  • Has Tests included if any functionality added or changed
  • Follows the commit message standard
  • Meets the Tekton contributor standards (including
    functionality, content, code)
  • Has a kind label. You can add one by adding a comment on this PR that contains /kind <type>. Valid types are bug, cleanup, design, documentation, feature, flake, misc, question, tep
  • Release notes block below has been updated with any user facing changes (API changes, bug fixes, changes requiring upgrade notices or deprecation warnings)
  • Release notes contains the string "action required" if the change requires additional action from users switching to the new release

Release Notes

The port on which the webhook server listens may be configured via the WEBHOOK_PORT environment variable.

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 28, 2022
@tekton-robot
Copy link
Collaborator

Hi @sel. 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 needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Oct 28, 2022
@sel
Copy link
Contributor Author

sel commented Oct 28, 2022

/kind features

@tekton-robot
Copy link
Collaborator

@sel: The label(s) kind/features cannot be applied, because the repository doesn't have them.

In response to this:

/kind features

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.

@sel
Copy link
Contributor Author

sel commented Oct 28, 2022

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 28, 2022
Copy link
Member

@XinruZhang XinruZhang left a comment

Choose a reason for hiding this comment

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

Thanks for the PR! You may also want to add an ENV variable here:

env:
- name: SYSTEM_NAMESPACE
valueFrom:
fieldRef:
fieldPath: metadata.namespace
# If you are changing these names, you will also need to update
# the webhook's Role in 200-role.yaml to include the new
# values in the "configmaps" "get" rule.
- name: CONFIG_LOGGING_NAME
value: config-logging
- name: CONFIG_OBSERVABILITY_NAME
value: config-observability
- name: CONFIG_LEADERELECTION_NAME
value: config-leader-election
- name: CONFIG_FEATURE_FLAGS_NAME
value: feature-flags
- name: WEBHOOK_SERVICE_NAME
value: tekton-pipelines-webhook
- name: WEBHOOK_SECRET_NAME
value: webhook-certs
- name: METRICS_DOMAIN
value: tekton.dev/pipeline

And add comments here telling users to keep this the same as the ENV variable WEBHOOK_PORT

containerPort: 8443

As well as this line, can simply replace 8443 with https-webhook (the name of the container port):

targetPort: 8443

@sel sel requested review from XinruZhang and removed request for pritidesai and dibyom October 28, 2022 18:07
@XinruZhang
Copy link
Member

Thanks Steve! Do you mind merging the two commits into one? BTW I don't have the permission to approve the PR request yet, so need to assign the previous reviewers back :)

/assign @dibyom
/assign @pritidesai

Previously the webhook listened on a fixed port, 8443, which is
likely to clash with other services when the webhook is run on the
host network in Kubernetes, which is required when using some CNI
implementations, notably Calico on EKS [1].

Enable configuration of the webhook listen port through the environment
variable WEBHOOK_PORT by using the existing API from the KNative SDK.

[1] https://projectcalico.docs.tigera.io/getting-started/kubernetes/managed-public-cloud/eks#install-eks-with-calico-networking
@sel sel force-pushed the feature/webhook/configurable-port branch from ea55352 to a621bdd Compare October 28, 2022 18:32
@sel
Copy link
Contributor Author

sel commented Oct 28, 2022

Thank-you for your review, @XinruZhang!

I have squashed the commits.

And apologies for removing the other reviewers, I think that happened when I hit the "Request re-review" button here on GitHub.

@XinruZhang
Copy link
Member

/assign

LGTM from a reviewer that has no LGTM permission XD

@dibyom
Copy link
Member

dibyom commented Oct 31, 2022

/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 Oct 31, 2022
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 3, 2022
@tekton-robot
Copy link
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom, vdemeester

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

@dibyom
Copy link
Member

dibyom commented Nov 10, 2022

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 10, 2022
@tekton-robot tekton-robot merged commit 4f8b98e into tektoncd:main Nov 10, 2022
@sel sel deleted the feature/webhook/configurable-port branch November 11, 2022 09:38
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. kind/feature Categorizes issue or PR as related to a new feature. 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/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants