title: create multiple persistent volumes in one .yaml
body: <p>I would like to dynamically provision 3 persistent volumes for my system, which are all based on a <code>storageClass</code> that I previously created. My v1 code does its job successfully. </p>
  
  <p>v1:</p>
  
  <pre><code>apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: volume0
    labels:
      type: storage-one
  spec:
    storageClassName: storage-one
    accessModes:
      - ReadWriteMany
    capacity:
      storage: 2Gi
    hostPath:
      path: /somepath
      type: "DirectoryOrCreate"
  
  ---
  apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: volume1
    labels:
      type: storage-one
  spec:
    storageClassName: storage-one
    accessModes:
      - ReadWriteMany
    capacity:
      storage: 2Gi
    hostPath:
      path: /somepath
      type: "DirectoryOrCreate"
  
  ---
  apiVersion: v1
  kind: PersistentVolume
  metadata:
    name: volume2
    labels:
      type: storage-one
  spec:
    storageClassName: storage-one
    accessModes:
      - ReadWriteMany
    capacity:
      storage: 2Gi
    hostPath:
      path: /somepath
      type: "DirectoryOrCreate"
  
  </code></pre>
  
  <p>I would like to refactor this code, possibly with a template that k8s can recognize, as the only variable here is the <code>metadata.name</code>. Is it possible?</p>