title: Replicate docker-compose volume behavior in kubernetes
body: <p>I am migrating a docker-compose file for a tomcat + postgres application to kubernetes.  My test environment is Dockers for Windows with Kubernetes enabled.</p>
  
  <p>If I use an emptyDir volume for postgres, I am able to test my application successfully, but I am unable to persist postgres data.</p>
  
  <pre><code>      volumes:
        - name: "pgdata-vol"
          emptyDir: {}
  </code></pre>
  
  <p>On MacOS, I am able to persist postgres data using a hostPath volume.</p>
  
  <pre><code>  volumes:
    - name: "pgdata-vol"
      hostPath:
        path: /tmp/vols/pgdata
  </code></pre>
  
  <p>Unfortunately, if I try the same solution on Windows, I encounter a permission error.  This was discussed in a previous question. See  <a href="https://stackoverflow.com/questions/57227990/kubernetes-in-docker-for-windows-volume-configuration-for-postgres">Kubernetes (in Docker for Windows) Volume Configuration for Postgres</a>.</p>
  
  <p>I do not need to access my volumes through the host file system.  I simply want my volume to persist from one run to the next.  I am able to achieve this behavior when running <code>docker-compose ... up</code> and <code>docker-compose ... down</code> using the following volume definition.</p>
  
  <pre><code>volumes:
    pgdata:
  </code></pre>
  
  <p>Volume reference</p>
  
  <pre><code>    environment:
        - PGDATA=/pgdata
      volumes:
        - pgdata:/pgdata
  </code></pre>
  
  <p>Is there a good name to use to describe this type of volume?  Is there a way to translate this type of volume into kubernetes?  </p>