apiVersion: v1
kind: Service
metadata:
  name: posts-srv #Name of the service
spec:
  type: NodePort #type of service (ClusterIP, Node Port, Load Balancer)
  selector:
    app: posts #name of the app for which the service is created
  ports:
    - name: posts
      protocol: TCP
      port: 4000 #This the port for the node service
      targetPort: 4000  #This is port where the posts node service is listening - refernce posts/index.js

