apiVersion: v1
kind: Service
metadata:
  name: mongodb-headless-service
  labels:
    app: mongodb
spec:
  ports:
    - name: mongodb
      port: 27017
      targetPort: 27017
  clusterIP: None
  selector:
    app: mongodb