You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add zen_ns for br-automation script
Signed-off-by: Allen Li <liyuchen223@gmail.com>
* update oadp deploy script
Signed-off-by: Allen Li <liyuchen223@gmail.com>
---------
Signed-off-by: Allen Li <liyuchen223@gmail.com>
Copy file name to clipboardExpand all lines: velero/schedule/deploy-br-resources.sh
+35-26Lines changed: 35 additions & 26 deletions
Original file line number
Diff line number
Diff line change
@@ -62,6 +62,10 @@ function parse_arguments() {
62
62
shift
63
63
LSR_NAMESPACE=$1
64
64
;;
65
+
--zen-ns)
66
+
shift
67
+
ZEN_NAMESPACE=$1
68
+
;;
65
69
--zen)
66
70
ZEN="true"
67
71
SELECTED="true"
@@ -126,6 +130,10 @@ function parse_arguments() {
126
130
warning "No services namespace specified, using operator namespace $OPERATOR_NAMESPACE instead. If using SOD topology, please re-run with both --operator-ns and --services-ns defined."
127
131
TARGET_NAMESPACE=$OPERATOR_NAMESPACE
128
132
fi
133
+
if [[ $ZEN=="true"||$ZEN4=="true" ]] && [[ $ZEN_NAMESPACE=="" ]];then
134
+
warning "No zen namespace specified, using service namespace $TARGET_NAMESPACE instead."
135
+
ZEN_NAMESPACE=$TARGET_NAMESPACE
136
+
fi
129
137
}
130
138
131
139
functionprint_usage() {
@@ -138,6 +146,7 @@ function print_usage() {
138
146
echo" --services-ns string Required. Namespace where IM EDB, IM Mongo, Zen, or Keycloak operands are installed. If installed in different namespaces, script will need to be run separately. Optional if it is the same as --operator-ns."
139
147
echo" --tethered-ns string Optional. Comma-delimited list of namespaces attached to a given CPFS install. Should include any namespace from a given tenant in the common-service-maps cm that are not the --operator-ns or the --services-ns. Only required when --util specified."
140
148
echo" --lsr-ns string Optional. Namespace for the License Service Reporter install. Required if --lsr specified."
149
+
echo" --zen-ns string Optional. Namespace for the Zen install. Only required if multiple zenservice instances are found in the --services-ns."
141
150
echo" --im, --mongo, --keycloak, --zen, --zen4, --lsr Required. Choose which component(s) to deploy backup/restore resources for to the target namespace. At least one is required. Multiple can be specified but only one of --zen or --zen4 can be chosen."
142
151
echo" --util Optional. Deploy the CPFS Util job for use in SOD topologies. If this option is selected, --operator-ns and --services-ns are both required."
143
152
echo" --storage-class string Optional. Storage class to use for backup/restore resources. Default value is cluster's default storage class."
@@ -221,14 +230,14 @@ function deploy_resources(){
221
230
#Deploy zen 5 resources
222
231
if [[ $ZEN=="true" ]];then
223
232
if [[ $ZENSERVICE=="" ]];then
224
-
ZENSERVICE=$(oc get zenservice -n $TARGET_NAMESPACE --no-headers | awk '{print $1}')
233
+
ZENSERVICE=$(oc get zenservice -n $ZEN_NAMESPACE --no-headers | awk '{print $1}')
225
234
fi
226
235
if [[ $ZENSERVICE!="" ]];then
227
-
exists=$(oc get zenservice $ZENSERVICE -n $TARGET_NAMESPACE --no-headers --ignore-not-found)
236
+
exists=$(oc get zenservice $ZENSERVICE -n $ZEN_NAMESPACE --no-headers --ignore-not-found)
228
237
if [[ $exists=="" ]];then
229
-
warning "Zenservice $ZENSERVICE not found in namespace $TARGET_NAMESPACE. Make sure the zenservice is deployed to the target namespace $TARGET_NAMESPACE or change the namespace used."
238
+
warning "Zenservice $ZENSERVICE not found in namespace $ZEN_NAMESPACE. Make sure the zenservice is deployed to the target namespace $ZEN_NAMESPACE or change the namespace used."
230
239
else
231
-
info "Creating Zen Backup/Restore resources in namespace $TARGET_NAMESPACE."
240
+
info "Creating Zen Backup/Restore resources in namespace $ZEN_NAMESPACE."
232
241
233
242
rm -rf tmp/zen/
234
243
mkdir tmp/zen
@@ -239,33 +248,33 @@ function deploy_resources(){
sed -i -E "s/<zenservice namespace>/$TARGET_NAMESPACE/" tmp/zen/zen5-backup-deployment.yaml
251
+
sed -i -E "s/<zenservice namespace>/$ZEN_NAMESPACE/" tmp/zen/zen5-backup-deployment.yaml
243
252
sed -i -E "s/<zenservice name>/$ZENSERVICE/" tmp/zen/zen5-backup-deployment.yaml
244
-
sed -i -E "s/<zenservice namespace>/$TARGET_NAMESPACE/" tmp/zen/zen5-backup-pvc.yaml
253
+
sed -i -E "s/<zenservice namespace>/$ZEN_NAMESPACE/" tmp/zen/zen5-backup-pvc.yaml
245
254
sed -i -E "s/<storage class>/$STORAGE_CLASS/" tmp/zen/zen5-backup-pvc.yaml
246
-
sed -i -E "s/<zenservice namespace>/$TARGET_NAMESPACE/" tmp/zen/zen5-role.yaml
247
-
sed -i -E "s/<zenservice namespace>/$TARGET_NAMESPACE/" tmp/zen/zen5-rolebinding.yaml
248
-
sed -i -E "s/<zenservice namespace>/$TARGET_NAMESPACE/" tmp/zen/zen5-sa.yaml
249
-
sed -i -E "s/<zenservice namespace>/$TARGET_NAMESPACE/" tmp/zen/zen5-br-scripts-cm.yaml
250
-
oc apply -f tmp/zen -n $TARGET_NAMESPACE|| error "Unable to deploy resources for Zen 5."
251
-
success "Resources to backup Zen deployed in namespace $TARGET_NAMESPACE."
255
+
sed -i -E "s/<zenservice namespace>/$ZEN_NAMESPACE/" tmp/zen/zen5-role.yaml
256
+
sed -i -E "s/<zenservice namespace>/$ZEN_NAMESPACE/" tmp/zen/zen5-rolebinding.yaml
257
+
sed -i -E "s/<zenservice namespace>/$ZEN_NAMESPACE/" tmp/zen/zen5-sa.yaml
258
+
sed -i -E "s/<zenservice namespace>/$ZEN_NAMESPACE/" tmp/zen/zen5-br-scripts-cm.yaml
259
+
oc apply -f tmp/zen -n $ZEN_NAMESPACE|| error "Unable to deploy resources for Zen 5."
260
+
success "Resources to backup Zen deployed in namespace $ZEN_NAMESPACE."
252
261
fi
253
262
else
254
-
warning "No zenservice found in namespace $TARGET_NAMESPACE. Skipping."
263
+
warning "No zenservice found in namespace $ZEN_NAMESPACE. Skipping."
255
264
fi
256
265
fi
257
266
258
267
#deploy zen 4 resources
259
268
if [[ $ZEN4=="true" ]];then
260
269
if [[ $ZENSERVICE=="" ]];then
261
-
ZENSERVICE=$(oc get zenservice -n $TARGET_NAMESPACE --no-headers | awk '{print $1}')
270
+
ZENSERVICE=$(oc get zenservice -n $ZEN_NAMESPACE --no-headers | awk '{print $1}')
262
271
fi
263
272
if [[ $ZENSERVICE!="" ]];then
264
-
exists=$(oc get zenservice $ZENSERVICE -n $TARGET_NAMESPACE --no-headers --ignore-not-found)
273
+
exists=$(oc get zenservice $ZENSERVICE -n $ZEN_NAMESPACE --no-headers --ignore-not-found)
265
274
if [[ $exists=="" ]];then
266
-
error "Zenservice $ZENSERVICE not found in namespace $TARGET_NAMESPACE. Make sure the zenservice is deployed to the target namespace $TARGET_NAMESPACE or change the namespace used."
275
+
error "Zenservice $ZENSERVICE not found in namespace $ZEN_NAMESPACE. Make sure the zenservice is deployed to the target namespace $ZEN_NAMESPACE or change the namespace used."
267
276
else
268
-
info "Creating Zen Backup/Restore resources in namespace $TARGET_NAMESPACE."
277
+
info "Creating Zen Backup/Restore resources in namespace $ZEN_NAMESPACE."
269
278
270
279
rm -rf tmp/zen4
271
280
mkdir tmp/zen4
@@ -276,20 +285,20 @@ function deploy_resources(){
0 commit comments