Closed uchiha-pain closed 2 years ago
A few answers:
-n
flags. -l
.
kubefwd
is built to allow developers to use service names as they would inside a cluster. kubefwd
uses internal loopback IP address and /etc/hosts
to accomplish this.Also, please check the help command:
$ kubefwd svc --help
INFO[15:44:32] _ _ __ _
INFO[15:44:32] | | ___ _| |__ ___ / _|_ ____| |
INFO[15:44:32] | |/ / | | | '_ \ / _ \ |_\ \ /\ / / _ |
INFO[15:44:32] | <| |_| | |_) | __/ _|\ V V / (_| |
INFO[15:44:32] |_|\_\\__,_|_.__/ \___|_| \_/\_/ \__,_|
INFO[15:44:32]
INFO[15:44:32] Version 1.22.3
INFO[15:44:32] https://github.com/txn2/kubefwd
INFO[15:44:32]
Forward multiple Kubernetes services from one or more namespaces. Filter services with selector.
Usage:
kubefwd services [flags]
Aliases:
services, svcs, svc
Examples:
kubefwd svc -n the-project
kubefwd svc -n the-project -l app=wx,component=api
kubefwd svc -n default -l "app in (ws, api)"
kubefwd svc -n default -n the-project
kubefwd svc -n default -d internal.example.com
kubefwd svc -n the-project -x prod-cluster
kubefwd svc -n the-project -m 80:8080 -m 443:1443
kubefwd svc -n the-project -z path/to/conf.yml
kubefwd svc -n the-project -r svc.ns:127.3.3.1
kubefwd svc --all-namespaces
Flags:
-A, --all-namespaces Enable --all-namespaces option like kubectl.
-x, --context strings specify a context to override the current context
-d, --domain string Append a pseudo domain name to generated host names.
-f, --field-selector string Field selector to filter on; supports '=', '==', and '!=' (e.g. -f metadata.name=service-name).
-z, --fwd-conf string Define an IP reservation configuration
-h, --help help for services
-c, --kubeconfig string absolute path to a kubectl config file
-m, --mapping strings Specify a port mapping. Specify multiple mapping by duplicating this argument.
-n, --namespace strings Specify a namespace. Specify multiple namespaces by duplicating this argument.
-r, --reserve strings Specify an IP reservation. Specify multiple reservations by duplicating this argument.
-l, --selector string Selector (label query) to filter on; supports '=', '==', and '!=' (e.g. -l key1=value1,key2=value2).
-v, --verbose Verbose output.
Hi, I have a cluster, and this cluster has 2 namespaces (control-plane-1 & control-plane-2). Both control planes have Cassandra database pods and a stargate pods.
and
Now, I want to forward stargate pod/svcs in both namespaces at the same time. But with kubectl port-forwarding command I am not able to achieve this goal (or maybe I don't know how to do multiple port-forwarding at the same time).
The statement above took me here to kubefwd and in my opinion it is a great utility. But I think the documentation is too vague or better to say that there is no documentation at all. So far, I came across the command that allows to forward all services in a particular namespace but what would be the command if I want to forward only one specific service? And what would be the command to forward multiple services in multiple namespaces? How can I assign an ip address of my choice? Let's say I want to forward stargate in both namespaces, how can I do that?
Thanks