apiVersion: v1
kind: Service
metadata:
  name: db
  labels:
    name: mongodb-service
    app: todo-app

spec:
  selector:
    name: mongodb-pod

  type: ClusterIP
  ports:
    - name: mongodb
      port: 27017
      targetPort: 27017