title: Pgadmin4 on kubernetes: saving users and settings in a volume
body: <p>I want to save users accounts and other settings in a volume for a pgadmin4 k8s instance, I did that:</p>
  <pre><code>    apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: pgadmin
        namespace: pgadmin
      spec:
        selector:
         matchLabels:
          app: pgadmin
        replicas: 1
        template:
          metadata:
            labels:
              app: pgadmin
          spec:
            containers:
              - name: pgadmin4
                image: dpage/pgadmin4
                env:
                 - name: PGADMIN_DEFAULT_EMAIL
                   value: &quot;admin@example.com&quot;
                 - name: PGADMIN_DEFAULT_PASSWORD
                   value: &quot;mysecpwd&quot;
                 - name: PGADMIN_PORT
                   value: &quot;80&quot;
                ports:
                  - containerPort: 80
                    name: pgadminport
                volumeMounts:
                  - mountPath: /
                    name: pgadmin-storage
  
            volumes:
                 - name: pgadmin-storage
                   persistentVolumeClaim:
                     claimName: pgadmin-pv-claim
      ---
          kind: PersistentVolume
          apiVersion: v1
          metadata:
            name: pgadmin-pv-volume
            namespace: pgadmin
            labels:
              type: local
              app: pgadmin
          spec:
            storageClassName: manual
            capacity:
              storage: 5Gi
            accessModes:
              - ReadWriteMany
            hostPath:
              path: &quot;/mnt/data&quot;
      ---
          kind: PersistentVolumeClaim
          apiVersion: v1
          metadata:
            name: pgadmin-pv-claim
            namespace: pgadmin
            labels:
              app: pgadmin
          spec:
            storageClassName: manual
            accessModes:
              - ReadWriteMany
            resources:
              requests:
                storage: 5Gi
  </code></pre>
  <p>The problem is when I restart the pod the created users disappears even if the pv is bounded to the pod, I'm not sure about this section:</p>
  <pre><code>              volumeMounts:
                  - mountPath: /
                    name: pgadmin-storage
  </code></pre>
  <p>I think I have to specify the directory where the user's information and settings are saved, I tried the default directory <code>/pgadmin4</code> but the pod crashes.</p>