Viewing random NodePort in quickstart tutorial

Hi,

I’m going through the quickstart tutorial, and have set everything up so that I am running the rancher/hello-world image. Port 80 is mapped to a random port using NodePort. However, I can’t seem to find anywhere that tells me what the random port actually is; where can I find this?

Thanks,
Jeremy

It should show in the UI under the created workload under Workloads, also under Service Discovery or you can use kubectl (embedded or remote) using:

kubectl get svc -o=jsonpath='{.items[*].spec.ports[?(@.port==80)].nodePort}'

Which displays the nodePort parameter for any service found in the default namespace (change with -n namespace) which targets port 80.