apiVersion: v1 kind: Service metadata: name: mongodb spec: type: NodePort ports: - port: 27017 protocol: TCP selector: app: mongodb