<h2>Trying to set up PetSet using Kube-Solo</h2>

<p>In my local dev environment, I have set up Kube-Solo with CoreOS. I'm trying to deploy a Kubernetes PetSet that includes a Persistent Volume Claim Template as part of the PetSet configuration. This configuration fails and none of the pods are ever started. Here is my PetSet definition:</p>

<pre><code>apiVersion: apps/v1alpha1
kind: PetSet
metadata:
  name: marklogic
spec:
  serviceName: "ml-service"
  replicas: 2
  template:
    metadata:
      labels:
        app: marklogic
      annotations:
        pod.alpha.kubernetes.io/initialized: "true"
    spec:
      terminationGracePeriodSeconds: 30
      containers:
        - name: 'marklogic'
          image: {ip address of repo}:5000/dcgs-sof/ml8-docker-final:v1
          imagePullPolicy: Always
          command: ["/opt/entry-point.sh", "-l", "/opt/mlconfig.sh"]
          ports:
            - containerPort: 7997
              name: health-check
            - containerPort: 8000
              name: app-services
            - containerPort: 8001
              name: admin
            - containerPort: 8002
              name: manage
            - containerPort: 8040
              name: sof-sdl
            - containerPort: 8041
              name: sof-sdl-xcc
            - containerPort: 8042
              name: ml8042
            - containerPort: 8050
              name: sof-sdl-admin
            - containerPort: 8051
              name: sof-sdl-cache
            - containerPort: 8060
              name: sof-sdl-camel
          env:
            - name: POD_IP
              valueFrom:
                fieldRef:
                  fieldPath: status.podIP
          lifecycle:
            preStop:
              exec:
                command: ["/etc/init.d/MarkLogic stop"]
          volumeMounts:
            - name: ml-data
              mountPath: /var/opt/MarkLogic 
  volumeClaimTemplates:
    - metadata:
        name: ml-data
         annotations:
           volume.alpha.kubernetes.io/storage-class: anything
      spec:
        accessModes: [ "ReadWriteMany" ]
        resources:
          requests:
            storage: 1Gi
</code></pre>

<p>In the Kubernetes dashboard, I see the following error message:</p>

<pre><code>SchedulerPredicates failed due to PersistentVolumeClaim is not bound: "ml-data-marklogic-0", which is unexpected.
</code></pre>

<p>It seems that being unable to create the Persistent Volume Claim is also preventing the image from ever being pulled from my local repository. Additionally, the Kubernetes Dashboard shows the request for the Persistent Volume Claims, but the state is continuously "pending".
I have verified the issue is with the Persistent Volume Claim. If I remove that from the PetSet configuration the deployment succeeds.</p>

<p>I should note that I was using MiniKube prior to this and would see the same message, but once the image was pulled and the pod(s) started the claim would take hold and the message would go away.</p>

<p>I am using</p>

<ul>
<li>Kubernetes version: 1.4.0</li>
<li>Docker version: 1.12.1 (on my mac) &amp; 1.10.3 (inside the CoreOS vm)</li>
<li>Corectl version: 0.2.8</li>
<li>Kube-Solo version: 0.9.6</li>
</ul>

<p><strong>I am not familiar with kube-solo.</strong></p>

<p>However, the issue here might be that you are attempting to use a feature, <a href="http://blog.kubernetes.io/2016/10/dynamic-provisioning-and-storage-in-kubernetes.html" rel="nofollow">dynamic volume provisioning</a>, which is in beta, which does not have specific support for volumes in your environment. </p>

<p>The best way around this would be to create the persistent volumes that it expects to find manually, so that the PersistentVolumeClaim can find them.</p>
