getfider / fider

Open platform to collect and prioritize feedback
https://fider.io
GNU Affero General Public License v3.0
2.75k stars 620 forks source link

fider deployed on gke with persistence volume but the data disappeared after cluster upgrade. #1098

Closed sreenivas-ps closed 1 year ago

sreenivas-ps commented 1 year ago

Hi Team,

I've deployed fider on the GKE cluster with both app and db. I added persistence disk to the db pod but after the GKE was upgraded from version 1.21.14 to 1.22.12, the pods came up but the data is disappeared i.e When I logged in to the fider site, the startup screen came asking me to register again. I've added the persistence disk on the db pod, is that not enough or should I add persistence disk also the app too?

I see that the persistence volume (pv) and persistence volume claim (pvc) both are present but when I ssh'd to the db pod, ran psql commands, found that list of the users had just 1 user which was me. There should have been lot of users there;

is there anyway I could bring back the data that was there?

There is not much of documentation on the fider docs about the persistence when hosting on cloud (like GCP).

sreenivas-ps commented 1 year ago

I found the issue; for anyone, you need to mount the path and then set the PGDATA env var on the db pod not to lose the data:

        - name: PGDATA
          value: /var/lib/postgresql/data/pgdata
        ports:
        - containerPort: 5432
        volumeMounts:
        - name: postgres-data
          mountPath: "/var/lib/postgresql/data"
      volumes:
      - name: postgres-data
        persistentVolumeClaim:
          claimName: postgres-data