<p>I have docker image with config folder in it.
Logback.xml is located there.
So I want to have ability to change logback.xml in pod (to up log level dinamicly, for example)
First, I've thought to use epmtyDir volume, but this thing rewrite directory and it becomes empty.
So Is there some simple method to make directory writable into pod?</p>

Haster
<p>Hello, hope you are enjoying your kubernetes Journey, if I understand, you want to have a file in a pod and be able to modify it when needed,</p>
<p>The thing you need here is to create a configmap based on your logback.xml file (can do it with imperative or declarative kubernetes configuration, here is the imperative one:</p>
<pre><code>kubectl create configmap logback --from-file logback.xml
</code></pre>
<p>And after this, just mount this very file to you directory location by using volume and volumeMount subpath in your deployment/pod yaml manifest:</p>
<pre><code>...
        volumeMounts:
        - name: &quot;logback&quot;
          mountPath: &quot;/CONFIG_FOLDER/logback.xml&quot;
          subPath: &quot;logback.xml&quot;
      volumes:
        - name: &quot;logback&quot;
          configMap:
            name: &quot;logback&quot;
...
</code></pre>
<p>After this, you will be able to modify your logback.xml config, by editing / recreating the configmap and restarting your pod.</p>
<p>But, keep in mind:</p>
<p>1: The pod files are not supposed to be modified on the fly, this is against the container philosophy (cf. Pet vs Cattle)</p>
<p>2: Howerver, Depending on your container image user rights, all pods directories can be writable...</p>
