Kubernetes' NodePort Service doesn't work on multiple containers Statefulset

I'm new to Kubernetes and have been trying to get MongoDB in Cluster working. I followed this blog and was able to set up a cluster but when I try to replace the Service with NodePort type to access the cluster externally. I couldn't connect to the cluster, but when I removed the sidecar container section and set the replicas to 1 I can connect to the Statefulset. How can I fix this? (Note: I'm aware that Database should not be accessible externally. I'm just curious)

Here's the .yaml file for the NodePort Service

apiVersion: v1
kind: Service
metadata:
  name: mongo-cluster-svc
  labels:
    name: mongo-cluster
spec:
  type: NodePort
  ports:
  - port: 27017
  selector:
    role: mongo

Here's the .yaml file for the Statefulset

apiVersion: apps/v1beta1
kind: StatefulSet
metadata:
  name: mongo
spec:
  serviceName: "mongo"
  replicas: 3 # Change this to 1
  template:
    metadata:
      labels:
        role: mongo
        environment: test
    spec:
      terminationGracePeriodSeconds: 10
      containers:
        - name: mongo
          image: mongo
          command:
            - mongod
            - "--replSet"
            - rs0
            - "--smallfiles"
            - "--noprealloc"
          ports:
            - containerPort: 27017
          volumeMounts:
            - name: mongo-persistent-storage
              mountPath: /data/db
        - name: mongo-sidecar # Comment this container out
          image: cvallance/mongo-k8s-sidecar
          env:
            - name: MONGO_SIDECAR_POD_LABELS
              value: "role=mongo,environment=test"
  volumeClaimTemplates:
  - metadata:
      name: mongo-persistent-storage
      annotations:
        volume.beta.kubernetes.io/storage-class: "fast"
    spec:
      accessModes: [ "ReadWriteOnce" ]
      resources:
        requests:
          storage: 100Gi