KPF is a tool to assist in port redirects made through port-forward kubectl, keeping the current state and giving it a more refined control, being able to even save a state of several active redirects and restore them later, among other functions.
$ curl -L https://github.com/supermock/kpf/releases/download/v1.1.2/kpf -o /usr/local/bin/kpf
$ chmod +x /usr/local/bin/kpf
Note: If you have installed the completions of kubectl and you are not able to access the kpf command, add to your bashrc or zshrc
unalias kpf
Adding a port forward
# In this example I am adding a port forward to the Kubernetes Dashboard
$ kpf add kube-system k8s-app=kubernetes-dashboard 8443
Listing port forwards
$ kpf list
Removing a port forward
$ kpf del kube-system k8s-app=kubernetes-dashboard
Saving a current port forward state
$ kpf state save my-forwards
Restoring port forward from state
$ kpf state restore my-forwards
Update kpf to another version
$ kpf update v1.1.2
For more information, see the help...
MIT