<p>I have a container which is using shared volume with host. I want to give it a full permissions. At present, it is:</p>

<pre><code>ls -l
drwxr-xr-x 8 user user 4096 Aug  9 04:47 Data
</code></pre>

<p>But I want it to be:</p>

<pre><code>ls -l
drwxrwxrwx 8 user user 4096 Aug  9 04:47 Data
</code></pre>

<p>I have a below deployment file:</p>

<pre><code>----
----
spec:
  containers:
  - name: logger
    image: logger_image
    volumeMounts:
    - mountPath: /Data
      name: Data-files
    securityContext:  
      privileged: true

 volumes:
  - name: Data-files
    hostPath:
      path: /home/user/Documents/Data

----
----
</code></pre>

<p>I have even set it as <code>privileged</code> but still, the volumes do not have full permissions. What should I add in deployment file to make the volume full permissions?</p>

<p>Thanks</p>

S Andrew
<p>I resolved this issue by mentioning the appropriate commands to give full permissions to that directory in the <code>Dockerfile</code> itself.</p>

<p>In the dockerfile:</p>

<pre><code>RUN mkdir -p /Data
RUN chmod 777 -R Data/
</code></pre>

<p>and then later used the same kubernetes deployment file and it worked fine with full permissions.</p>

<p>Thanks</p>
