Skip to content

Commit

Permalink
63639 (#2026)
Browse files Browse the repository at this point in the history
* change ext file location

Signed-off-by: Ben Luzarraga <[email protected]>

* change ext file location for zen4

Signed-off-by: Ben Luzarraga <[email protected]>

---------

Signed-off-by: Ben Luzarraga <[email protected]>
  • Loading branch information
bluzarraga authored Jun 17, 2024
1 parent a121785 commit eb3e853
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 64 deletions.
6 changes: 1 addition & 5 deletions velero/schedule/zen-backup-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,6 @@ spec:
name: zen-metastoredb-backup-scripts
- name: scripts
mountPath: "/zen4"
- name: ext
mountPath: /zen4/extensions
dnsPolicy: ClusterFirst
schedulerName: default-scheduler
securityContext:
Expand All @@ -76,6 +74,4 @@ spec:
- name: scripts
configMap:
name: zen4-br-configmap
defaultMode: 0777
- emptyDir: {}
name: ext
defaultMode: 0777
16 changes: 9 additions & 7 deletions velero/schedule/zen4-br-scripts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -349,17 +349,17 @@ data:
extensions=$(echo $extensions | tr "," " ")
echo $extensions
cat <<< $extensions > /zen4/extensions/extensions.txt
cat <<< $extensions > /user-home/extensions.txt
success "Extensions captured for backup:"
cat /zen4/extensions/extensions.txt
cat /user-home/extensions.txt
else
info "No extensions found in namespace $ZEN_NAMESPACE other than defaults, exiting."
fi
fi
if [[ $BACKUP == "false" ]]; then
if [[ -f /zen4/extensions/extensions.txt ]]; then
extensions=$(cat /zen4/extensions/extensions.txt)
if [[ -f /user-home/extensions.txt ]]; then
extensions=$(cat /user-home/extensions.txt)
echo $extensions
extensions=$(echo $extensions | tr " " ",")
info "Extensions to cleanup in namespace $ZEN_NAMESPACE: $extensions"
Expand All @@ -373,9 +373,11 @@ data:
warning "The list of extensions provided returned an empty ID list from the database. These extensions may not be present in this database."
else
info "List of extension IDs populated, continuing with deletion."
id_list=${id_list//\//%2F}
info "id_list with / replaced: $id_list"
# Delete each extension using the ID
# curl -H 'secret: <broker-secret>' -ks -X DELETE https://zen-core-api-svc:4444//v1/internal/extensions/{source_id}
# curl -H 'secret: <broker-secret>' -ks -X DELETE https://zen-core-api-svc:4444/v1/internal/extensions/{source_id}
for id in $id_list; do
info "Deleting extension with ID $id."
curl -H "secret: ${broker_secret}" -ks -X DELETE https://zen-core-api-svc:4444/v1/internal/extensions/{$id}
Expand All @@ -384,7 +386,7 @@ data:
success "Zen extension cleanup complete."
fi
else
info "File /zen4/extensions/extensions.txt not found, skipping zenextension cleanup."
info "File /user-home/extensions.txt not found, skipping zenextension cleanup."
fi
fi
}
Expand Down Expand Up @@ -414,4 +416,4 @@ data:
msg "[INFO] ${1}"
}
main $*
main $*
91 changes: 45 additions & 46 deletions velero/schedule/zen5-backup-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,50 +24,49 @@ spec:
labels:
foundationservices.cloudpak.ibm.com: zen5-data
spec:
containers:
- command:
- sh
- -c
- sleep infinity
image: icr.io/cpopen/cpfs/cpfs-utils:4.6.0 #4.1.0 if using CS 4.1, 4.2.0 if using CS 4.2
imagePullPolicy: IfNotPresent
name: zen5-backup-job
resources:
limits:
cpu: 500m
ephemeral-storage: 512Mi
memory: 512Mi
requests:
cpu: 200m
ephemeral-storage: 128Mi
memory: 256Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /zen5/zen-backup
name: zen5-backup-mount
- name: scripts
mountPath: "/zen5"
- name: ext
mountPath: /zen5/extensions
- name: logs
mountPath: /zen5/zen-backup/logs
dnsPolicy: ClusterFirst
schedulerName: default-scheduler
securityContext:
runAsNonRoot: true
serviceAccount: zen5-backup-sa
serviceAccountName: zen5-backup-sa
terminationGracePeriodSeconds: 30
volumes:
- name: zen5-backup-mount
persistentVolumeClaim:
claimName: zen5-backup-pvc
containers:
- command:
- sh
- -c
- sleep infinity
image: icr.io/cpopen/cpfs/cpfs-utils:4.6.0 #4.1.0 if using CS 4.1, 4.2.0 if using CS 4.2
imagePullPolicy: IfNotPresent
name: zen5-backup-job
resources:
limits:
cpu: 500m
ephemeral-storage: 512Mi
memory: 512Mi
requests:
cpu: 200m
ephemeral-storage: 128Mi
memory: 256Mi
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /zen5/zen-backup
name: zen5-backup-mount
readOnly: false
- name: scripts
configMap:
name: zen5-br-configmap
defaultMode: 0777
- emptyDir: {}
name: ext
- emptyDir: {}
name: logs
mountPath: "/zen5"
readOnly: false
- name: logs
mountPath: /zen5/zen-backup/logs
readOnly: false
dnsPolicy: ClusterFirst
schedulerName: default-scheduler
securityContext:
runAsNonRoot: true
serviceAccount: zen5-backup-sa
serviceAccountName: zen5-backup-sa
terminationGracePeriodSeconds: 30
volumes:
- name: zen5-backup-mount
persistentVolumeClaim:
claimName: zen5-backup-pvc
- name: scripts
configMap:
name: zen5-br-configmap
defaultMode: 0777
- emptyDir: {}
name: logs
12 changes: 6 additions & 6 deletions velero/schedule/zen5-br-scripts-cm.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -450,17 +450,17 @@ data:
extensions=$(echo $extensions | tr "," " ")
echo $extensions
cat <<< $extensions > /zen5/extensions/extensions.txt
cat <<< $extensions > /zen5/zen-backup/extensions.txt
success "Extensions captured for backup:"
cat /zen5/extensions/extensions.txt
cat /zen5/zen-backup/extensions.txt
else
info "No extensions found in namespace $ZEN_NAMESPACE other than defaults, exiting."
fi
fi
if [[ $BACKUP == "false" ]]; then
if [[ -f /zen5/extensions/extensions.txt ]]; then
extensions=$(cat /zen5/extensions/extensions.txt)
if [[ -f /zen5/zen-backup/extensions.txt ]]; then
extensions=$(cat /zen5/zen-backup/extensions.txt)
echo $extensions
extensions=$(echo $extensions | tr " " ",")
info "Extensions to cleanup in namespace $ZEN_NAMESPACE: $extensions"
Expand All @@ -487,7 +487,7 @@ data:
success "Zen extension cleanup complete."
fi
else
info "File /zen5/extensions/extensions.txt not found, skipping zenextension cleanup."
info "File /zen5/zen-backup/extensions.txt not found, skipping zenextension cleanup."
fi
fi
}
Expand Down Expand Up @@ -517,4 +517,4 @@ data:
msg "[INFO] ${1}"
}
main $*
main $*

0 comments on commit eb3e853

Please sign in to comment.