<p>I'm trying to deploy mongoDB in my Kubernetes cluster (Google Cloud Platform). Right now I'm focused on minikube local version of the deployment. The thing is that I'm getting error like so:
<code>pod has unbound immediate PersistentVolumeClaims</code></p>

<p>This is my config files which sets up mongodb inside the minikube:</p>

<p>Service file:</p>

<pre><code>apiVersion: v1
kind: Service
metadata:
  name: mongo
  labels:
    name: mongo
spec:
  ports:
    - port: 27017
      targetPort: 27017
  clusterIP: None
  selector:
    role: mongo
</code></pre>

<p>Stateful set file:</p>

<pre><code>apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: mongo
spec:
  selector:
    matchLabels:
      role: mongo
  serviceName: "mongo"
  replicas: 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
          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: 2Gi
</code></pre>

<p>Storage class file:</p>

<pre><code>kind: StorageClass
apiVersion: storage.k8s.io/v1beta1
metadata:
  name: fast
provisioner: kubernetes.io/gce-pd
parameters:
  type: pd-ssd
</code></pre>

<p>What am I missing here?</p>

<p>I think the problem is that you are trying to apply of</p>

<pre><code>provisioner: kubernetes.io/gce-pd
</code></pre>

<p>this should not work locally, as it is intended for <a href="https://kubernetes.io/docs/concepts/storage/storage-classes/#gce-pd" rel="nofollow noreferrer">GCE PD</a>.</p>

<p>For minikube, you can create <code>hostPath</code> pvc. <a href="https://minikube.sigs.k8s.io/docs/reference/persistent_volumes/" rel="nofollow noreferrer">Read more</a></p>
