diff --git a/arcade-system/romm.yaml b/arcade-system/romm.yaml index 30384df..461e1ec 100644 --- a/arcade-system/romm.yaml +++ b/arcade-system/romm.yaml @@ -92,6 +92,29 @@ spec: app.kubernetes.io/name: romm app.kubernetes.io/version: "4.5.0" spec: + securityContext: + fsGroup: 1000 + initContainers: + - name: init-config + image: busybox:1.36 + command: + - sh + - -c + - | + # Copy the template to the PVC only if it doesn't exist + if [ ! -f /romm/config/config.yml ]; then + echo "Creating initial config.yml from template..." + cp /tmp/template/config.yml /romm/config/config.yml + # Ensure the ROMM user (1000) owns the file + chown 1000:1000 /romm/config/config.yml + else + echo "config.yml already exists, skipping copy." + fi + volumeMounts: + - name: config-template + mountPath: /tmp/template + - name: config-storage + mountPath: /romm/config containers: - name: romm image: rommapp/romm:4.5.0 @@ -189,11 +212,8 @@ spec: mountPath: /romm/library - name: resources mountPath: /romm/resources - - name: config + - name: config-storage mountPath: /romm/config - - name: config-file - mountPath: /romm/config/config.yml - subPath: config.yml livenessProbe: httpGet: path: /api/heartbeat @@ -214,12 +234,12 @@ spec: - name: resources persistentVolumeClaim: claimName: romm-resources - - name: config + - name: config-storage persistentVolumeClaim: claimName: romm-config - - name: config-file + - name: config-template configMap: - name: romm-config-file + name: romm-config-template --- apiVersion: v1 kind: Service