kubectl get svc --all-namespaces -o go-template="{{range .items}}{{range.spec.ports}}{{if .nodePort}}{{.nodePort}}{{"\n"}}{{end}}{{end}}{{end}}"
This gets all services in all namespaces, and does basically: “for each service, for each port, if nodePort is defined, print nodePort”.