Daily Archives: 13.02.2020
Port forwarding with kubectl
If you want some kubernetes pod to forward all the traffic to you local machine, you can do this: 1. get pod id with
1 |
kubectl --kubeconfig <config> get po -lapp=<pod_label_app> -Lversion,cfg,infra-cfg |
2. forward exact port from it to you localhost with
1 |
kubectl --kubeconfig <config> port-forward <pod-id> localhost_port:pod_port |
And you can request you localhost to reach pod on selected port.