diff --git a/_topic_maps/_topic_map.yml b/_topic_maps/_topic_map.yml index b1405326defa..c84012ab1b3f 100644 --- a/_topic_maps/_topic_map.yml +++ b/_topic_maps/_topic_map.yml @@ -3680,8 +3680,12 @@ Topics: - Name: OADP and 3scale Dir: oadp-3scale Topics: - - Name: Backing up and restoring 3scale by using OADP - File: backing-up-and-restoring-3scale-by-using-oadp + - Name: Backing up and restoring 3scale API Management by using OADP + File: backing-up-and-restoring-3scale-api-management-by-using-oadp + - Name: Backing up 3scale API Management by using OADP + File: backing-up-3scale-api-management-by-using-oadp + - Name: Restoring 3scale API Management by using OADP + File: restoring-3scale-api-management-by-using-oadp - Name: OADP Data Mover Dir: installing Topics: diff --git a/backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-3scale-api-management-by-using-oadp.adoc b/backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-3scale-api-management-by-using-oadp.adoc new file mode 100644 index 000000000000..38c62d67319c --- /dev/null +++ b/backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-3scale-api-management-by-using-oadp.adoc @@ -0,0 +1,31 @@ +:_mod-docs-content-type: ASSEMBLY +[id="backing-up-3scale-api-management-by-using-oadp"] += Backing up 3scale API Management by using OADP +include::_attributes/common-attributes.adoc[] +:context: backing-up-3scale-api-management-by-using-oadp +:3scaleProductVersion: 2.15 +:3scaleDocInfoProductName: red_hat_3scale_api_management +:Link3scaleInstalling3scale: https://docs.redhat.com/en/documentation/{3scaleDocInfoProductName}/{3scaleProductVersion}/html-single/installing_red_hat_3scale_api_management/index + +toc::[] + +You can back up Red{nbsp}Hat 3scale API Management components by backing up the 3scale operator, and databases such as MySQL and Redis. + +.Prerequisites + +* You installed and configured Red{nbsp}Hat 3scale API Management. For more information, see link:{Link3scaleInstalling3scale}#install-threescale-on-openshift-guide[Installing 3scale API Management on OpenShift] and link:https://docs.redhat.com/en/documentation/red_hat_3scale_api_management[Red Hat 3scale API Management]. + +include::modules/creating-the-data-protection-application.adoc[leveloffset=+1] +[role="_additional-resources"] +.Additional resources +* xref:../../../backup_and_restore/application_backup_and_restore/installing/installing-oadp-aws.adoc#oadp-installing-dpa_installing-oadp-aws[Installing the Data Protection Application] + +include::modules/backing-up-the-3scale-operator-secret-apimanager.adoc[leveloffset=+1] + +[role="_additional-resources"] +.Additional resources +* xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-creating-backup-cr.adoc#oadp-creating-backup-cr-doc[Creating a Backup CR] + +include::modules/backing-up-the-mysql-database.adoc[leveloffset=+1] + +include::modules/backing-up-the-backend-redis-database.adoc[leveloffset=+1] \ No newline at end of file diff --git a/backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-and-restoring-3scale-api-management-by-using-oadp.adoc b/backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-and-restoring-3scale-api-management-by-using-oadp.adoc new file mode 100644 index 000000000000..021db02dddf9 --- /dev/null +++ b/backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-and-restoring-3scale-api-management-by-using-oadp.adoc @@ -0,0 +1,27 @@ +:_mod-docs-content-type: ASSEMBLY +[id="backing-up-and-restoring-3scale-api-management-by-using-oadp"] += Backing up and restoring 3scale API Management by using OADP +include::_attributes/common-attributes.adoc[] +:context: backing-up-and-restoring-3scale-api-management-by-using-oadp + +toc::[] + +With Red{nbsp}Hat 3scale API Management, you can manage your APIs for internal or external users. +You can deploy 3scale components on-premise, in the cloud, as a managed service, or in any combination based on your requirements. + +With {oadp-first}, you can safeguard 3scale API Management deployments by backing up application resources, persistent volumes, and configurations. + +[NOTE] +==== +You can use the {oadp-first} Operator to back up and restore your 3scale API Management on-cluster storage databases without affecting your running services +==== + +You can configure OADP to perform the following operations with 3scale API Management: + +* Create a backup of 3scale components by following the steps in xref:../../../backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-3scale-api-management-by-using-oadp.adoc#backing-up-3scale-api-management-by-using-oadp[Backing up 3scale API Management]. +* Restore the components to scale up the 3scale operator and deployment by following the steps in xref:../../../backup_and_restore/application_backup_and_restore/oadp-3scale/restoring-3scale-api-management-by-using-oadp.adoc#restoring-3scale-api-management-by-using-oadp[Restoring 3scale API Management]. + + + + + diff --git a/backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-and-restoring-3scale-by-using-oadp.adoc b/backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-and-restoring-3scale-by-using-oadp.adoc deleted file mode 100644 index 7381a8a42e7a..000000000000 --- a/backup_and_restore/application_backup_and_restore/oadp-3scale/backing-up-and-restoring-3scale-by-using-oadp.adoc +++ /dev/null @@ -1,43 +0,0 @@ -:_mod-docs-content-type: ASSEMBLY -[id="backing-up-and-restoring-3scale-by-using-oadp_{context}"] -= Backing up and restoring 3scale by using OADP -include::_attributes/common-attributes.adoc[] -:context: backing-up-and-restoring-3scale-by-using-oadp - -toc::[] - -With Red Hat 3scale API Management (APIM), you can manage your APIs for internal or external users. Share, secure, distribute, control, and monetize your APIs on an infrastructure platform built with performance, customer control, and future growth in mind. -You can deploy 3scale components on-premise, in the cloud, as a managed service, or in any combination based on your requirement. - -[NOTE] -==== -In this example, the non-service affecting approach is used to back up and restore 3scale on-cluster storage by using the {oadp-first} Operator. -Additionally, ensure that you are restoring 3scale on the same cluster where it was backed up from. If you want to restore 3scale on a different cluster, ensure that both clusters are using the same custom domain. -==== - -.Prerequisites - -* You installed and configured Red Hat 3scale. For more information, see link:https://docs.redhat.com/en/documentation/red_hat_3scale_api_management/2.15/html/installing_red_hat_3scale_api_management[Red Hat 3scale API Management]. - -include::modules/creating-the-data-protection-application.adoc[leveloffset=+1] -[role="_additional-resources"] -.Additional resources -* xref:../../../backup_and_restore/application_backup_and_restore/installing/installing-oadp-aws.adoc#oadp-installing-dpa_installing-oadp-aws[Installing the Data Protection Application] - -include::modules/backing-up-the-3scale-operator.adoc[leveloffset=+1] - -[role="_additional-resources"] -.Additional resources -* xref:../../../backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-creating-backup-cr.adoc#oadp-creating-backup-cr-doc[Creating a Backup CR] - -include::modules/backing-up-the-mysql-database.adoc[leveloffset=+1] - -include::modules/backing-up-the-backend-redis-database.adoc[leveloffset=+1] - -include::modules/restoring-the-secrets-and-apimanager.adoc[leveloffset=+1] - -include::modules/restoring-the-mysql-database.adoc[leveloffset=+1] - -include::modules/restoring-the-backend-redis-database.adoc[leveloffset=+1] - -include::modules/scaling-up-the-3scale-operator-and-deployment.adoc[leveloffset=+1] \ No newline at end of file diff --git a/backup_and_restore/application_backup_and_restore/oadp-3scale/restoring-3scale-api-management-by-using-oadp.adoc b/backup_and_restore/application_backup_and_restore/oadp-3scale/restoring-3scale-api-management-by-using-oadp.adoc new file mode 100644 index 000000000000..9326a37459e8 --- /dev/null +++ b/backup_and_restore/application_backup_and_restore/oadp-3scale/restoring-3scale-api-management-by-using-oadp.adoc @@ -0,0 +1,32 @@ +:_mod-docs-content-type: ASSEMBLY +[id="restoring-3scale-api-management-by-using-oadp"] += Restoring 3scale API Management by using OADP +include::_attributes/common-attributes.adoc[] +:context: restoring-3scale-api-management-by-using-oadp +:3scaleProductVersion: 2.15 +:3scaleDocInfoProductName: red_hat_3scale_api_management +:Link3scaleInstalling3scale: https://docs.redhat.com/en/documentation/{3scaleDocInfoProductName}/{3scaleProductVersion}/html-single/installing_red_hat_3scale_api_management/index + +toc::[] + +You can restore Red{nbsp}Hat 3scale API Management components by restoring the backed up 3scale operator resources. You can also restore databases such as MySQL and Redis. + +After the data has been restored, you can scale up the 3scale operator and deployment. + +.Prerequisites + +* You installed and configured Red{nbsp}Hat 3scale API Management. For more information, see link:{Link3scaleInstalling3scale}#install-threescale-on-openshift-guide[Installing 3scale API Management on OpenShift] and link:https://docs.redhat.com/en/documentation/red_hat_3scale_api_management[Red Hat 3scale API Management]. + +* You backed up the 3scale operator, and databases such as MySQL and Redis. + +* Ensure that you are restoring 3scale on the same cluster where it was backed up from. + +* If you want to restore 3scale on a different cluster, ensure that the original backed-up cluster and the cluster you want to restore the operator on are using the same custom domain. + +include::modules/restoring-the-3scale-api-management-operator-secrets-and-apimanager.adoc[leveloffset=+1] + +include::modules/restoring-the-mysql-database.adoc[leveloffset=+1] + +include::modules/restoring-the-backend-redis-database.adoc[leveloffset=+1] + +include::modules/scaling-up-the-3scale-api-management-operator-and-deployment.adoc[leveloffset=+1] \ No newline at end of file diff --git a/modules/backing-up-the-3scale-operator.adoc b/modules/backing-up-the-3scale-operator-secret-apimanager.adoc similarity index 55% rename from modules/backing-up-the-3scale-operator.adoc rename to modules/backing-up-the-3scale-operator-secret-apimanager.adoc index 2360281b88d5..e74139107194 100644 --- a/modules/backing-up-the-3scale-operator.adoc +++ b/modules/backing-up-the-3scale-operator-secret-apimanager.adoc @@ -1,11 +1,11 @@ :_mod-docs-content-type: PROCEDURE -//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly +//included in backing-up-3scale-api-management-by-using-oadp.adoc assembly -[id="backing-up-the-3scale-operator_{context}"] -= Backing up the 3scale Operator +[id="backing-up-the-3scale-operator-secret-apimanager_{context}"] += Backing up the 3scale API Management operator, secret, and APIManager -You can back up the Operator resources, and Secret and APIManager custom resources (CR). For more information, see "Creating a Backup CR". +You can back up the Red{nbsp}Hat 3scale API Management operator resources, and both the `Secret` and APIManager custom resource (CR). .Prerequisites @@ -13,7 +13,7 @@ You can back up the Operator resources, and Secret and APIManager custom resourc .Procedure -. Back up the Operator resources, such as `operatorgroup`, `namespaces`, and `subscriptions`, by creating a YAML file with the following configuration: +. Back up your 3scale operator CRs, such as `operatorgroup`, `namespaces`, and `subscriptions`, by creating a YAML file with the following configuration: + .Example `backup.yaml` file + @@ -22,13 +22,13 @@ You can back up the Operator resources, and Secret and APIManager custom resourc apiVersion: velero.io/v1 kind: Backup metadata: - name: operator-install-backup + name: operator-install-backup <1> namespace: openshift-adp spec: csiSnapshotTimeout: 10m0s defaultVolumesToFsBackup: false includedNamespaces: - - threescale <1> + - threescale <2> includedResources: - operatorgroups - subscriptions @@ -37,7 +37,8 @@ spec: snapshotMoveData: false ttl: 720h0m0s ---- -<1> Namespace where the 3scale Operator is installed. +<1> The value of the `metadata.name` parameter in the backup is the same value used in the `metadata.backupName` parameter used when restoring the 3scale operator. +<2> Namespace where the 3scale operator is installed. + [NOTE] ==== @@ -50,8 +51,15 @@ You can also back up and restore `ReplicationControllers`, `Deployment`, and `Po ---- $ oc create -f backup.yaml ---- ++ +.Example output ++ +[source,terminal] +---- +backup.velero.io/operator-install-backup created +---- -. Back up the Secret CR by creating a YAML file with the following configuration: +. Back up the `Secret` CR by creating a YAML file with the following configuration: + .Example `backup-secret.yaml` file + @@ -60,7 +68,7 @@ $ oc create -f backup.yaml apiVersion: velero.io/v1 kind: Backup metadata: - name: operator-resources-secrets + name: operator-resources-secrets <1> namespace: openshift-adp spec: csiSnapshotTimeout: 10m0s @@ -77,13 +85,21 @@ spec: snapshotVolumes: false ttl: 720h0m0s ---- +<1> The value of the `metadata.name` parameter in the backup is the same value used in the `metadata.backupName` parameter used when restoring the `Secret`. -. Create the Secret CR by running the following command: +. Create the `Secret` backup CR by running the following command: + [source,terminal] ---- $ oc create -f backup-secret.yaml ---- ++ +.Example output ++ +[source,terminal] +---- +backup.velero.io/operator-resources-secrets created +---- . Back up the APIManager CR by creating a YAML file with the following configuration: + @@ -93,7 +109,7 @@ $ oc create -f backup-secret.yaml apiVersion: velero.io/v1 kind: Backup metadata: - name: operator-resources-apim + name: operator-resources-apim <1> namespace: openshift-adp spec: csiSnapshotTimeout: 10m0s @@ -110,6 +126,7 @@ spec: volumeSnapshotLocations: - ts-dpa-1 ---- +<1> The value of the `metadata.name` parameter in the backup is the same value used in the `metadata.backupName` parameter used when restoring the APIManager. . Create the APIManager CR by running the following command: + @@ -117,7 +134,10 @@ spec: ---- $ oc create -f backup-apimanager.yaml ---- - -.Next steps - -* Back up the `mysql` database. \ No newline at end of file ++ +.Example output ++ +[source,terminal] +---- +backup.velero.io/operator-resources-apim created +---- \ No newline at end of file diff --git a/modules/backing-up-the-backend-redis-database.adoc b/modules/backing-up-the-backend-redis-database.adoc index 5848d9f81e9d..e27f3af02f72 100644 --- a/modules/backing-up-the-backend-redis-database.adoc +++ b/modules/backing-up-the-backend-redis-database.adoc @@ -1,6 +1,6 @@ :_mod-docs-content-type: PROCEDURE -//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly +//included in backing-up-3scale-api-management-by-using-oadp.adoc assembly [id="backing-up-the-backend-redis-database_{context}"] = Backing up the back-end Redis database @@ -10,8 +10,8 @@ You can back up the Redis database by adding the required annotations and by lis .Prerequisites -* You backed up the 3scale Operator. -* You backed up the mysql database. +* You backed up the Red{nbsp}Hat 3scale API Management operator. +* You backed up your MySQL database. * The Redis queues have been drained before performing the backup. @@ -23,8 +23,6 @@ You can back up the Redis database by adding the required annotations and by lis ---- $ oc edit deployment backend-redis -n threescale ---- - -. Add the following annotations: + [source,yaml] ---- @@ -46,7 +44,7 @@ post.hook.backup.velero.io/command: >- apiVersion: velero.io/v1 kind: Backup metadata: - name: redis-backup + name: redis-backup <1> namespace: openshift-adp spec: csiSnapshotTimeout: 10m0s @@ -69,23 +67,44 @@ spec: snapshotVolumes: false ttl: 720h0m0s ---- +<1> The value of the `metadata.name` parameter in the backup is the same value used in the `metadata.backupName` parameter used when restoring the restoring the Redis database. . Back up the Redis database by running the following command: + [source,terminal] ---- -$ oc get backups.velero.io redis-backup -o yaml +$ oc create -f redis-backup.yaml +---- ++ +.Example output: ++ +[source,terminal] ---- +backup.velero.io/redis-backup created +---- + .Verification -* Verify that the Redis backup is completed by running the following command:: +* Verify that the Redis backup is completed by running the following command: + [source,terminal] ---- -$ oc get backups.velero.io +$ oc get backups.velero.io redis-backup -o yaml ---- - -.Next steps - -* Restore the Secrets and APIManager CRs. \ No newline at end of file ++ +.Example output: ++ +[source,terminal] +---- +status: +completionTimestamp: "2025-04-17T13:25:19Z" +errors: 1 +expiration: "2025-05-17T13:25:16Z" +formatVersion: 1.1.0 +hookStatus: {} +phase: Completed +progress: {} +startTimestamp: "2025-04-17T13:25:16Z" +version: 1 +---- \ No newline at end of file diff --git a/modules/backing-up-the-mysql-database.adoc b/modules/backing-up-the-mysql-database.adoc index e7470f470f38..68c7052f7646 100644 --- a/modules/backing-up-the-mysql-database.adoc +++ b/modules/backing-up-the-mysql-database.adoc @@ -1,15 +1,15 @@ :_mod-docs-content-type: PROCEDURE -//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly +//included in backing-up-3scale-api-management-by-using-oadp.adoc assembly [id="backing-up-the-mysql-database_{context}"] -= Backing up the mysql database += Backing up a MySQL database -You can back up the `mysql` database by creating and attaching a persistent volume claim (PVC) to include the dumped data in the specified path. +You can back up a MySQL database by creating and attaching a persistent volume claim (PVC) to include the dumped data in the specified path. .Prerequisites -* You have backed up the 3scale operator. +* You have backed up the Red{nbsp}Hat 3scale API Management operator. .Procedure @@ -40,7 +40,7 @@ spec: $ oc create -f ts_pvc.yml ---- -. Attach the PVC to the system database pod by editing the system database deployment to use the `mysql` dump: +. Attach the PVC to the system database pod by editing the `system-mysql` deployment to use the MySQL dump: + [source,terminal] ---- @@ -68,7 +68,7 @@ $ oc edit deployment system-mysql -n threescale ---- <1> The PVC that contains the dumped data. -. Create a YAML file with following configuration to back up the `mysql` database: +. Create a YAML file with following configuration to back up the MySQL database: + .Example `mysql.yaml` file + @@ -77,7 +77,7 @@ $ oc edit deployment system-mysql -n threescale apiVersion: velero.io/v1 kind: Backup metadata: - name: mysql-backup + name: mysql-backup <1> namespace: openshift-adp spec: csiSnapshotTimeout: 10m0s @@ -91,13 +91,13 @@ spec: - /bin/sh - -c - mysqldump -u $MYSQL_USER --password=$MYSQL_PASSWORD system --no-tablespaces - > /var/lib/mysqldump/data/dump.sql <1> + > /var/lib/mysqldump/data/dump.sql <2> container: system-mysql onError: Fail timeout: 5m - includedNamespaces: <2> + includedNamespaces: - threescale - includedResources: + includedResources: <3> - deployment - pods - replicationControllers @@ -111,34 +111,45 @@ spec: snapshotMoveData: false ttl: 720h0m0s ---- -<1> A directory where the data is backed up. -<2> Resources to back up. +<1> The value of the `metadata.name` parameter in the backup is the same value used in the `metadata.backupName` parameter used when restoring the MySQL database. +<2> A directory where the data is backed up. +<3> Resources to back up. -. Back up the `mysql` database by running the following command: +. Back up the MySQL database by running the following command: + [source,terminal] ---- $ oc create -f mysql.yaml ---- ++ +.Example output ++ +[source,terminal] +---- +backup.velero.io/mysql-backup created +---- .Verification -* Verify that the `mysql` backup is completed by running the following command: +* Verify that the MySQL backup is completed by running the following command: + [source,terminal] ---- -$ oc get backups.velero.io mysql-backup +$ oc get backups.velero.io mysql-backup -o yaml ---- + .Example output + [source,terminal] ---- -NAME STATUS CREATED NAMESPACE POD VOLUME UPLOADER TYPE STORAGE LOCATION AGE -mysql-backup-4g7qn Completed 30s threescale system-mysql-2-9pr44 example-claim kopia ts-dpa-1 30s -mysql-backup-smh85 Completed 23s threescale system-mysql-2-9pr44 mysql-storage kopia ts-dpa-1 30s ----- - -.Next steps - -* Back up the back-end Redis database. \ No newline at end of file +status: +completionTimestamp: "2025-04-17T13:25:19Z" +errors: 1 +expiration: "2025-05-17T13:25:16Z" +formatVersion: 1.1.0 +hookStatus: {} +phase: Completed +progress: {} +startTimestamp: "2025-04-17T13:25:16Z" +version: 1 +---- \ No newline at end of file diff --git a/modules/creating-the-data-protection-application.adoc b/modules/creating-the-data-protection-application.adoc index f9c353576f7a..4b36830bebe8 100644 --- a/modules/creating-the-data-protection-application.adoc +++ b/modules/creating-the-data-protection-application.adoc @@ -1,11 +1,11 @@ :_mod-docs-content-type: PROCEDURE -//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly +//included in backing-up-3scale-api-management-by-using-oadp.adoc assembly [id="creating-the-data-protection-application_{context}"] = Creating the Data Protection Application -You can create a Data Protection Application (DPA) custom resource (CR) for 3scale. For more information on DPA, see "Installing the Data Protection Application". +You can create a Data Protection Application (DPA) custom resource (CR) for Red{nbsp}Hat 3scale API Management. .Procedure @@ -18,7 +18,7 @@ You can create a Data Protection Application (DPA) custom resource (CR) for 3sca apiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication metadata: - name: dpa_sample + name: dpa-sample namespace: openshift-adp spec: configuration: @@ -58,8 +58,4 @@ spec: [source,terminal] ---- $ oc create -f dpa.yaml ----- - -.Next steps - -* Back up the 3scale Operator. \ No newline at end of file +---- \ No newline at end of file diff --git a/modules/restoring-the-secrets-and-apimanager.adoc b/modules/restoring-the-3scale-api-management-operator-secrets-and-apimanager.adoc similarity index 59% rename from modules/restoring-the-secrets-and-apimanager.adoc rename to modules/restoring-the-3scale-api-management-operator-secrets-and-apimanager.adoc index a67eef2fa470..df4de2e32400 100644 --- a/modules/restoring-the-secrets-and-apimanager.adoc +++ b/modules/restoring-the-3scale-api-management-operator-secrets-and-apimanager.adoc @@ -1,24 +1,24 @@ :_mod-docs-content-type: PROCEDURE -//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly +//included in restoring-3scale-api-management-by-using-oadp assembly -[id="restoring-the-secrets-and-apimanager_{context}"] -= Restoring the secrets and APIManager +[id="restoring-the-3scale-api-management-operator-secrets-and-apimanager_{context}"] += Restoring the 3scale API Management operator, secrets, and APIManager -You can restore the Secrets and APIManager by using the following procedure. +You can restore the Red{nbsp}Hat 3scale API Management operator resources, and both the `Secret` and APIManager custom resources (CRs) by using the following procedure. .Prerequisites -* You backed up the 3scale Operator. -* You backed up `mysql` and Redis databases. +* You backed up the 3scale operator. +* You backed up the MySQL and Redis databases. * You are restoring the database on the same cluster, where it was backed up. + -If it is on a different cluster, install and configure {oadp-short} with `nodeAgent` enabled on the destination cluster as it was on the source cluster. +If you are restoring the operator to a different cluster that you backed up from, install and configure {oadp-short} with `nodeAgent` enabled on the destination cluster. Ensure that the {oadp-short} configuration is same as it was on the source cluster. .Procedure -. Delete the 3scale Operator custom resource definitions (CRDs) along with the `threescale` namespace by running the following command: +. Delete the 3scale operator custom resource definitions (CRDs) along with the `threescale` namespace by running the following command: + [source,terminal] ---- @@ -32,7 +32,7 @@ $ oc delete project threescale "threescale" project deleted successfully ---- -. Create a YAML file with the following configuration to restore the 3scale Operator: +. Create a YAML file with the following configuration to restore the 3scale operator: + .Example `restore.yaml` file + @@ -44,7 +44,7 @@ metadata: name: operator-installation-restore namespace: openshift-adp spec: - backupName: operator-install-backup + backupName: operator-install-backup <1> excludedResources: - nodes - events @@ -57,15 +57,23 @@ spec: - backuprepositories.velero.io itemOperationTimeout: 4h0m0s ---- +<1> Restoring the 3scale operator's backup -. Restore the 3scale Operator by running the following command: +. Restore the 3scale operator by running the following command: + [source,terminal] ---- $ oc create -f restore.yaml ---- ++ +.Example output ++ +[source,terminal] +---- +restore.velerio.io/operator-installation-restore created +---- -. Manually create the `s3-credentials` Secret object by running the following command: +. Manually create the `s3-credentials` `Secret` object by running the following command: + [source,terminal] ---- @@ -89,14 +97,21 @@ EOF <3> Replace with your target bucket name. <4> Replace with the AWS region of your bucket. -. Scale down the 3scale Operator by running the following command: +. Scale down the 3scale operator by running the following command: + [source,terminal] ---- $ oc scale deployment threescale-operator-controller-manager-v2 --replicas=0 -n threescale ---- ++ +.Example output ++ +[source,terminal] +---- +deployment.apps/threescale-operator-controller-manager-v2 scaled +---- -. Create a YAML file with the following configuration to restore the Secrets: +. Create a YAML file with the following configuration to restore the `Secret`: + .Example `restore-secret.yaml` file + @@ -108,7 +123,7 @@ metadata: name: operator-resources-secrets namespace: openshift-adp spec: - backupName: operator-resources-secrets + backupName: operator-resources-secrets <1> excludedResources: - nodes - events @@ -121,13 +136,21 @@ spec: - backuprepositories.velero.io itemOperationTimeout: 4h0m0s ---- +<1> Restoring the `Secret` backup. -. Restore the Secrets by running the following command: +. Restore the `Secret` by running the following command: + [source,terminal] ---- $ oc create -f restore-secrets.yaml ---- ++ +.Example output ++ +[source,terminal] +---- +restore.velerio.io/operator-resources-secrets created +---- . Create a YAML file with the following configuration to restore APIManager: + @@ -140,8 +163,8 @@ metadata: name: operator-resources-apim namespace: openshift-adp spec: - backupName: operator-resources-apim - excludedResources: <1> + backupName: operator-resources-apim <1> + excludedResources: <2> - nodes - events - events.events.k8s.io @@ -153,7 +176,8 @@ spec: - backuprepositories.velero.io itemOperationTimeout: 4h0m0s ---- -<1> The resources that you do not want to restore. +<1> Restoring the APIManager backup. +<2> The resources that you do not want to restore. . Restore the APIManager by running the following command: + @@ -161,14 +185,24 @@ spec: ---- $ oc create -f restore-apimanager.yaml ---- ++ +.Example output ++ +[source,terminal] +---- +restore.velerio.io/operator-resources-apim created +---- -. Scale up the 3scale Operator by running the following command: +. Scale up the 3scale operator by running the following command: + [source,terminal] ---- $ oc scale deployment threescale-operator-controller-manager-v2 --replicas=1 -n threescale ---- - -.Next steps - -* Restore the `mysql` database. \ No newline at end of file ++ +.Example output ++ +[source,terminal] +---- +deployment.apps/threescale-operator-controller-manager-v2 scaled +---- \ No newline at end of file diff --git a/modules/restoring-the-backend-redis-database.adoc b/modules/restoring-the-backend-redis-database.adoc index 623d7272d0be..01a346d27c28 100644 --- a/modules/restoring-the-backend-redis-database.adoc +++ b/modules/restoring-the-backend-redis-database.adoc @@ -1,6 +1,6 @@ :_mod-docs-content-type: PROCEDURE -//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly +//included in restoring-3scale-api-management-by-using-oadp assembly [id="restoring-the-backend-redis-database_{context}"] = Restoring the back-end Redis database @@ -9,8 +9,8 @@ You can restore the back-end Redis database by deleting the deployment and speci .Prerequisites -* You restored the Secret and APIManager custom resources. -* You restored the `mysql` database. +* You restored the Red{nbsp}Hat 3scale API Management operator resources, `Secret`, and APIManager custom resources. +* You restored the MySQL database. .Procedure @@ -41,7 +41,7 @@ metadata: name: restore-backend namespace: openshift-adp spec: - backupName: redis-backup + backupName: redis-backup <1> excludedResources: - nodes - events @@ -55,6 +55,7 @@ spec: itemOperationTimeout: 1h0m0s restorePVs: true ---- +<1> Restoring the Redis backup. . Restore the Redis database by running the following command: + @@ -62,6 +63,13 @@ spec: ---- $ oc create -f restore-backend.yaml ---- ++ +.Example output ++ +[source,terminal] +---- +restore.velerio.io/restore-backend created +---- .Verification @@ -77,8 +85,4 @@ $ oc get podvolumerestores.velero.io -n openshift-adp ---- NAME NAMESPACE POD UPLOADER TYPE VOLUME STATUS TOTALBYTES BYTESDONE AGE restore-backend-jmrwx threescale backend-redis-1-bsfmv kopia backend-redis-storage Completed 76123 76123 21m ----- - -.Next steps - -* Scale the 3scale Operator and deployment. \ No newline at end of file +---- \ No newline at end of file diff --git a/modules/restoring-the-mysql-database.adoc b/modules/restoring-the-mysql-database.adoc index 7dabb625656b..6db14c702048 100644 --- a/modules/restoring-the-mysql-database.adoc +++ b/modules/restoring-the-mysql-database.adoc @@ -1,15 +1,15 @@ :_mod-docs-content-type: PROCEDURE -//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly +//included in restoring-3scale-api-management-by-using-oadp assembly [id="restoring-the-mysql-database_{context}"] -= Restoring the mysql database += Restoring a MySQL database -Restoring the `mysql` database re-creates the following resources: +Restoring a MySQL database re-creates the following resources: * The `Pod`, `ReplicationController`, and `Deployment` objects. * The additional persistent volumes (PVs) and associated persistent volume claims (PVCs). -* The `mysql` dump, which the `example-claim` PVC contains. +* The MySQL dump, which the `example-claim` PVC contains. [WARNING] ==== @@ -18,11 +18,11 @@ Do not delete the default PV and PVC associated with the database. If you do, yo .Prerequisites -* You restored the Secret and APIManager custom resources (CR). +* You restored the `Secret` and APIManager custom resources (CRs). .Procedure -. Scale down the 3scale Operator by running the following command: +. Scale down the Red{nbsp}Hat 3scale API Management operator by running the following command: + [source,terminal] ---- @@ -42,7 +42,7 @@ deployment.apps/threescale-operator-controller-manager-v2 scaled $ vi ./scaledowndeployment.sh ---- + -.Example output: +.Example script: [source,terminal] ---- for deployment in apicast-production apicast-staging backend-cron backend-listener backend-redis backend-worker system-app system-memcache system-mysql system-redis system-searchd system-sidekiq zync zync-database zync-que; do @@ -91,7 +91,7 @@ Warning: apps.openshift.io/v1 deployment is deprecated in v4.14+, unavailable in deployment.apps.openshift.io "system-mysql" deleted ---- -. Create the following YAML file to restore the `mysql` database: +. Create the following YAML file to restore the MySQL database: + .Example `restore-mysql.yaml` file [source,yaml] @@ -102,7 +102,7 @@ metadata: name: restore-mysql namespace: openshift-adp spec: - backupName: mysql-backup + backupName: mysql-backup <1> excludedResources: - nodes - events @@ -126,7 +126,7 @@ spec: mysql -h 127.0.0.1 -D system -u root --password=$MYSQL_ROOT_PASSWORD < - /var/lib/mysqldump/data/dump.sql <1> + /var/lib/mysqldump/data/dump.sql <2> container: system-mysql execTimeout: 80s onError: Fail @@ -134,14 +134,22 @@ spec: itemOperationTimeout: 1h0m0s restorePVs: true ---- -<1> A path where the data is restored from. +<1> Restoring the MySQL backup. +<2> A path where the data is restored from. -. Restore the `mysql` database by running the following command: +. Restore the MySQL database by running the following command: + [source,terminal] ---- $ oc create -f restore-mysql.yaml ---- ++ +.Example output ++ +[source,terminal] +---- +restore.velerio.io/restore-mysql created +---- .Verification @@ -176,8 +184,4 @@ example-claim Bound pvc-cbaa49b0-06cd-4b1a-9e90-0ef755c67a54 1Gi mysql-storage Bound pvc-4549649f-b9ad-44f7-8f67-dd6b9dbb3896 1Gi RWO gp3-csi 68m system-redis-storage Bound pvc-04dadafd-8a3e-4d00-8381-6041800a24fc 1Gi RWO gp3-csi 68m system-searchd Bound pvc-afbf606c-d4a8-4041-8ec6-54c5baf1a3b9 1Gi RWO gp3-csi 68m ----- - -.Next steps - -* Restore the back-end Redis database. \ No newline at end of file +---- \ No newline at end of file diff --git a/modules/scaling-up-the-3scale-api-management-operator-and-deployment.adoc b/modules/scaling-up-the-3scale-api-management-operator-and-deployment.adoc new file mode 100644 index 000000000000..a1b4193df2ee --- /dev/null +++ b/modules/scaling-up-the-3scale-api-management-operator-and-deployment.adoc @@ -0,0 +1,110 @@ +:_mod-docs-content-type: PROCEDURE + +//included in restoring-3scale-api-management-by-using-oadp assembly assembly + +[id="scaling-up-the-3scale-api-management-operator-and-deployment_{context}"] += Scaling up the 3scale API Management operator and deployment + +You can scale up the Red{nbsp}Hat 3scale API Management operator and any deployment that was manually scaled down. After a few minutes, 3scale installation should be fully functional, and its state should match the backed-up state. + +.Prerequisites + +* You restored the 3scale operator resources, and both the `Secret` and APIManager custom resources (CRs). +* You restored the MySQL and back-end Redis databases. +* Ensure that there are no scaled up deployments or no extra pods running. +There might be some `system-mysql` or `backend-redis` pods running detached from deployments after restoration, which can be removed after the restoration is successful. + + +.Procedure + +. Scale up the 3scale operator by running the following command: ++ +[source,terminal] +---- +$ oc scale deployment threescale-operator-controller-manager-v2 --replicas=1 -n threescale +---- ++ +.Example output +[source,terminal] +---- +deployment.apps/threescale-operator-controller-manager-v2 scaled +---- + +. Ensure that the 3scale pod is running to verify if the 3scale operator was deployed by running the following command: ++ +[source,terminal] +---- +$ oc get pods -n threescale +---- ++ +.Example output +[source,terminal] +---- +NAME READY STATUS RESTARTS AGE +threescale-operator-controller-manager-v2-79546bd8c-b4qbh 1/1 Running 0 2m5s +---- + +. Create the following script to scale up the deployments: ++ +[source,terminal] +---- +$ vi ./scaledeployment.sh +---- ++ +.Example script file: +[source,terminal] +---- +for deployment in apicast-production apicast-staging backend-cron backend-listener backend-redis backend-worker system-app system-memcache system-mysql system-redis system-searchd system-sidekiq zync zync-database zync-que; do + oc scale deployment/$deployment --replicas=1 -n threescale +done +---- + +. Scale up the deployments by running the following script: ++ +[source,terminal] +---- +$ ./scaledeployment.sh +---- ++ +.Example output: +[source,terminal] +---- +deployment.apps.openshift.io/apicast-production scaled +deployment.apps.openshift.io/apicast-staging scaled +deployment.apps.openshift.io/backend-cron scaled +deployment.apps.openshift.io/backend-listener scaled +deployment.apps.openshift.io/backend-redis scaled +deployment.apps.openshift.io/backend-worker scaled +deployment.apps.openshift.io/system-app scaled +deployment.apps.openshift.io/system-memcache scaled +deployment.apps.openshift.io/system-mysql scaled +deployment.apps.openshift.io/system-redis scaled +deployment.apps.openshift.io/system-searchd scaled +deployment.apps.openshift.io/system-sidekiq scaled +deployment.apps.openshift.io/zync scaled +deployment.apps.openshift.io/zync-database scaled +deployment.apps.openshift.io/zync-que scaled +---- + +. Get the `3scale-admin` route to log in to the 3scale UI by running the following command: ++ +[source,terminal] +---- +$ oc get routes -n threescale +---- ++ +.Example output +[source,terminal] +---- +NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD +backend backend-3scale.apps.custom-cluster-name.openshift.com backend-listener http edge/Allow None +zync-3scale-api-b4l4d api-3scale-apicast-production.apps.custom-cluster-name.openshift.com apicast-production gateway edge/Redirect None +zync-3scale-api-b6sns api-3scale-apicast-staging.apps.custom-cluster-name.openshift.com apicast-staging gateway edge/Redirect None +zync-3scale-master-7sc4j master.apps.custom-cluster-name.openshift.com system-master http edge/Redirect None +zync-3scale-provider-7r2nm 3scale-admin.apps.custom-cluster-name.openshift.com system-provider http edge/Redirect None +zync-3scale-provider-mjxlb 3scale.apps.custom-cluster-name.openshift.com system-developer http edge/Redirect None +---- ++ +In this example, `3scale-admin.apps.custom-cluster-name.openshift.com` is the 3scale-admin URL. + +. Use the URL from this output to log in to the 3scale operator as an administrator. You can verify that the data, when you took backup, is available. \ No newline at end of file diff --git a/modules/scaling-up-the-3scale-operator-and-deployment.adoc b/modules/scaling-up-the-3scale-operator-and-deployment.adoc deleted file mode 100644 index 3184fd2be9d3..000000000000 --- a/modules/scaling-up-the-3scale-operator-and-deployment.adoc +++ /dev/null @@ -1,60 +0,0 @@ -:_mod-docs-content-type: PROCEDURE - -//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly - -[id="scaling-up-the-3scale-operator-and-deployment_{context}"] -= Scaling up the 3scale Operator and deployment - -You can scale up the 3scale Operator and any deployment that was manually scaled down. After a few minutes, 3scale installation should be fully functional, and its state should match the backed-up state. - -.Prerequisites - -* Ensure that there are no scaled up deployments or no extra pods running. -There might be some `system-mysql` or `backend-redis` pods running detached from deployments after restoration, which can be removed after the restoration is successful. - - -.Procedure - -. Scale up the 3scale Operator by running the following command: -+ -[source,terminal] ----- -$ oc scale deployment threescale-operator-controller-manager-v2 --replicas=1 -n threescale ----- - -. Ensure that the 3scale Operator was deployed by running the following command: -+ -[source,terminal] ----- -$ oc get deployment -n threescale ----- - -. Scale up the deployments by executing the following script: -+ -[source,terminal] ----- -$ ./scaledeployment.sh ----- - -. Get the `3scale-admin` route to log in to the 3scale UI by running the following command: -+ -[source,terminal] ----- -$ oc get routes -n threescale ----- -+ -.Example output -[source,terminal] ----- -NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD -backend backend-3scale.apps.custom-cluster-name.openshift.com backend-listener http edge/Allow None -zync-3scale-api-b4l4d api-3scale-apicast-production.apps.custom-cluster-name.openshift.com apicast-production gateway edge/Redirect None -zync-3scale-api-b6sns api-3scale-apicast-staging.apps.custom-cluster-name.openshift.com apicast-staging gateway edge/Redirect None -zync-3scale-master-7sc4j master.apps.custom-cluster-name.openshift.com system-master http edge/Redirect None -zync-3scale-provider-7r2nm 3scale-admin.apps.custom-cluster-name.openshift.com system-provider http edge/Redirect None -zync-3scale-provider-mjxlb 3scale.apps.custom-cluster-name.openshift.com system-developer http edge/Redirect None ----- -+ -In this example, `3scale-admin.apps.custom-cluster-name.openshift.com` is the 3scale-admin URL. - -. Use the URL from this output to log in to the 3scale Operator as an administrator. You can verify that the existing data is available before trying to create a backup. \ No newline at end of file