apiVersion: v1
kind: Service
metadata:
  name: posts-srv
spec:
  type: NodePort #type of service (clusterIP, nodePort, load-balancer, etc)
  selector:
    app: posts #find all pods with this label and expose their ports to the outside world
  ports:
    - name: posts
      protocol: TCP
      port: 3001 # service port, redirects ot targetPort
      targetPort: 3001 # application port
