[WIP] - Upgrade to postgres 18 - #37
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
There was a problem hiding this comment.
🟡 Changes recommended
Documentation currently contains a couple of verified inconsistencies/misstatements (stored as PR comments) that should be corrected before approval.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Pull request overview
This PR upgrades the operator-managed PostgreSQL baseline from 15 to 18 (using quay.io/sclorg/postgresql-18-c9s), updates the upgrade cleanup logic to remove legacy PG15 resources after migration, and refreshes documentation to reflect PG18 defaults and new configuration guidance.
Changes:
- Bump
supported_pg_versionto 18 and update default/backup/restore PostgreSQL images topostgresql-18-c9s. - Extend the post-upgrade cleanup to remove the legacy
-postgres-15StatefulSet and Service after a 15 → 18 migration. - Update docs with PG16–18 setting notes and a new managed-database upgrade section.
File summaries
| File | Description |
|---|---|
| roles/restore/vars/main.yml | Switch restore management pod image and supported PG version to 18. |
| roles/installer/vars/main.yml | Bump installer supported PG version to 18. |
| roles/installer/tasks/upgrade_postgres.yml | Remove old -postgres-15 resources during upgrade cleanup; update upgrade comment. |
| roles/installer/defaults/main.yml | Update default managed PostgreSQL image to PG18. |
| roles/backup/vars/main.yml | Switch backup management pod image and supported PG version to 18. |
| docs/user-guide/database-configuration.md | Update default PG version/docs and add PG16–18 settings guidance; clarify upgrade behavior. |
| docs/user-guide/advanced-configuration/assigning-awx-pods-to-specific-nodes.md | Update documented default postgres_image to PG18. |
| docs/upgrade/upgrading.md | Document automatic managed-database upgrade to PostgreSQL 18 and update examples. |
Review details
- Files reviewed: 8/8 changed files
- Comments generated: 3
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| The default PostgreSQL version for the managed database deployed by the latest version of the awx-operator is PostgreSQL 18, using the `quay.io/sclorg/postgresql-18-c9s` image. You can find this default for a given version at the default value for [supported_pg_version](https://github.com/ctrliq/ascender-operator/blob/devel/roles/installer/vars/main.yml). | ||
|
|
||
| We only have coverage for the default version of PostgreSQL. Newer versions of PostgreSQL will likely work, but should only be configured as an external database. If your database is managed by the awx-operator (default if you don't specify a `postgres_configuration_secret`), then you should not override the default version as this may cause issues when awx-operator tries to upgrade your postgresql pod. |
| We recommend you use the default image sclorg image. If you are coming from a deployment using the old postgres image from dockerhub (postgres:13), upgrading from awx-operator version 2.12.2 and below to 2.15.0+ will handle migrating your data to the new postgresql image (postgresql-15-c9s). | ||
| We recommend you use the default sclorg image. The operator automatically migrates a managed database that is still running an older major version (the dockerhub `postgres:13` image, `postgresql-13-c9s` or `postgresql-15-c9s`) to `postgresql-18-c9s` the next time it reconciles the deployment. See [PostgreSQL Upgrade Considerations](../upgrade/upgrading.md#postgresql-upgrade-considerations) for what happens during that migration. | ||
|
|
||
| You can no longer configure a custom `postgres_data_path` because it is hardcoded in the quay.io/sclorg/postgresql-18-c9s image. |
| # * If postgres version is not supported_pg_version, and not an external postgres instance (when managed_database is yes), | ||
| # then run this playbook with include_tasks from database_configuration.yml | ||
| # * Data will be streamed via a pg_dump from the postgres 12/13 pod to the postgres supported_pg_version | ||
| # * Data will be streamed via a pg_dump from the old postgres (12/13/15) pod to the postgres supported_pg_version |
Closes #36
Summary
Moves the operator-managed PostgreSQL database from 15 to 18 using
quay.io/sclorg/postgresql-18-c9s. Existing deployments running a managed PG 13 or 15 database are upgraded automatically on the next reconcile through the operator's existingpg_dump | pg_restorepath.PostgreSQL 15 goes EOL in November 2027; 18 is supported until November 2030. Ascender is on Django 6, which officially supports PostgreSQL 18.
Changes
supported_pg_versionand_postgres_imageto 18 in the installer, backup and restore roles. Backup and restore management pods now use PG 18 client tools.-postgres-15StatefulSet and Service to the post-upgrade cleanup inupgrade_postgres.yml. Without this the old PG 15 pod would keep running after a 15 → 18 migration.io_method,io_workers,transaction_timeout,autovacuum_worker_slots,vacuum_buffer_usage_limit,summarize_wal, etc.) and a warning againstio_method = io_uring.postgresql-18-c9s.Notes on the issue's caveats
pg_upgrade, so 15 → 18 happens in one step. The new cluster is initialised with checksums on (the PG 18initdbdefault).POSTGRESQL_UPGRADEmode: not used. The 18 image setsPOSTGRESQL_PREV_VERSION=16, so its built-inpg_upgradecannot do 15 → 18 anyway.host all all all md5topg_hba.conf, but passwords are stored as SCRAM-SHA-256 verifiers, so clients negotiate SCRAM. PG 18's MD5 deprecation warning only fires when an MD5-hashed password is set.postgresql.confparameter already reachable throughpostgres_extra_settings.Follow-ups (not in this PR)
postgres_keep_pvc_after_upgradeis documented and defaulted but not referenced by any task (same upstream). Old PVCs are always kept.POSTGRESQL_EXTENSIONSon every start; apostgres_extensionsCR field would makepg_stat_statementsa one-liner.Testing
yamllinton changed YAMLstatus.upgradedPostgresVersion: "18")