2

I am currently using WikiJS 2.x and storing the data in a PostgresSQL persistent volume using Azure Kubernetes. After upgrading Kubernetes version to stay within the Azure supported versions, Wiki.JS got disconnected from the database, and when trying to reconnect it cannot see the data and attempts to create a new database every time.

Here is my deployment for the kubernetes postgres pod.

spec:
      containers:
      - env:
        - name: POSTGRES_USER
          value: <redacted>
        - name: POSTGRES_PASSWORD
          value: <redacted>
        - name: POSTGRES_DB
          value: wiki
        image: postgres:11.5
        imagePullPolicy: IfNotPresent
        name: postgres
        ports:
        - containerPort: 5432
          protocol: TCP
        resources: {}
        terminationMessagePath: /dev/termination-log
        terminationMessagePolicy: File
        volumeMounts:
        - mountPath: /var/lib/postgresql/data
          name: postgresdb
      dnsPolicy: ClusterFirst
      hostname: postgrespod
      restartPolicy: Always
      schedulerName: default-scheduler
      securityContext: {}
      subdomain: postgres
      terminationGracePeriodSeconds: 30
      volumes:
      - name: postgresdb
        persistentVolumeClaim:
          claimName: postgres-persistant-storage-postgres-0

Is there some specific setting in the deployment that needs to be changed to get it to use an existing database?

Kyounee
  • 21
  • 3
  • share the output of the kubectl get pods -A kubectl get pvc -A kubectl get pv this will help identify if we have any pods in a bad state, as well as identifying if the PV is attached to the right node and mounted in the pod There as been some issues where PV might not be reattaching after AKS upgrade and some special intervention would be required using resources.azure.com – Karishma Tiwari - MSFT Mar 24 '20 at 01:19
  • Also, could youshare the exact version from which you upgraded FROM and TO. It would help to see if this upgrade sequence was at the root of the issue and caused a PVC to not be properly mounted back on the StatefulSet. (assuming your Postgresql is a StatefulSet.) – Karishma Tiwari - MSFT Mar 24 '20 at 01:32
  • dealing with the same issue and looking for the solution... Meanwhile, I noticed something odd in your deployment yml: isn't it suppose to be `image: ghcr.io/requarks/wiki:2.5.295` since you are trying to deploy that and connect to your DB on the persistence volume? – 697 Feb 01 '23 at 22:05

0 Answers0