apiVersion: v1 kind: Service metadata: name: database spec: selector: app: database ports: - protocol: TCP port: 27017 targetPort: 27017