apiVersion: v1
kind: Service
metadata:
  name: demo-app
spec:
  # type: ClusterIP    # this is the default, so doesn't need to be specified
  # type: NodePort     # exposes all ports on random ports on all cluster nodes
  # type: LoadBalancer # exposes using cluster load balancer services if supported (e.g. AWS ELB)
  selector:
    app: demo-app     # this label must match the pods of our deployment
  ports:
    - port: 80         # the port the service will serve externally
      targetPort: 80   # the port to serve inside the container, should match containerPort in the pod spec
      # nodePort: 8080 # if type is NodePort, this allows to specify the port to expose, otherwise it will use a random high port

