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 port-forward logic with PortForward and ClusterPortForward type #233

Merged

Conversation

nikola-jokic
Copy link
Contributor

@nikola-jokic nikola-jokic commented Jan 27, 2023

What type of PR is this?

/kind feature

Which issue(s) this PR fixes:

Fixes #216

Special notes for your reviewer:

Not sure exactly how to test this change so I am creating this as a draft for further comments ☺️ I was able to fake it by passing --config with configuration from the issue

Does this PR introduce a user-facing change?

Add port-forward logic with PortForward and ClusterPortForward type

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Jan 27, 2023
@netlify
Copy link

netlify bot commented Jan 27, 2023

Deploy Preview for k8s-kwok canceled.

Name Link
🔨 Latest commit 8b4e16c
🔍 Latest deploy log https://app.netlify.com/sites/k8s-kwok/deploys/63f7525a291a480008fc000f

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 27, 2023
@k8s-ci-robot
Copy link
Contributor

Welcome @nikola-jokic!

It looks like this is your first PR to kubernetes-sigs/kwok 🎉. 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-sigs/kwok 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
Copy link
Contributor

Hi @nikola-jokic. Thanks for your PR.

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

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jan 27, 2023
@wzshiming
Copy link
Member

/ok-to-test

@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. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 27, 2023
@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 29, 2023
@nikola-jokic
Copy link
Contributor Author

/retest

@nikola-jokic
Copy link
Contributor Author

I tried to figure out why are tests failing, but when I try them on the main branch, the same output is shown.
Should that be a separate issue or is there something I can do?

pkg/kwok/server/debugging_port_forword.go Outdated Show resolved Hide resolved
pkg/kwok/server/debugging_port_forword.go Outdated Show resolved Hide resolved
pkg/kwok/server/debugging_port_forword.go Outdated Show resolved Hide resolved
pkg/kwok/server/debugging_port_forword.go Outdated Show resolved Hide resolved
pkg/kwok/server/debugging_port_forword.go Outdated Show resolved Hide resolved
pkg/kwok/server/debugging_port_forword.go Outdated Show resolved Hide resolved
pkg/kwok/server/debugging_port_forword.go Outdated Show resolved Hide resolved
@wzshiming
Copy link
Member

I tried to figure out why are tests failing, but when I try them on the main branch, the same output is shown. Should that be a separate issue or is there something I can do?

It doesn't seem to be an effect of this work, so you can ignore it for now.

@wzshiming
Copy link
Member

wzshiming commented Jan 31, 2023

Based on my patch of comments, following these steps seems to be working.

IMAGE_PREFIX=local make build build-image
./bin/$(go env GOOS)/$(go env GOARCH)/kwokctl create cluster --config port-forwrd.yaml

kubectl config use-context kwok-kwok
kubectl apply -f ./test/kwokctl/fake-node.yaml
kubectl apply -f ./test/kwokctl/fake-deployment.yaml
kubectl port-forward deployment/fake-pod 8080:10247

curl 127.0.0.1:8080
# port-forwrd.yaml
kind: ClusterPortForward
apiVersion: kwok.x-k8s.io/v1alpha1
metadata:
  name: cluster-port-forward-rules
spec:
  forwards:
    - targetPort: 10247
      targetAddress: localhost

@wzshiming
Copy link
Member

wzshiming commented Jan 31, 2023

I would like to make the matching capability a bit more generic, there are 3 other configurations that need to reuse this part, unit tests for this, and e2e just need to test that the features work properly.

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Feb 2, 2023
@nikola-jokic
Copy link
Contributor Author

/retest

@nikola-jokic nikola-jokic force-pushed the nikola-jokic/portforward branch 2 times, most recently from ad365a0 to 1f79bf4 Compare February 2, 2023 11:06
@nikola-jokic nikola-jokic marked this pull request as ready for review February 2, 2023 11:15
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Feb 2, 2023
@wzshiming wzshiming force-pushed the nikola-jokic/portforward branch 17 times, most recently from b77e909 to 2a42fd9 Compare February 23, 2023 07:31
Co-authored-by: Nikola Jokic <jokicnikola07@gmail.com>
Co-authored-by: Nikola Jokic <jokicnikola07@gmail.com>
@wzshiming
Copy link
Member

/approve
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 23, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nikola-jokic, wzshiming

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 23, 2023
@k8s-ci-robot k8s-ci-robot merged commit c092e5f into kubernetes-sigs:main Feb 23, 2023
@nikola-jokic nikola-jokic deleted the nikola-jokic/portforward branch February 23, 2023 18:23
@wzshiming wzshiming added the kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API label Apr 17, 2023
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. 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 kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", 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. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[kwok] Provided service for port-forward
3 participants