# How do I persist config file in kubernetes

**URL:** <https://forum.mattermost.com/t/how-do-i-persist-config-file-in-kubernetes/10083>\
**Category:** Troubleshooting\
**Created:** [July 11, 2020, 9:53am UTC](https://forum.mattermost.com/t/how-do-i-persist-config-file-in-kubernetes/10083 "2020-07-11T09:53:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WestFarmer](https://avatars.discourse-cdn.com/v4/letter/w/839c29/32.png) [@WestFarmer](https://forum.mattermost.com/u/WestFarmer)\
**Post date:** [July 11, 2020, 9:53am UTC](https://forum.mattermost.com/t/how-do-i-persist-config-file-in-kubernetes/10083/1 "2020-07-11T09:53:39Z")

</div>

hi, I am trying to deploy MM to a kubernetes cluster. My kubernetes cluster is setup by kubeadm on bare metal, and I am not using any operators or helm.

my yaml file:

```
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: mattermost-data
  namespace: devops
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
  storageClassName: rook-cephfs

---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: mattermost
  namespace: devops
spec:
  selector:
    matchLabels:
      app: mattermost
  replicas: 1
  template:
    metadata:
      labels:
        app: mattermost
    spec:
      containers:
        - name: mattermost
          image: mattermost/platform:5.24.2
          ports:
            - containerPort: 8065
              name: default
          volumeMounts:
            - name: data-volume
              mountPath: /mm/mattermost/logs
              subPath: logs
            - name: data-volume
              mountPath: /mm/mattermost-data
              subPath: mattermost-data
            - name: data-volume
              mountPath: /var/lib/mysql
              subPath: mysql-data
      volumes:
        - name: data-volume
          persistentVolumeClaim:
            claimName: mattermost-data

```

but here is my problem:  
I want the config\_docker.json also be persisted on PV, but MM in docker seems generate this file at startup, and write back it when change configurations on system console UI.

I can’t use configmap, as configmap is always mounted as readonly, I can’t mount  
PV to /mm/mattermost/config, as it will wipe out default config.json file.

any idea ?
