5.22.3. Restoring 3scale API Management by using OADP
Restore Red Hat 3scale API Management components by restoring the backed up 3scale operator resources, MySQL database, and Redis database. This helps you to recover your 3scale deployment and resume API management services.
After the data has been restored, you can scale up the 3scale operator and deployment.
5.22.3.1. Restoring the 3scale API Management operator, secrets, and APIManager 링크 복사링크가 클립보드에 복사되었습니다!
Restore the Red Hat 3scale API Management operator resources, including the Secret and APIManager custom resources (CRs). This helps you to recover your 3scale operator configuration on the same or a different cluster.
Prerequisites
- 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 you are restoring the operator to a different cluster that you backed up from, install and configure OADP with
nodeAgentenabled on the destination cluster. Ensure that the OADP configuration is same as it was on the source cluster.
Procedure
Delete the 3scale operator custom resource definitions (CRDs) along with the
threescalenamespace by running the following command:$ oc delete project threescale"threescale" project deleted successfullyCreate a YAML file with the following configuration to restore the 3scale operator:
apiVersion: velero.io/v1 kind: Restore metadata: name: operator-installation-restore namespace: openshift-adp spec: backupName: operator-install-backup excludedResources: - nodes - events - events.events.k8s.io - backups.velero.io - restores.velero.io - resticrepositories.velero.io - csinodes.storage.k8s.io - volumeattachments.storage.k8s.io - backuprepositories.velero.io itemOperationTimeout: 4h0m0swhere:
operator-install-backup- Specifies the name of the backup to restore the 3scale operator.
Restore the 3scale operator by running the following command:
$ oc create -f restore.yamlrestore.velerio.io/operator-installation-restore createdManually create the
s3-credentialsSecretobject by running the following command:$ oc apply -f - <<EOF --- apiVersion: v1 kind: Secret metadata: name: s3-credentials namespace: threescale stringData: AWS_ACCESS_KEY_ID: <ID_123456> AWS_SECRET_ACCESS_KEY: <ID_98765544> AWS_BUCKET: <mybucket.example.com> AWS_REGION: <us-east-1> type: Opaque EOFwhere:
<AWS_ACCESS_KEY_ID>- Specifies your AWS credentials ID.
<AWS_SECRET_ACCESS_KEY>- Specifies your AWS credentials KEY.
<mybucket.example.com>- Specifies your target bucket name.
<us-east-1>- Specifies the AWS region of your bucket.
Scale down the 3scale operator by running the following command:
$ oc scale deployment threescale-operator-controller-manager-v2 --replicas=0 -n threescaledeployment.apps/threescale-operator-controller-manager-v2 scaledCreate a YAML file with the following configuration to restore the
Secret:apiVersion: velero.io/v1 kind: Restore metadata: name: operator-resources-secrets namespace: openshift-adp spec: backupName: operator-resources-secrets excludedResources: - nodes - events - events.events.k8s.io - backups.velero.io - restores.velero.io - resticrepositories.velero.io - csinodes.storage.k8s.io - volumeattachments.storage.k8s.io - backuprepositories.velero.io itemOperationTimeout: 4h0m0swhere:
operator-resources-secrets-
Specifies the name of the backup to restore the
Secret.
Restore the
Secretby running the following command:$ oc create -f restore-secrets.yamlrestore.velerio.io/operator-resources-secrets createdCreate a YAML file with the following configuration to restore APIManager:
Example
restore-apimanager.yamlfileapiVersion: velero.io/v1 kind: Restore metadata: name: operator-resources-apim namespace: openshift-adp spec: backupName: operator-resources-apim excludedResources: - nodes - events - events.events.k8s.io - backups.velero.io - restores.velero.io - resticrepositories.velero.io - csinodes.storage.k8s.io - volumeattachments.storage.k8s.io - backuprepositories.velero.io itemOperationTimeout: 4h0m0swhere:
operator-resources-apim- Specifies the name of the backup to restore the APIManager.
excludedResources- Specifies the resources that you do not want to restore.
Restore the APIManager by running the following command:
$ oc create -f restore-apimanager.yamlrestore.velerio.io/operator-resources-apim createdScale up the 3scale operator by running the following command:
$ oc scale deployment threescale-operator-controller-manager-v2 --replicas=1 -n threescaledeployment.apps/threescale-operator-controller-manager-v2 scaled