Expose pod ports locally

[…]  kubectl port-forward allows using resource name, such as a pod name, to select a matching pod to port forward to.

kubectl port-forward mongo-75f59d57f4-4nd6q 28015:27017 [or]

kubectl port-forward pods/mongo-75f59d57f4-4nd6q 28015:27017 [or]

kubectl port-forward deployment/mongo 28015:27017 [or]

kubectl port-forward replicaset/mongo-75f59d57f4 28015:27017 [or]

https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/

Leave a comment