apiVersion: v1
kind: Service
metadata:
   name: my-nginx-node-port-service
spec:
   type: NodePort
   ports:
      -  port: 80 # this is the port on the service object and mapped to the node port
         targetPort: 80 # this is the port on the pod
         nodePort: 31000 # this is the port exposed on the node. Valid range is 30000-32767.
   selector: # this connects the service to the pods
      app: nginx-app
