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

[kwok] Provided service for port-forward #216

Closed
wzshiming opened this issue Jan 14, 2023 · 1 comment · Fixed by #233
Closed

[kwok] Provided service for port-forward #216

wzshiming opened this issue Jan 14, 2023 · 1 comment · Fixed by #233
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Milestone

Comments

@wzshiming
Copy link
Member

wzshiming commented Jan 14, 2023

# Match pods
kind: ClusterPortForward
apiVersion: kwok.x-k8s.io/v1alpha1
metadata:
  name: cluster-port-forward-rules
spec:
  selector:
    matchNamespaces:
      - podNamespace
    matchNames:
      - podName
  forwards: []
--- 
# Just for a Pod
kind: PortForward
apiVersion: kwok.x-k8s.io/v1alpha1
metadata:
  name: podName
  namespace: podNamespace
spec:
  # This is the list of ports that will be forwarded
  forwards:

    # match the port 8001 forwards to the targetAddress:targetPort
    - ports:
        - 8001
      target:
        port: 80
        address: localhost

    # match the port 8002 forwards with the stdin/stdout of nc
    - ports:
        - 8002
      command:
        - nc
        - localhost
        - '80'

    # match the port 8003 forwards with the stdin/stdout of kubectl
    - ports:
        - 8003
      command:
        - kubectl
        - exec
        - -i
        - -n
        - podNamespace
        - podName
        - -c
        - podContainer
        - --
        - nc
        - localhost
        - '80'

    # match the port 8004 forwards with the stdin/stdout of docker
    - ports:
        - 8004
      command:
        - docker
        - exec
        - -i
        - container
        - nc
        - localhost
        - '80'

    # the ports is not set and will be the default
    - target
        port: 80
        address: localhost
@wzshiming wzshiming changed the title port-forward Provided service for port-forward Jan 14, 2023
@wzshiming wzshiming added the kind/feature Categorizes issue or PR as related to a new feature. label Jan 14, 2023
@wzshiming wzshiming changed the title Provided service for port-forward [kwok] Provided service for port-forward Jan 14, 2023
@nikola-jokic
Copy link
Contributor

/assign

@github-project-automation github-project-automation bot moved this to 🆕 New in KWOK Tracking Jan 18, 2023
@wzshiming wzshiming moved this from 🆕 New to 🏗 In progress in KWOK Tracking Jan 30, 2023
@wzshiming wzshiming added this to the v0.2 milestone Feb 6, 2023
@wzshiming wzshiming moved this from 🏗 In progress to 👀 In review in KWOK Tracking Feb 9, 2023
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in KWOK Tracking Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants