kube-forwarder icon indicating copy to clipboard operation
kube-forwarder copied to clipboard

Example config/json and some documentation on how to set up Port forwarding for a service

Open syedalisait opened this issue 4 years ago • 3 comments

There is no documentation or an example that I can look up to configure port-forwarding for a service.

So my assumption was it should be straight forward after opening the application, but it isn't. I loaded the ~/.kube/config file and named the cluster and filled few more fields. But still wasn't able to configure.

syedalisait avatar Jul 02 '19 06:07 syedalisait

Thank you for the message @syedalisait. First of all, check out our latest version v1.1.0 that contains auto detection of kube config and also several improvements related with parsing multi-contexts configuration. I hope it will make the process of using the app better.

Below a few examples of kube config which are pretty standard, I think Digital Ocean:

apiVersion: v1
clusters:
- cluster:
    certificate-authority-data: LS0tLS1CRUdJTiBDRVJUSU
    server: https://a7451be2-44ab-42bd-9d4c-213dadf0e675.k8s.ondigitalocean.com
  name: do-fra1-k8s-1-14-1-do-4-fra1-1561886718185
contexts:
- context:
    cluster: do-fra1-k8s-1-14-1-do-4-fra1-1561886718185
    user: do-fra1-k8s-1-14-1-do-4-fra1-1561886718185-admin
  name: do-fra1-k8s-1-14-1-do-4-fra1-1561886718185
current-context: do-fra1-k8s-1-14-1-do-4-fra1-1561886718185
kind: Config
preferences: {}
users:
- name: do-fra1-k8s-1-14-1-do-4-fra1-1561886718185-admin
  user:
    client-certificate-data: LS0tLS1CRUdJTiBDRVJUSU
    client-key-data: LS0tLS1CRUdJTiBSU0Eg

Rancher

apiVersion: v1
kind: Config
clusters:
- name: "pixel-point"
  cluster:
    server: "https://rancher.example.com/k8s/clusters/c-rz2xs"

users:
- name: "user-jzlgj"
  user:
    token: "kzgw6sz66qjkfzn7js6sz7p27t8k"

contexts:
- name: "pixel-point"
  context:
    user: "user-jwegj"
    cluster: "pixel-point"

current-context: "pixel-point"

If your existing config still does not work, please post it here and remove some confidential information from it, and we will try to understand the reason of the problem.

lnikell avatar Jul 02 '19 11:07 lnikell

I think that OP mean https://kubernetes.io/docs/concepts/services-networking/service/ . This would be useful to support not only port-forwarding to pods/deployments, but also to services.

Adiqq avatar Jul 02 '19 13:07 Adiqq

@Adiqq Thanks for that. Yes I'm looking to port-forward a Service

syedalisait avatar Jul 04 '19 15:07 syedalisait