Skip to content

Commit 270d971

Browse files
Merge pull request #85994 from apurvabhide17/OADP-4058-OADP-3scale
OADP-4058: Adding structure for OADP and 3scale user story
2 parents 047fcd5 + a1436ee commit 270d971

15 files changed

+977
-1
lines changed

_topic_maps/_topic_map.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3634,6 +3634,11 @@ Topics:
36343634
Topics:
36353635
- Name: Backing up applications on AWS STS using OADP
36363636
File: oadp-aws-sts
3637+
- Name: OADP and 3scale
3638+
Dir: oadp-3scale
3639+
Topics:
3640+
- Name: Backing up and restoring 3scale by using OADP
3641+
File: backing-up-and-restoring-3scale-by-using-oadp
36373642
- Name: OADP Data Mover
36383643
Dir: installing
36393644
Topics:

backup_and_restore/application_backup_and_restore/backing_up_and_restoring/oadp-scheduling-backups-doc.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,4 +83,4 @@ Enter the minutes value between quotation marks (`" "`).
8383
[source,terminal]
8484
----
8585
$ oc get schedule -n openshift-adp <schedule> -o jsonpath='{.status.phase}'
86-
----
86+
----
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../_attributes/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
:_mod-docs-content-type: ASSEMBLY
2+
[id="backing-up-and-restoring-3scale-by-using-oadp_{context}"]
3+
= Backing up and restoring 3scale by using OADP
4+
include::_attributes/common-attributes.adoc[]
5+
:context: backing-up-and-restoring-3scale-by-using-oadp
6+
7+
toc::[]
8+
9+
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.
10+
You can deploy 3scale components on-premise, in the cloud, as a managed service, or in any combination based on your requirement.
11+
12+
[NOTE]
13+
====
14+
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.
15+
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.
16+
====
17+
18+
.Prerequisites
19+
20+
* 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].
21+
22+
include::modules/creating-the-data-protection-application.adoc[leveloffset=+1]
23+
[role="_additional-resources"]
24+
.Additional resources
25+
* xref:../../../backup_and_restore/application_backup_and_restore/installing/installing-oadp-aws.adoc#oadp-installing-dpa_installing-oadp-aws[Installing the Data Protection Application]
26+
27+
include::modules/backing-up-the-3scale-operator.adoc[leveloffset=+1]
28+
29+
[role="_additional-resources"]
30+
.Additional resources
31+
* 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]
32+
33+
include::modules/backing-up-the-mysql-database.adoc[leveloffset=+1]
34+
35+
include::modules/backing-up-the-backend-redis-database.adoc[leveloffset=+1]
36+
37+
include::modules/restoring-the-secrets-and-apimanager.adoc[leveloffset=+1]
38+
39+
include::modules/restoring-the-mysql-database.adoc[leveloffset=+1]
40+
41+
include::modules/restoring-the-backend-redis-database.adoc[leveloffset=+1]
42+
43+
include::modules/scaling-up-the-3scale-operator-and-deployment.adoc[leveloffset=+1]
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../images/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../modules/
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../../snippets/
Lines changed: 123 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,123 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly
4+
5+
[id="backing-up-the-3scale-operator_{context}"]
6+
= Backing up the 3scale Operator
7+
8+
You can back up the Operator resources, and Secret and APIManager custom resources (CR). For more information, see "Creating a Backup CR".
9+
10+
.Prerequisites
11+
12+
* You created the Data Protection Application (DPA).
13+
14+
.Procedure
15+
16+
. Back up the Operator resources, such as `operatorgroup`, `namespaces`, and `subscriptions`, by creating a YAML file with the following configuration:
17+
+
18+
.Example `backup.yaml` file
19+
+
20+
[source,yaml]
21+
----
22+
apiVersion: velero.io/v1
23+
kind: Backup
24+
metadata:
25+
name: operator-install-backup
26+
namespace: openshift-adp
27+
spec:
28+
csiSnapshotTimeout: 10m0s
29+
defaultVolumesToFsBackup: false
30+
includedNamespaces:
31+
- threescale <1>
32+
includedResources:
33+
- operatorgroups
34+
- subscriptions
35+
- namespaces
36+
itemOperationTimeout: 1h0m0s
37+
snapshotMoveData: false
38+
ttl: 720h0m0s
39+
----
40+
<1> Namespace where the 3scale Operator is installed.
41+
+
42+
[NOTE]
43+
====
44+
You can also back up and restore `ReplicationControllers`, `Deployment`, and `Pod` objects to ensure that all manually set environments are backed up and restored. This does not affect the flow of restoration.
45+
====
46+
47+
. Create a backup CR by running the following command:
48+
+
49+
[source,terminal]
50+
----
51+
$ oc create -f backup.yaml
52+
----
53+
54+
. Back up the Secret CR by creating a YAML file with the following configuration:
55+
+
56+
.Example `backup-secret.yaml` file
57+
+
58+
[source,yaml]
59+
----
60+
apiVersion: velero.io/v1
61+
kind: Backup
62+
metadata:
63+
name: operator-resources-secrets
64+
namespace: openshift-adp
65+
spec:
66+
csiSnapshotTimeout: 10m0s
67+
defaultVolumesToFsBackup: false
68+
includedNamespaces:
69+
- threescale
70+
includedResources:
71+
- secrets
72+
itemOperationTimeout: 1h0m0s
73+
labelSelector:
74+
matchLabels:
75+
app: 3scale-api-management
76+
snapshotMoveData: false
77+
snapshotVolumes: false
78+
ttl: 720h0m0s
79+
----
80+
81+
. Create the Secret CR by running the following command:
82+
+
83+
[source,terminal]
84+
----
85+
$ oc create -f backup-secret.yaml
86+
----
87+
88+
. Back up the APIManager CR by creating a YAML file with the following configuration:
89+
+
90+
.Example backup-apimanager.yaml file
91+
[source,yaml]
92+
----
93+
apiVersion: velero.io/v1
94+
kind: Backup
95+
metadata:
96+
name: operator-resources-apim
97+
namespace: openshift-adp
98+
spec:
99+
csiSnapshotTimeout: 10m0s
100+
defaultVolumesToFsBackup: false
101+
includedNamespaces:
102+
- threescale
103+
includedResources:
104+
- apimanagers
105+
itemOperationTimeout: 1h0m0s
106+
snapshotMoveData: false
107+
snapshotVolumes: false
108+
storageLocation: ts-dpa-1
109+
ttl: 720h0m0s
110+
volumeSnapshotLocations:
111+
- ts-dpa-1
112+
----
113+
114+
. Create the APIManager CR by running the following command:
115+
+
116+
[source,terminal]
117+
----
118+
$ oc create -f backup-apimanager.yaml
119+
----
120+
121+
.Next steps
122+
123+
* Back up the `mysql` database.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
:_mod-docs-content-type: PROCEDURE
2+
3+
//included in backing-up-and-restoring-3scale-by-using-oadp.adoc assembly
4+
5+
[id="backing-up-the-backend-redis-database_{context}"]
6+
= Backing up the back-end Redis database
7+
8+
You can back up the Redis database by adding the required annotations and by listing which resources to back up using the `includedResources` parameter.
9+
10+
11+
.Prerequisites
12+
13+
* You backed up the 3scale Operator.
14+
* You backed up the mysql database.
15+
* The Redis queues have been drained before performing the backup.
16+
17+
18+
.Procedure
19+
20+
. Edit the annotations on the `backend-redis` deployment by running the following command:
21+
+
22+
[source, terminal]
23+
----
24+
$ oc edit deployment backend-redis -n threescale
25+
----
26+
27+
. Add the following annotations:
28+
+
29+
[source,yaml]
30+
----
31+
annotations:
32+
post.hook.backup.velero.io/command: >-
33+
["/bin/bash", "-c", "redis-cli CONFIG SET auto-aof-rewrite-percentage
34+
100"]
35+
pre.hook.backup.velero.io/command: >-
36+
["/bin/bash", "-c", "redis-cli CONFIG SET auto-aof-rewrite-percentage
37+
0"]
38+
----
39+
40+
. Create a YAML file with the following configuration to back up the Redis database:
41+
+
42+
.Example `redis-backup.yaml` file
43+
+
44+
[source,yaml]
45+
----
46+
apiVersion: velero.io/v1
47+
kind: Backup
48+
metadata:
49+
name: redis-backup
50+
namespace: openshift-adp
51+
spec:
52+
csiSnapshotTimeout: 10m0s
53+
defaultVolumesToFsBackup: true
54+
includedNamespaces:
55+
- threescale
56+
includedResources:
57+
- deployment
58+
- pods
59+
- replicationcontrollers
60+
- persistentvolumes
61+
- persistentvolumeclaims
62+
itemOperationTimeout: 1h0m0s
63+
labelSelector:
64+
matchLabels:
65+
app: 3scale-api-management
66+
threescale_component: backend
67+
threescale_component_element: redis
68+
snapshotMoveData: false
69+
snapshotVolumes: false
70+
ttl: 720h0m0s
71+
----
72+
73+
. Back up the Redis database by running the following command:
74+
+
75+
[source,terminal]
76+
----
77+
$ oc get backups.velero.io redis-backup -o yaml
78+
----
79+
80+
.Verification
81+
82+
* Verify that the Redis backup is completed by running the following command::
83+
+
84+
[source,terminal]
85+
----
86+
$ oc get backups.velero.io
87+
----
88+
89+
.Next steps
90+
91+
* Restore the Secrets and APIManager CRs.

0 commit comments

Comments
 (0)