Skip to content

fix: mount Keycloak PostgreSQL data at official postgres path - #296

Open
linuxfreakus wants to merge 1 commit into
microcks:mainfrom
linuxfreakus:fix/keycloak-postgresql-mount-path
Open

fix: mount Keycloak PostgreSQL data at official postgres path#296
linuxfreakus wants to merge 1 commit into
microcks:mainfrom
linuxfreakus:fix/keycloak-postgresql-mount-path

Conversation

@linuxfreakus

Copy link
Copy Markdown

Summary

Fixes a data-loss bug where the Keycloak PostgreSQL volume was mounted at the wrong path and never used by the official library/postgres image.

Setting Before (broken) After
Image library/postgres unchanged
PGDATA /var/lib/postgresql/data/pgdata unchanged
volumeMounts.mountPath /var/lib/pgsql/data (RHEL/SCL) /var/lib/postgresql/data

With the old mount path, Postgres wrote under PGDATA on the container filesystem. The PVC/emptyDir at /var/lib/pgsql/data stayed empty, so keycloak.persistent: true did not persist Keycloak DB data across pod restarts.

This matches the already-correct Helm chart layout in microcks/microcks (mountPath: /var/lib/postgresql/data + subPath: pgdata + same PGDATA).

Related

Test plan

  • Deploy a Microcks CR with keycloak.install: true and keycloak.persistent: true
  • Confirm pod mount: kubectl exec … -- df -h /var/lib/postgresql/data (or inspect Deployment volumeMounts)
  • Create a Keycloak user / mutate realm data
  • Delete the Keycloak PostgreSQL pod and verify data still present after recreate
  • Optionally confirm volume contents are non-empty under the PVC

The volume was mounted at /var/lib/pgsql/data (RHEL/SCL) while PGDATA
and library/postgres use /var/lib/postgresql/data/pgdata, so the PVC
was never used and Keycloak DB data was not persisted.

Align mountPath with the Helm chart and PGDATA.

Fixes microcks#295

Signed-off-by: Eric Nichols <linuxfreakus@gmail.com>
@github-actions

Copy link
Copy Markdown

👋 @linuxfreakus

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly.

Hope you have a great time there!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Keycloak PostgreSQL PVC mount path does not match PGDATA (data not persisted)

1 participant