<h2>Summary</h2>
<p>I currently am in the process of learning kubernetes, as such I have decided to start with an application that is simple (Mumble).</p>
<h2>Setup</h2>
<p>My setup is simple, I have one node (the master) where I have removed the taint so mumble can be deployed on it. This single node is running CentOS Stream but SELinux is disabled.</p>
<h2>The issue</h2>
<p>The <code>/srv/mumble</code> directory appears to be ReadOnly, and at this point I have tried creating an init container to chown the directory but that fails due to the issue above. This issue appears in both containers, and I am unsure at this point how to change this to allow the mumble application to create files in said directory. The mumble application user runs as user 1000. What am I missing here?</p>
<h2>Configs</h2>
<pre class="lang-yaml prettyprint-override"><code>---
apiVersion: v1
kind: Namespace
metadata:
  name: mumble
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: mumble-pv-volume
  labels:
    type: local
spec:
  storageClassName: manual
  capacity:
    storage: 10Gi
  accessModes:
    - ReadWriteMany
  hostPath:
    type: DirectoryOrCreate
    path: &quot;/var/lib/data&quot;
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mumble-pv-claim
  namespace: mumble
spec:
  storageClassName: manual
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Gi
---
apiVersion: v1
kind: ConfigMap
metadata:
  name: mumble-config
  namespace: mumble
data:
  murmur.ini: |
    **cut for brevity**
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mumble-deployment
  namespace: mumble
  labels:
    app: mumble
spec:
  replicas: 1
  selector:
    matchLabels:
      app: mumble
  template:
    metadata:
      labels:
        app: mumble
    spec:
      initContainers:
        - name: storage-setup
          image: busybox:latest
          command: [&quot;sh&quot;, &quot;-c&quot;, &quot;chown -R 1000:1000 /srv/mumble&quot;]
          securityContext:
            privileged: true
            runAsUser: 0
          volumeMounts:
            - mountPath: &quot;/srv/mumble&quot;
              name: mumble-pv-storage
              readOnly: false
            - name: mumble-config
              subPath: murmur.ini
              mountPath: &quot;/srv/mumble/config.ini&quot;
              readOnly: false
      containers:
        - name: mumble
          image: phlak/mumble
          ports:
            - containerPort: 64738
          env:
            - name: TZ
              value: &quot;America/Denver&quot;
          volumeMounts:
            - mountPath: &quot;/srv/mumble&quot;
              name: mumble-pv-storage
              readOnly: false
            - name: mumble-config
              subPath: murmur.ini
              mountPath: &quot;/srv/mumble/config.ini&quot;
              readOnly: false
      volumes:
        - name: mumble-pv-storage
          persistentVolumeClaim:
            claimName: mumble-pv-claim
        - name: mumble-config
          configMap:
            name: mumble-config
            items:
              - key: murmur.ini
                path: murmur.ini
---
apiVersion: v1
kind: Service
metadata:
  name: mumble-service
spec:
  selector:
    app: mumble
  ports:
    - port: 64738
</code></pre>

DaemonSlayer2048
<p><code>command: [&quot;sh&quot;, &quot;-c&quot;, &quot;chown -R 1000:1000 /srv/mumble&quot;]</code></p>
<p>Not the volume that is mounted as read-only, the ConfigMap is always mounted as read-only. Change the command to:</p>
<p><code>command: [&quot;sh&quot;, &quot;-c&quot;, &quot;chown 1000:1000 /srv/mumble&quot;]</code> will work.</p>
