<p>I am looking to write to a file on a Kubernetes pod through Elixir code. The pod starts off when exec'ing in at /opt/app and I want to write a file to some path like /opt/app/file_tmp.</p>
<p>Currently I am hard coding in the file writing the string &quot;/opt/app/&quot; and was wondering if there is a better way to get the Kubernetes home directory so I don't need to hard code this string within the application?</p>
<p>Is there something env variable I can use like K8S_HOME or similar?</p>

William Ross
<blockquote>
<p>wondering if there is a better way to get the Kubernetes home directory so I don't need to hard code this string within the application?</p>
</blockquote>
<p>Kubernetes is the container orchestrator. Your app runs in a container with its filesystem. You set the &quot;working directory&quot; in your Dockerfile with <a href="https://docs.docker.com/engine/reference/builder/#workdir" rel="nofollow noreferrer">WORKDIR</a>.</p>
