<p>I have a kubernetes pod configuration with a named volume and want to run it via <code>podman play kube</code> which fails for an unknown reason:</p>
<p><code>podman play kube kubernetes.yml</code>:</p>
<pre><code>Error: kubernetes.yml: Volume mount database-data-volume specified for container but not configured in volumes
</code></pre>
<hr />
<p>The error indicates that the volume does not exist, but it's there:</p>
<pre><code>&gt; podman volume list

DRIVER      VOLUME NAME
local       database-data-volume
</code></pre>
<p><code>kubernetes.yml</code></p>
<pre class="lang-yaml prettyprint-override"><code>apiVersion: v1
kind: Pod
...
spec:
  containers:
  ...
  - image: it.impl/h2-database:2.1.214-0
    name: database
    ports:
      - containerPort: 8082
        hostPort: 8082
      - containerPort: 9092
        hostPort: 9092
    volumeMounts:
      - mountPath: /opt/h2-database/data
        name: database-data-volume
  volumes:
    - persistentVolumeClaim:
        claimName: database-data-volume
  restartPolicy: Never
</code></pre>

<p>Your <code>volume</code> is missing a name (this would fail on Kubernetes as well). The <code>volumes</code> section maps a volume name to some sort of volume definition; when you write:</p>
<pre><code>  volumes:
    - persistentVolumeClaim:
        claimName: database-data-volume
</code></pre>
<p>You have a volume definition but no volume name. You need:</p>
<pre><code>  volumes:
    - name: database-data-volume
      persistentVolumeClaim:
        claimName: database-data-volume
</code></pre>
