DEV Community


Discussion on: 5 Tips to Be More Productive With Kubernetes

weibeld profile image
Daniel Weibel

For port-forwarding to a Pod, you don't necessarily need to get the Pod name. You can specify a Service or Deployment and kubectl will select one of the backing Pods automatically.

For example:

kubectl port-forward svc/grafana 3000:3000
peterj profile image
Peter Jausovec Author

Good point! I think it’s time to update my scripts - I had that since before kubectl supported forwarding ports to services.