<p>I'm trying to run a simple Kubernetes Pod, and I want to mount the home of the host where the pod is scheduled into the <code>/hosthome</code> directory.</p>

<p>I'm using Kubernetes Python API to deploy those pods on a remote cluster (so I can't use something like <code>os.path.expanduser('~')</code> because it'll parse the "client" host home, not the remote one).</p>

<p>When I try to deploy the pod with this volume definition:</p>

<pre><code>...
volumes:
  - name: hosthome
    hostPath:
      path: ~
...

</code></pre>

<p>The pod creation fails with this error: <code>create ~: volume name is too short, names should be at least two alphanumeric characters</code>. So I can't use the <code>~</code> shortcut to mount it.</p>

<p>So, my question is: is there any way to mount the home directory of the host where the pod is scheduled using only the YAML definition (without replaces or Python functions)?</p>

<p>Thanks.</p>

Skazza
<p>No, I think this is not possible. Only absolute paths are allowed for a host volumne mount.</p>
