<p>I'm trying to setup a Kubernetes PetSet as described in the documentation. When I create the PetSet I can't seem to get the Persistent Volume Claim to bind to the persistent volume. Here is my Yaml File for defining the PetSet:</p>

<pre><code>apiVersion: apps/v1alpha1
kind: PetSet
metadata:
  name: 'ml-nodes'
spec:
  serviceName: "ml-service"
  replicas: 1
  template:
    metadata:
      labels:
        app: marklogic
        tier: backend
      annotations:
        pod.alpha.kubernetes.io/initialized: "true"
    spec:
      containers:
        - name: 'ml'
          image: "192.168.201.7:5000/dcgs-sof/ml8-docker-final:v1"
          imagePullPolicy: Always
          ports:
            - containerPort: 8000
              name: ml8000
              protocol: TCP
            - containerPort: 8001
              name: ml8001
            - containerPort: 7997
              name: ml7997
            - containerPort: 8002
              name: ml8002
            - containerPort: 8040
              name: ml8040
            - containerPort: 8041
              name: ml8041
            - containerPort: 8042
              name: ml8042
          volumeMounts:
            - name: ml-data
              mountPath: /data/vol-data
          lifecycle:
            preStop:
              exec:
                # SIGTERM triggers a quick exit; gracefully terminate instead
                command: ["/etc/init.d/MarkLogic stop"]
      volumes:
        - name: ml-data
          persistentVolumeClaim:
            claimName: ml-data 
      terminationGracePeriodSeconds: 30
  volumeClaimTemplates:
    - metadata:
        name: ml-data
        annotations:
          volume.alpha.kubernetes.io/storage-class: anything
      spec:
        accessModes: [ "ReadWriteOnce" ]
        resources:
          requests:
            storage: 2Gi
</code></pre>

<p>If I do a 'describe' on my created PetSet I see the following:</p>

<pre><code>Name:           ml-nodes
Namespace:      default
Image(s):       192.168.201.7:5000/dcgs-sof/ml8-docker-final:v1
Selector:       app=marklogic,tier=backend
Labels:         app=marklogic,tier=backend
Replicas:       1 current / 1 desired
Annotations:        &lt;none&gt;
CreationTimestamp:  Tue, 20 Sep 2016 13:23:14 -0400
Pods Status:        0 Running / 1 Waiting / 0 Succeeded / 0 Failed
No volumes.
Events:
  FirstSeen LastSeen    Count   From        SubobjectPath   Type        Reason          Message
  --------- --------    -----   ----        -------------   --------    ------          -------
  33m       33m     1   {petset }           Warning     FailedCreate        pvc: ml-data-ml-nodes-0, error: persistentvolumeclaims "ml-data-ml-nodes-0" not found
  33m       33m     1   {petset }           Normal      SuccessfulCreate    pet: ml-nodes-0
</code></pre>

<p>I'm trying to run this in a minikube environment on my local machine. Not sure what I'm missing here???</p>

<p>There is an <a href="https://github.com/kubernetes/minikube/issues/524" rel="nofollow">open issue</a> on minikube for this. Persistent volume provisioning support appears to be unfinished in minikube at this time.</p>

<p>For it to work with local storage, it needs the following flag on the controller manager and that isn't currently enabled on minikube. </p>

<blockquote>
  <p>--enable-hostpath-provisioner[=false]: Enable HostPath PV
  provisioning when running without a cloud provider. This allows
  testing and development of provisioning features.  HostPath
  provisioning is not supported in any way, won't work in a multi-node
  cluster, and should not be used for anything other than testing or
  development.</p>
</blockquote>

<p>Reference: <a href="http://kubernetes.io/docs/admin/kube-controller-manager/" rel="nofollow">http://kubernetes.io/docs/admin/kube-controller-manager/</a></p>

<p>For local development/testing, it would work if you were to use <code>hack/local_up_cluster.sh</code> to start a local cluster, after setting an environment variable:</p>

<pre><code>export ENABLE_HOSTPATH_PROVISIONER=true 
</code></pre>
