apiVersion: v1
kind: Service
metadata:
  name: nginx-service-nodeport
spec:
  type: NodePort
  ports:
    - port: 80        # Service port
      targetPort: 80  # App port
      nodePort: 32023 # Node port
        # This is how packets go between these ports:
        #    Outside world <--> Node port <--> Service port <--> App port
  selector:
    app: nginx
    environment: production

# kubectl create -f nginx-deployment.yaml
# kubectl create -f nginx-service-nodeport.yaml
# kubectl get service
# kubectl describe service nginx-service-nodeport  # Shows Endpoints also. Endpoints are the
#                                                  # <node IP addr: target port>.
# kubectl get pods -o custom-columns=IP:status.podIP # To see the IP addresses on the pods.
# minikube ip                                        # Kubernetes cluster IP addr
# curl (minikube ip):32023                           # See if you see the Welcome to nginx page.
