<h3>Whats the Problem?</h3>
<p>I can't get my pods running which are using a volume. In the Kubernetes Dashboard I got the following error:</p>
<blockquote>
<p>running &quot;VolumeBinding&quot; filter plugin for pod &quot;influxdb-6979bff6f9-hpf89&quot;: pod has unbound immediate PersistentVolumeClaims</p>
</blockquote>
<h3>What did I do?</h3>
<p>After running <code>Kompose convert</code> to my <code>docker-compose.yml</code> file I tried to start the pods with <code>micro8ks kubectl apply -f .</code> (I am using micro8ks) I had to replace the version of the networkpolicy yaml files with <code>networking.k8s.io/v1</code> (see <a href="https://github.com/kubernetes/kompose/issues/1238#issuecomment-593867095" rel="nofollow noreferrer">here</a>) but except of this change, I didn't change anything.</p>
<h3>YAML Files</h3>
<p><strong>influxdb-deployment.yaml</strong></p>
<pre><code>apiVersion: apps/v1
kind: Deployment
metadata:
  annotations:
    kompose.cmd: ./kompose convert
    kompose.version: 1.21.0 (992df58d8)
  creationTimestamp: null
  labels:
    io.kompose.service: influxdb
  name: influxdb
spec:
  replicas: 1
  selector:
    matchLabels:
      io.kompose.service: influxdb
  strategy:
    type: Recreate
  template:
    metadata:
      annotations:
        kompose.cmd: ./kompose convert
        kompose.version: 1.21.0 (992df58d8)
      creationTimestamp: null
      labels:
        io.kompose.network/cloud-net: &quot;true&quot;
        io.kompose.network/default: &quot;true&quot;
        io.kompose.service: influxdb
    spec:
      containers:
      - env:
        - name: INFLUXDB_HTTP_LOG_ENABLED
          value: &quot;false&quot;
        image: influxdb:1.8
        imagePullPolicy: &quot;&quot;
        name: influxdb
        ports:
        - containerPort: 8086
        resources: {}
        volumeMounts:
        - mountPath: /var/lib/influxdb
          name: influx
      restartPolicy: Always
      serviceAccountName: &quot;&quot;
      volumes:
      - name: influx
        persistentVolumeClaim:
          claimName: influx
status: {} 
</code></pre>
<p><strong>influxdb-service.yaml</strong></p>
<pre><code>apiVersion: v1
kind: Service
metadata:
  annotations:
    kompose.cmd: ./kompose convert
    kompose.version: 1.21.0 (992df58d8)
  creationTimestamp: null
  labels:
    io.kompose.service: influxdb
  name: influxdb
spec:
  ports:
  - name: &quot;8087&quot;
    port: 8087
    targetPort: 8086
  selector:
    io.kompose.service: influxdb
status:
  loadBalancer: {} 
</code></pre>
<p><strong>influx-persistenvolumeclaim.yaml</strong></p>
<pre><code>apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  creationTimestamp: null
  labels:
    io.kompose.service: influx
  name: influx
spec:
  accessModes:
  - ReadWriteOnce
  resources:
    requests:
      storage: 100Mi
status: {} 
</code></pre>

Max R.
<p>The <code>PersistentVolumeClaim</code> will be unbound if either the cluster does not have a <code>StorageClass</code> which can dynamically provision a <code>PersistentVolume</code> or it does not have a manually created <code>PersistentVolume</code> to satisfy the <code>PersistentVolumeClaim</code></p>
<p>Here is a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-persistent-volume-storage/" rel="nofollow noreferrer">guide</a> on how to configure a pod to use <code>PersistentVolume</code></p>
<p>To solve the current scenario you can manually create a PV</p>
<pre><code>apiVersion: v1
kind: PersistentVolume
metadata:
  name: task-pv-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 100Mi
  accessModes:
    - ReadWriteOnce
  hostPath:
    path: &quot;/mnt/data&quot;
</code></pre>
<p>Please note usage of <code>hostPath</code> is only as an example. It's not recommended for production usage. Consider using external block or file storage from the supported types <a href="https://kubernetes.io/docs/concepts/storage/persistent-volumes/#types-of-persistent-volumes" rel="nofollow noreferrer">here</a></p>
