This cheat sheet presents a list of command-line executables that are frequently used by OpenShift Administrators using OADP. The commands are organized by category.
You may also find OpenShift cheat here helpful.
List:
oc get dpa -n openshift-adp
Get the details:
oc get dpa dpaname -n openshift-adp -o yaml
Update the following backup.yaml CR
apiVersion: velero.io/v1
kind: Backup
metadata:
name: replace_me_backup_name
namespace: openshift-adp
spec:
includedNamespaces:
- replace_me_namespace_1
- replace_me_namespace_2
storageLocation: dpa_replace_me
ttl: 720h0m0sCreate the backup
oc create -f backup.yaml
Update the following restore.yaml CR
apiVersion: velero.io/v1
kind: Restore
metadata:
name: replace_me_restore_name
namespace: openshift-adp
spec:
backupName: replace_me_backup_name
restorePVs: trueGet OADP CRD's
oc get crd | grep oadp
Example with the dataprotectionapplications.oadp.openshift.io CRD
oc explain dataprotectionapplications.oadp.openshift.io
oc explain dataprotectionapplications.oadp.openshift.io.spec.features.dataMover
alias velero='oc -n openshift-adp exec deployment/velero -c velero -it -- ./velero'
alias restic='oc -n openshift-adp exec deployment/velero -c velero -it -- /usr/bin/restic'
Linux:
velero completion bash > /etc/bash_completion.d/velero
MacOS:
velero completion bash > /usr/local/etc/bash_completion.d/velero
velero backup get
velero backup create backup $backup_name --include-namespaces $namespace
velero backup create backup $backup_name --include-namespaces $namespace --default-volumes-to-fs-backup
velero backup create $backup_name --exclude-namespaces velero,default
velero backup create --from-schedule daily-backup
velero backup create $backup_name --snapshot-volumes=false -o yaml
velero backup create $backup_name --wait
velero backup delete $backup_name
Two simple steps should provide the information required
velero backup logs $backup_name
velero backup describe $backup_name --details
Name: mssql-persistent
Namespace: openshift-adp
Labels: velero.io/storage-location=velero-sample-1
Annotations: velero.io/source-cluster-k8s-gitversion=v1.23.5+b0357ed
velero.io/source-cluster-k8s-major-version=1
velero.io/source-cluster-k8s-minor-version=23
Phase: (run `velero backup logs mssql-persistent` for more information)
Errors: 2
Warnings: 0
Namespaces:
Included: mssql-persistent
Excluded: <none>
Resources:
Included: *
Excluded: <none>
Cluster-scoped: auto
Label selector: <none>
Storage Location: velero-sample-1
Velero-Native Snapshot PVs: auto
TTL: 720h0m0s
Hooks: <none>
Backup Format Version: 1.1.0
Started: 2023-06-21 23:56:51 -0700 PDT
Completed: 2023-06-22 00:07:51 -0700 PDT
Expiration: 2023-07-21 23:56:50 -0700 PDT
Resource List:
apiextensions.k8s.io/v1/CustomResourceDefinition:
- clusterserviceversions.operators.coreos.com
<SNIP>
- mssql-persistent/mssql-app-service
- mssql-persistent/mssql-service
v1/ServiceAccount:
- mssql-persistent/builder
- mssql-persistent/default
- mssql-persistent/deployer
- mssql-persistent/mssql-persistent-sa
Velero-Native Snapshots: <none included>