diff --git a/README.md b/README.md index c8989b49fa..381eff60f0 100644 --- a/README.md +++ b/README.md @@ -519,7 +519,7 @@ spec: #### Postgres Version -The default Postgres version for the version of AWX bundled with the latest version of the awx-operator is Postgres 13. You can find this default for a given version by at the default value for [_postgres_image_version](./roles/installer/defaults/main.yml#L138). +The default Postgres version for the version of AWX bundled with the latest version of the awx-operator is Postgres 15. You can find this default for a given version by at the default value for [_postgres_image_version](./roles/installer/defaults/main.yml#L138). We only have coverage for the default version of Postgres. Newer versions of Postgres (14+) 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. @@ -575,7 +575,7 @@ The following variables are customizable for the managed PostgreSQL service | Name | Description | Default | | --------------------------------------------- | --------------------------------------------- | ---------------------------------- | -| postgres_image | Path of the image to pull | postgres:12 | +| postgres_image | Path of the image to pull | postgres:15 | | postgres_init_container_resource_requirements | Database init container resource requirements | requests: {cpu: 10m, memory: 64Mi} | | postgres_resource_requirements | PostgreSQL container resource requirements | requests: {cpu: 10m, memory: 64Mi} | | postgres_storage_requirements | PostgreSQL container storage requirements | requests: {storage: 8Gi} | @@ -780,7 +780,7 @@ example, specifying `task_tolerations` will allow the AWX task pod to be schedul | Name | Description | Default | | -------------------------------- | ---------------------------------------- | ------- | | postgres_image | Path of the image to pull | postgres | -| postgres_image_version | Image version to pull | 13 | +| postgres_image_version | Image version to pull | 15 | | node_selector | AWX pods' nodeSelector | '' | | web_node_selector | AWX web pods' nodeSelector | '' | | task_node_selector | AWX task pods' nodeSelector | '' | @@ -1412,7 +1412,7 @@ The first part of any upgrade should be a backup. Note, there are secrets in the In the event you need to recover the backup see the [restore role documentation](https://github.com/ansible/awx-operator/tree/devel/roles/restore). *Before Restoring from a backup*, be sure to: * delete the old existing AWX CR -* delete the persistent volume claim (PVC) for the database from the old deployment, which has a name like `postgres-13--postgres-13-0` +* delete the persistent volume claim (PVC) for the database from the old deployment, which has a name like `postgres-15--postgres-15-0` **Note**: Do not delete the namespace/project, as that will delete the backup and the backup's PVC as well. diff --git a/roles/backup/vars/main.yml b/roles/backup/vars/main.yml index 04872867c4..766a72a1ad 100644 --- a/roles/backup/vars/main.yml +++ b/roles/backup/vars/main.yml @@ -1,8 +1,8 @@ --- deployment_type: "awx" _postgres_image: postgres -_postgres_image_version: 13 +_postgres_image_version: 15 backup_complete: false database_type: "unmanaged" -supported_pg_version: 13 +supported_pg_version: 15 image_pull_policy: IfNotPresent diff --git a/roles/installer/defaults/main.yml b/roles/installer/defaults/main.yml index f7a541cbe7..366a82b334 100644 --- a/roles/installer/defaults/main.yml +++ b/roles/installer/defaults/main.yml @@ -240,7 +240,7 @@ _image_version: "{{ lookup('env', 'DEFAULT_AWX_VERSION') or 'latest' }}" _redis_image: docker.io/redis _redis_image_version: 7 _postgres_image: postgres -_postgres_image_version: 13 +_postgres_image_version: 15 image_pull_policy: IfNotPresent image_pull_secrets: [] diff --git a/roles/installer/tasks/database_configuration.yml b/roles/installer/tasks/database_configuration.yml index 66a6d7d7ae..2ac57e53b0 100644 --- a/roles/installer/tasks/database_configuration.yml +++ b/roles/installer/tasks/database_configuration.yml @@ -123,7 +123,7 @@ namespace: "{{ ansible_operator_meta.namespace }}" register: this_awx -- name: Check if postgres pod is running and version 12 +- name: Check if postgres pod is running an older version block: - name: Set path to PG_VERSION file for given container image set_fact: @@ -139,13 +139,13 @@ """ register: _old_pg_version - - name: Upgrade data dir from Postgres 12 to 13 if applicable + - name: Upgrade data dir from old Postgres to {{ supported_pg_version }} if applicable include_tasks: upgrade_postgres.yml when: - - _old_pg_version.stdout | default('0') | trim == '12' + - _old_pg_version.stdout | default('0') | trim < supported_pg_version when: - managed_database - - this_awx['resources'][0]['status']['upgradedPostgresVersion'] | default('none') != '12' + - this_awx['resources'][0]['status']['upgradedPostgresVersion'] | default('none') < supported_pg_version - old_postgres_pod['resources'] | length # upgrade is complete and old pg pod has been removed - block: @@ -167,7 +167,7 @@ kubernetes.core.k8s_scale: api_version: apps/v1 kind: StatefulSet - name: "{{ ansible_operator_meta.name }}-postgres-13" + name: "{{ ansible_operator_meta.name }}-postgres-15" namespace: "{{ ansible_operator_meta.namespace }}" replicas: 0 wait: yes @@ -177,7 +177,7 @@ state: absent api_version: apps/v1 kind: StatefulSet - name: "{{ ansible_operator_meta.name }}-postgres-13" + name: "{{ ansible_operator_meta.name }}-postgres-15" namespace: "{{ ansible_operator_meta.namespace }}" wait: yes when: create_statefulset_result.error == 422 diff --git a/roles/installer/tasks/upgrade_postgres.yml b/roles/installer/tasks/upgrade_postgres.yml index 5edae0764a..c536c46b2d 100644 --- a/roles/installer/tasks/upgrade_postgres.yml +++ b/roles/installer/tasks/upgrade_postgres.yml @@ -1,9 +1,9 @@ --- # Upgrade Posgres (Managed Databases only) -# * If postgres version is not 12, and not an external postgres instance (when managed_database is yes), +# * 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 pod to the postgres 13 +# * Data will be streamed via a pg_dump from the postgres 12/13 pod to the postgres supported_pg_version # pod via a pg_restore. @@ -102,7 +102,7 @@ - name: Set flag signifying that this instance has been migrated set_fact: - upgraded_postgres_version: '13' + upgraded_postgres_version: '{{ supported_pg_version }}' # Cleanup old Postgres resources - name: Remove old Postgres StatefulSet diff --git a/roles/installer/templates/statefulsets/postgres.yaml.j2 b/roles/installer/templates/statefulsets/postgres.yaml.j2 index 89aa30d92f..5eb297d457 100644 --- a/roles/installer/templates/statefulsets/postgres.yaml.j2 +++ b/roles/installer/templates/statefulsets/postgres.yaml.j2 @@ -55,7 +55,7 @@ spec: args: {{ postgres_extra_args }} {% endif %} env: - # For postgres_image based on rhel8/postgresql-13 + # For postgres_image based on rhel8/postgresql-{{ supported_pg_version }} - name: POSTGRESQL_DATABASE valueFrom: secretKeyRef: diff --git a/roles/installer/vars/main.yml b/roles/installer/vars/main.yml index 8c341b2c16..16c332c27a 100644 --- a/roles/installer/vars/main.yml +++ b/roles/installer/vars/main.yml @@ -4,4 +4,4 @@ postgres_host_auth_method: 'scram-sha-256' ldap_cacert_ca_crt: '' bundle_ca_crt: '' projects_existing_claim: '' -supported_pg_version: 13 +supported_pg_version: 15 diff --git a/roles/restore/README.md b/roles/restore/README.md index aaf94ea4aa..30ded3aa93 100644 --- a/roles/restore/README.md +++ b/roles/restore/README.md @@ -19,7 +19,7 @@ This role assumes you are authenticated with an Openshift or Kubernetes cluster: *Before Restoring from a backup*, be sure to: - delete the old existing AWX CR - - delete the persistent volume claim (PVC) for the database from the old deployment, which has a name like `postgres-13--postgres-13-0` + - delete the persistent volume claim (PVC) for the database from the old deployment, which has a name like `postgres-15--postgres-15-0` **Note**: Do not delete the namespace/project, as that will delete the backup and the backup's PVC as well. diff --git a/roles/restore/vars/main.yml b/roles/restore/vars/main.yml index 94ccf9de0f..64dcbbc37e 100644 --- a/roles/restore/vars/main.yml +++ b/roles/restore/vars/main.yml @@ -2,7 +2,7 @@ deployment_type: "awx" _postgres_image: postgres -_postgres_image_version: 13 +_postgres_image_version: 15 backup_api_version: '{{ deployment_type }}.ansible.com/v1beta1' backup_kind: 'AWXBackup' @@ -12,5 +12,5 @@ secret_key_secret: '{{ deployment_name }}-secret-key' admin_password_secret: '{{ deployment_name }}-admin-password' broadcast_websocket_secret: '{{ deployment_name }}-broadcast-websocket' postgres_configuration_secret: '{{ deployment_name }}-postgres-configuration' -supported_pg_version: 13 +supported_pg_version: 15 image_pull_policy: IfNotPresent