Chapter 8. Updating Red Hat Quay and the Red Hat Quay and Clair PostgreSQL databases on OpenShift Container Platform
Chapter 8. Updating Red Hat Quay and the Red Hat Quay and Clair PostgreSQL databases on OpenShift Container Platform Important If your Red Hat Quay deployment is upgrading from one y-stream to the , for example, from 3.8.10 3.8.11, you must not switch the upgrade channel from stable-3.8 to stable-3.9 . Changing the upgrade channel in the middle of a y-stream upgrade will disallow Red Hat Quay from upgrading to 3.9. This is a known issue and will be fixed in a future version of Red Hat Quay. When updating Red Hat Quay 3.8 3.9, the Operator automatically upgrades the existing PostgreSQL databases for Clair and Red Hat Quay from version 10 to version 13. Important Users with a managed database are required to upgrade their PostgreSQL database from 10 13. If your Red Hat Quay and Clair databases are managed by the Operator, the database upgrades for each component must succeed for the 3.9.0 upgrade to be successful. If either of the database upgrades fail, the entire Red Hat Quay version upgrade fails. This behavior is expected. You can update Red Hat Quay and the Red Hat Quay and Clair PostgreSQL databases on OpenShift Container Platform by using the Web Console UI, or by using the CLI. 8.1. Updating Red Hat Quay and the Red Hat Quay and Clair PostgreSQL databases using the OpenShift Container Platform web console Use the following procedure to update Red Hat Quay and the Red Hat Quay and Clair PostgreSQL databases using the OpenShift Container Platform web console. Important This upgrade is irreversible. It is highly recommended that you upgrade to PostgreSQL 13. PostgreSQL 10 had its final release on November 10, 2022 and is no longer supported. For more information, see the PostgreSQL Versioning Policy . If your Red Hat Quay and Clair databases are managed by the Operator, the database upgrades for each component must succeed for the 3.9.0 upgrade to be successful. If either of the database upgrades fail, the entire Red Hat Quay version upgrade fails. This behavior is expected. By default, Red Hat Quay is configured to remove old persistent volume claims (PVCs) from PostgreSQL 10. To disable this setting and backup old PVCs, you must set POSTGRES_UPGRADE_RETAIN_BACKUP to True in your quay-operator Subscription object. Prerequisites You have installed Red Hat Quay 3.6, 3.7, or 3.8 on OpenShift Container Platform. 100 GB of free, additional storage. During the upgrade process, additional persistent volume claims (PVCs) are provisioned to store the migrated data. This helps prevent a destructive operation on user data. The upgrade process rolls out PVCs for 50 GB for both the Red Hat Quay database upgrade, and the Clair database upgrade. Procedure Optional. Back up your old PVCs from PostgreSQL 10 by setting POSTGRES_UPGRADE_RETAIN_BACKUP to True your quay-operator Subscription object. For example: apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: quay-operator namespace: quay-enterprise spec: channel: stable-3.8 name: quay-operator source: redhat-operators sourceNamespace: openshift-marketplace config: env: - name: POSTGRES_UPGRADE_RETAIN_BACKUP value: "true" In the OpenShift Container Platform Web Console, navigate to Operators Installed Operators . Click on the Red Hat Quay Operator. Navigate to the Subscription tab. Under Subscription details click Update channel . Select stable-3.9 and save the changes. Check the progress of the new installation under Upgrade status . Wait until the upgrade status changes to 1 installed before proceeding. In your OpenShift Container Platform cluster, navigate to Workloads Pods . Existing pods should be terminated, or in the process of being terminated. Wait for the following pods, which are responsible for upgrading the database and alembic migration of existing data, to spin up: clair-postgres-upgrade , quay-postgres-upgrade , and quay-app-upgrade . After the clair-postgres-upgrade , quay-postgres-upgrade , and quay-app-upgrade pods are marked as Completed , the remaining pods for your Red Hat Quay deployment spin up. This takes approximately ten minutes. Verify that the quay-database and clair-postgres pods now use the postgresql-13 image. After the quay-app pod is marked as Running , you can reach your Red Hat Quay registry. 8.2. Updating Red Hat Quay and the Red Hat Quay and Clair PostgreSQL databases using the CLI Use the following procedure to update Red Hat Quay and the Red Hat Quay and Clair PostgreSQL databases using the command-line interface (CLI). Important This upgrade is irreversible. It is highly recommended that you upgrade to PostgreSQL 13. PostgreSQL 10 had its final release on November 10, 2022 and is no longer supported. For more information, see the PostgreSQL Versioning Policy . By default, Red Hat Quay is configured to remove old persistent volume claims (PVCs) from PostgreSQL 10. To disable this setting and backup old PVCs, you must set POSTGRES_UPGRADE_RETAIN_BACKUP to True in your quay-operator Subscription object. Prerequisites You have installed Red Hat Quay 3.6, 3.7, or 3.8 on OpenShift Container Platform. 100 GB of free, additional storage. During the upgrade process, additional persistent volume claims (PVCs) are provisioned to store the migrated data. This helps prevent a destructive operation on user data. The upgrade process rolls out PVCs for 50 GB for both the Red Hat Quay database upgrade, and the Clair database upgrade. Procedure Retrieve your quay-operator configuration file by entering the following oc get command: USD oc get subscription quay-operator -n quay-enterprise -o yaml > quay-operator.yaml Retrieve the latest version of the Red Hat Quay Operator and its channel by entering the following command: oc get packagemanifests quay-operator \ -o jsonpath='{range .status.channels[*]}{@.currentCSV} {@.name}{"\n"}{end}' \ | awk '{print "STARTING_CSV=" USD1 " CHANNEL=" USD2 }' \ | sort -nr \ | head -1 Example output STARTING_CSV=quay-operator.v3.9.0 CHANNEL=stable-3.9 Using the output from the command, update your Subscription custom resource for the Red Hat Quay Operator and save it as quay-operator.yaml . For example: apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: quay-operator namespace: quay-enterprise spec: channel: stable-3.9 1 name: quay-operator source: redhat-operators sourceNamespace: openshift-marketplace config: env: - name: POSTGRES_UPGRADE_RETAIN_BACKUP 2 value: "true" 1 Specify the value you obtained in the step for the spec.channel parameter. 2 Optional. Back up your old PVCs from PostgreSQL 10 by setting POSTGRES_UPGRADE_RETAIN_BACKUP to True your quay-operator Subscription object. Enter the following command to apply the configuration: USD oc apply -f quay-operator.yaml Example output subscription.operators.coreos.com/quay-operator created steps Red Hat Quay features
apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: quay-operator namespace: quay-enterprise spec: channel: stable-3.8 name: quay-operator source: redhat-operators sourceNamespace: openshift-marketplace config: env: - name: POSTGRES_UPGRADE_RETAIN_BACKUP value: "true" oc get subscription quay-operator -n quay-enterprise -o yaml > quay-operator.yaml get packagemanifests quay-operator -o jsonpath='{range .status.channels[*]}{@.currentCSV} {@.name}{"\n"}{end}' | awk '{print "STARTING_CSV=" USD1 " CHANNEL=" USD2 }' | sort -nr | head -1 STARTING_CSV=quay-operator.v3.9.0 CHANNEL=stable-3.9 apiVersion: operators.coreos.com/v1alpha1 kind: Subscription metadata: name: quay-operator namespace: quay-enterprise spec: channel: stable-3.9 1 name: quay-operator source: redhat-operators sourceNamespace: openshift-marketplace config: env: - name: POSTGRES_UPGRADE_RETAIN_BACKUP 2 value: "true" oc apply -f quay-operator.yaml subscription.operators.coreos.com/quay-operator created