Print service port mappings.
Section: JSONPath Output Recipes
List service ports
bash
bash
kubectl get svc web -n payments -o jsonpath='{range .spec.ports[*]}{.name}{":"}{.port}{"->"}{.targetPort}{"\n"}{end}'Explanation
Print service port mappings.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing JSONPath Output Recipes