5.17. OADP CLI plugin
5.17.1. OADP CLI plugin 링크 복사링크가 클립보드에 복사되었습니다!
The OpenShift API for Data Protection (OADP) command-line interface (CLI) plugin for the OpenShift CLI (oc) provides a kubectl-native interface for managing backup and restore operations on an OpenShift Container Platform cluster.
The plugin is available as oc oadp and supports both cluster administrator and non-administrator workflows. The administrator perspective provides cluster-wide backup and restore operations by using Velero resources. These commands are available when the OADP CLI is configured in admin mode.
5.17.1.1. Install the OADP CLI plugin 링크 복사링크가 클립보드에 복사되었습니다!
The OADP command-line interface (CLI) plugin is available from the Command-line tools page in the OpenShift Container Platform web console when the OADP Operator is installed.
Prerequisites
- You have access to an OpenShift Container Platform cluster with the OADP Operator installed.
Procedure
- Log in to the OpenShift Container Platform web console as a user with access to the cluster.
- Click the ? icon in the toolbar and select Command-line tools.
-
Download the
oc-oadpbinary for your operating system and architecture. -
Extract the archive and place the
oc-oadpbinary in a directory on yourPATH. Verify the installation:
$ oc oadp version
5.17.1.2. Set up the OADP CLI plugin 링크 복사링크가 클립보드에 복사되었습니다!
After you install the OADP command-line interface (CLI) plugin, you must run the setup command to configure it for your user permissions.
The setup command automatically detects whether you have cluster-wide administrator permissions and configures the CLI accordingly. The CLI operates in one of the following two modes:
- Admin mode: Provides access to cluster-wide Velero backup and restore commands.
- Non-administrator mode: Provides access to namespace-scoped self-service backup and restore commands.
Prerequisites
- The OADP CLI plugin is installed.
-
You are logged in to the OpenShift Container Platform cluster by using the
oc logincommand.
Procedure
Run the setup command to auto-detect your permissions and configure the CLI:
$ oc oadp setupThe CLI checks whether you can create
backups.velero.ioresources across all namespaces. If you can, admin mode is enabled. Otherwise, non-administrator mode is enabled. The configuration is saved to~/.config/velero/config.json.To reconfigure the CLI after a change in permissions, run the setup command with the
--forceflag:$ oc oadp setup --force
Verification
Run the following command to confirm that the available commands match your configured mode:
$ oc oadp --help참고OADP CLI commands support both noun-verb and verb-noun ordering. For example,
oc oadp backup createandoc oadp create backupare equivalent.
5.17.1.3. OADP CLI client configuration commands 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to view and modify client configuration settings. Configuration is stored in ~/.config/velero/config.json.
5.17.1.3.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed.
5.17.1.3.2. Current configuration viewing command 링크 복사링크가 클립보드에 복사되었습니다!
To view the current client configuration, use the following command:
$ oc oadp client config get
5.17.1.3.3. Configuration value setting command 링크 복사링크가 클립보드에 복사되었습니다!
To set a configuration value, use the following command:
$ oc oadp client config set <key>=<value>
where:
<key>- Specifies the configuration key to set.
<value>- Specifies the value for the configuration key.
Example of setting the default namespace
$ oc oadp client config set namespace=openshift-adp
5.17.1.4. Enable shell completion for the OADP CLI 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to generate and install shell completion scripts for command auto-completion.
Prerequisites
- The OADP CLI plugin is installed.
Procedure
Choose one of the following methods to enable shell completion:
To install shell completions automatically for your current shell, use the following command:
$ oc oadp completion install [flags]Expand 표 5.6. Flags for the oc oadp completion install command Flag Description --shellThe shell type to install completions for. Supported values are
bash,zsh, andfish. If this flag is not specified, the current shell is auto-detected.Example of installing completions for zsh
$ oc oadp completion install --shell zshTo generate a completion script for your shell without installing it, use the following command:
$ oc oadp completion <shell_name>where:
<shell_name>Specifies the name of your shell. Supported values are
bash,zsh,fish, andpowershell.You can redirect the output to a file or source it directly.
Example of writing a bash completion script
$ oc oadp completion bash > /etc/bash_completion.d/oc-oadp
5.17.1.5. Backup management commands 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to create, view, describe, download, and delete backups.
5.17.1.5.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed and configured in admin mode.
-
You are logged in to the OpenShift Container Platform cluster as a user with
cluster-adminprivileges.
5.17.1.5.2. Backup creation command 링크 복사링크가 클립보드에 복사되었습니다!
To create a backup of cluster resources, use the following command:
$ oc oadp backup create <backup_name> [flags]
| Flag | Description |
|---|---|
|
|
The namespaces to include in the backup. The default value is |
|
| The namespaces to exclude from the backup. |
|
|
The resources to include in the backup. You can specify simple kind names, for example, |
|
|
The resources to exclude from the backup. This flag uses the same format as the |
|
| The name of the backup storage location to use. |
|
| The volume snapshot location or locations to use. |
|
| A label selector to filter resources. |
|
| An OR combination of label selectors. |
|
|
Specifies whether to take persistent volume (PV) snapshots. The default value is |
|
| Specifies whether to move snapshot data to the backup storage location. |
|
| Specifies whether to use a file system backup for all volumes. |
|
| Specifies whether to include cluster-scoped resources. |
|
|
The backup retention period. The default value is |
|
| The timeout for Container Storage Interface (CSI) snapshot creation. |
|
| The timeout for asynchronous plugin operations. |
|
| The timeout for the request to the Kubernetes API server. |
Example of the backup creation command
$ oc oadp backup create my-backup \
--include-namespaces my-namespace \
--snapshot-volumes \
--ttl 720h
5.17.1.5.3. Backup listing command 링크 복사링크가 클립보드에 복사되었습니다!
To list all backups, use the following command:
$ oc oadp backup get [<backup_name>] [flags]
| Flag | Description |
|---|---|
|
|
The output format. Supported values are |
5.17.1.5.4. Backup description command 링크 복사링크가 클립보드에 복사되었습니다!
To view the details of a backup, use the following command:
$ oc oadp backup describe <backup_name> [flags]
| Flag | Description |
|---|---|
|
| Specifies whether to display additional details in the output. |
5.17.1.5.5. Backup logs command 링크 복사링크가 클립보드에 복사되었습니다!
To view the logs for a backup, use the following command:
$ oc oadp backup logs <backup_name>
5.17.1.5.6. Backup download command 링크 복사링크가 클립보드에 복사되었습니다!
To download the contents of a backup, use the following command:
$ oc oadp backup download <backup_name> [flags]
5.17.1.5.7. Backup deletion command 링크 복사링크가 클립보드에 복사되었습니다!
To delete a backup, use the following command:
$ oc oadp backup delete <backup_name> [flags]
| Flag | Description |
|---|---|
|
| Specifies whether to confirm the deletion without prompting. |
5.17.1.6. Restore management commands 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to create, view, describe, and delete restores.
5.17.1.6.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed and configured in admin mode.
-
You are logged in to the OpenShift Container Platform cluster as a user with
cluster-adminprivileges. - A completed backup exists to restore from.
5.17.1.6.2. Restore creation command 링크 복사링크가 클립보드에 복사되었습니다!
To create a restore from an existing backup, use the following command:
$ oc oadp restore create <restore_name> [flags]
| Flag | Description |
|---|---|
|
| The name of the backup to restore from. |
|
| The name of the schedule to restore from. This flag uses the most recent backup. |
|
|
The namespaces to include in the restore. The default value is |
|
| The namespaces to exclude from the restore. |
|
|
The resources to include in the restore. You can specify simple kind names, for example, |
|
|
The resources to exclude from the restore. This flag uses the same format as the |
|
| A label selector to filter resources. |
|
| An OR combination of label selectors. |
|
| Specifies whether to include cluster-scoped resources. |
|
| Specifies whether to restore persistent volume (PV) data from snapshots. |
|
| Specifies whether to preserve NodePort service port assignments. |
|
| The timeout for asynchronous plugin operations. |
|
| The timeout for the request to the Kubernetes API server. |
Example of the restore creation command
$ oc oadp restore create my-restore \
--from-backup my-backup \
--include-namespaces my-namespace
5.17.1.6.3. Restore listing command 링크 복사링크가 클립보드에 복사되었습니다!
To list all restores, use the following command:
$ oc oadp restore get [<restore_name>] [flags]
| Flag | Description |
|---|---|
|
|
The output format. Supported values are |
5.17.1.6.4. Restore description command 링크 복사링크가 클립보드에 복사되었습니다!
To view the details of a restore, use the following command:
$ oc oadp restore describe <restore_name> [flags]
| Flag | Description |
|---|---|
|
| Specifies whether to display additional details in the output. |
5.17.1.6.5. Restore logs command 링크 복사링크가 클립보드에 복사되었습니다!
To view the logs for a restore, use the following command:
$ oc oadp restore logs <restore_name>
5.17.1.6.6. Restore deletion command 링크 복사링크가 클립보드에 복사되었습니다!
To delete a restore, use the following command:
$ oc oadp restore delete <restore_name> [flags]
| Flag | Description |
|---|---|
|
| Specifies whether to confirm the deletion without prompting. |
5.17.1.7. Schedule management commands 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to create, view, describe, and delete backup schedules. Schedules automate the creation of backups at specified intervals by using a cron expression.
5.17.1.7.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed and configured in admin mode.
-
You are logged in to the OpenShift Container Platform cluster as a user with
cluster-adminprivileges.
5.17.1.7.2. Schedule creation command 링크 복사링크가 클립보드에 복사되었습니다!
To create a backup schedule, use the following command:
$ oc oadp schedule create <schedule_name> [flags]
| Flag | Description |
|---|---|
|
|
The cron expression for the schedule, for example, |
|
|
The namespaces to include in scheduled backups. The default value is |
|
| The namespaces to exclude from scheduled backups. |
|
|
The resources to include in scheduled backups. You can specify simple kind names, for example, |
|
|
The resources to exclude from scheduled backups. This flag uses the same format as the |
|
| The name of the backup storage location to use. |
|
| The volume snapshot location or locations to use. |
|
| A label selector to filter resources. |
|
|
Specifies whether to take persistent volume (PV) snapshots. The default value is |
|
| Specifies whether to move snapshot data to the backup storage location. |
|
| Specifies whether to use a file system backup for all volumes. |
|
| Specifies whether to include cluster-scoped resources. |
|
|
The backup retention period. The default value is |
|
| The timeout for the request to the Kubernetes API server. |
Example of the schedule creation command
$ oc oadp schedule create daily-backup \
--schedule "0 1 * * *" \
--include-namespaces my-namespace \
--ttl 720h
5.17.1.7.3. Schedule listing command 링크 복사링크가 클립보드에 복사되었습니다!
To list all schedules, use the following command:
$ oc oadp schedule get [<schedule_name>] [flags]
| Flag | Description |
|---|---|
|
|
The output format. Supported values are |
5.17.1.7.4. Schedule description command 링크 복사링크가 클립보드에 복사되었습니다!
To view the details of a schedule, use the following command:
$ oc oadp schedule describe <schedule_name>
5.17.1.7.5. Schedule deletion command 링크 복사링크가 클립보드에 복사되었습니다!
To delete a schedule, use the following command:
$ oc oadp schedule delete <schedule_name> [flags]
| Flag | Description |
|---|---|
|
| Specifies whether to confirm the deletion without prompting. |
5.17.1.8. Backup storage location management commands 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to create, view, set, and delete backup storage locations (BSLs). Backup storage locations define where backup data is stored, such as an object storage bucket.
5.17.1.8.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed and configured in admin mode.
-
You are logged in to the OpenShift Container Platform cluster as a user with
cluster-adminprivileges.
5.17.1.8.2. Backup storage location creation command 링크 복사링크가 클립보드에 복사되었습니다!
To create a backup storage location, use the following command:
$ oc oadp backup-location create <bsl_name> [flags]
| Flag | Description |
|---|---|
|
|
The name of the cloud provider, for example, |
|
| The name of the object storage bucket. |
|
| The path prefix within the bucket. |
|
|
The secret and key for the provider credentials in the format |
|
|
The provider-specific configuration as |
|
| The frequency at which to synchronize the backup contents from object storage. |
|
| The timeout for the request to the Kubernetes API server. |
Example of the backup storage location creation command
$ oc oadp backup-location create my-bsl \
--provider aws \
--bucket my-velero-bucket \
--prefix velero \
--credential cloud-credentials=cloud
5.17.1.8.3. Backup storage location listing command 링크 복사링크가 클립보드에 복사되었습니다!
To list all backup storage locations, use the following command:
$ oc oadp backup-location get [<bsl_name>] [flags]
| Flag | Description |
|---|---|
|
|
The output format. Supported values are |
5.17.1.8.4. Default backup storage location command 링크 복사링크가 클립보드에 복사되었습니다!
To set the default backup storage location, use the following command:
$ oc oadp backup-location set <bsl_name>
5.17.1.8.5. Backup storage location deletion command 링크 복사링크가 클립보드에 복사되었습니다!
To delete a backup storage location, use the following command:
$ oc oadp backup-location delete <bsl_name> [flags]
| Flag | Description |
|---|---|
|
| Specifies whether to confirm the deletion without prompting. |
5.17.1.9. Volume snapshot location management commands 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to create, view, set, and delete volume snapshot locations (VSLs). Volume snapshot locations define where persistent volume (PV) snapshots are stored.
5.17.1.9.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed and configured in admin mode.
-
You are logged in to the OpenShift Container Platform cluster as a user with
cluster-adminprivileges.
5.17.1.9.2. Volume snapshot location creation command 링크 복사링크가 클립보드에 복사되었습니다!
To create a volume snapshot location, use the following command:
$ oc oadp snapshot-location create <vsl_name> [flags]
| Flag | Description |
|---|---|
|
|
The name of the cloud provider, for example, |
|
|
The provider-specific configuration as |
|
| The timeout for the request to the Kubernetes API server. |
Example of the volume snapshot location creation command
$ oc oadp snapshot-location create my-vsl \
--provider aws \
--config region=us-east-1
5.17.1.9.3. Volume snapshot location listing command 링크 복사링크가 클립보드에 복사되었습니다!
To list all volume snapshot locations, use the following command:
$ oc oadp snapshot-location get [<vsl_name>] [flags]
| Flag | Description |
|---|---|
|
|
The output format. Supported values are |
5.17.1.9.4. Default volume snapshot location command 링크 복사링크가 클립보드에 복사되었습니다!
To set the default volume snapshot location, use the following command:
$ oc oadp snapshot-location set <vsl_name>
5.17.1.9.5. Volume snapshot location deletion command 링크 복사링크가 클립보드에 복사되었습니다!
To delete a volume snapshot location, use the following command:
$ oc oadp snapshot-location delete <vsl_name> [flags]
| Flag | Description |
|---|---|
|
| Specifies whether to confirm the deletion without prompting. |
5.17.1.10. NonAdminBackupStorageLocation approval request commands 링크 복사링크가 클립보드에 복사되었습니다!
When the OADP Operator is configured with nonAdmin.requireApprovalForBSL: true, non-admin users who create a NonAdminBackupStorageLocation (NABSL) object trigger an approval request. You can use the OADP command-line interface (CLI) to view, describe, approve, and reject these requests.
5.17.1.10.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed and configured in admin mode.
-
You are logged in to the OpenShift Container Platform cluster as a user with
cluster-adminprivileges. -
The
DataProtectionApplicationcustom resource (CR) is configured withnonAdmin.enable: trueandnonAdmin.requireApprovalForBSL: true.
5.17.1.10.2. NABSL approval request listing command 링크 복사링크가 클립보드에 복사되었습니다!
To list all pending NABSL approval requests, use the following command:
$ oc oadp nabsl-request get [<request_name>] [flags]
| Flag | Description |
|---|---|
|
|
The output format. Supported values are |
The output displays the request name, namespace, phase, requested NABSL name, requested namespace, and age.
5.17.1.10.3. NABSL approval request description command 링크 복사링크가 클립보드에 복사되었습니다!
To view the full details of an approval request, including the requested backup storage location specification, use the following command:
$ oc oadp nabsl-request describe <request_name>
You can specify the request by using either the NABSL name or the full UUID.
5.17.1.10.4. NABSL approval request approval command 링크 복사링크가 클립보드에 복사되었습니다!
To approve a pending request and allow the controller to create the corresponding BackupStorageLocation object, use the following command:
$ oc oadp nabsl-request approve <request_name> [flags]
| Flag | Description |
|---|---|
|
| The reason for the approval. This flag is optional. |
You can specify the request by using either the NABSL name or the full UUID.
Example of the NABSL approval request approval command
$ oc oadp nabsl-request approve user-test-bsl --reason "Approved for production use"
5.17.1.10.5. NABSL approval request rejection command 링크 복사링크가 클립보드에 복사되었습니다!
To reject a pending request and deny the user’s request for a backup storage location, use the following command:
$ oc oadp nabsl-request reject <request_name> [flags]
| Flag | Description |
|---|---|
|
| The reason for the rejection. This flag is recommended. |
You can specify the request by using either the NABSL name or the full UUID.
Example of the NABSL approval request rejection command
$ oc oadp nabsl-request reject user-test-bsl --reason "Invalid configuration"
5.17.1.11. Collect diagnostic data 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to collect diagnostic information for OADP installations. The must-gather command runs the OADP must-gather tool to collect logs and cluster state information needed for troubleshooting and support cases.
Prerequisites
- The OADP CLI plugin is installed and configured in admin mode.
-
You are logged in to the OpenShift Container Platform cluster as a user with
cluster-adminprivileges. -
The
ocCLI is installed and available on yourPATH.
Procedure
Collect OADP diagnostic information:
$ oc oadp must-gather [flags]Expand 표 5.27. Flags for the oc oadp must-gather command Flag Description --dest-dirThe directory where the must-gather output is stored. The default value is
./must-gather.--request-timeoutThe timeout for the gather script, for example,
30sor1m.--skip-tlsSpecifies whether to skip Transport Layer Security (TLS) verification.
Example of the must-gather command
$ oc oadp must-gather --dest-dir=/tmp/oadp-diagnostics --request-timeout=1m
5.17.1.12. OADP self-service 링크 복사링크가 클립보드에 복사되었습니다!
Non-administrator users can use OADP self-service to perform backup and restore operations in their authorized namespaces without requiring cluster-wide administrator privileges.
This feature provides secure, self-service data protection while maintaining administrator controls over backup and restore operations.
You can use OADP self-service to complete the following tasks:
- Create and manage namespace-scoped backups and restores.
- View backup and restore status and logs.
- Create dedicated backup storage locations with user-owned buckets and credentials.
5.17.1.12.1. Limitations 링크 복사링크가 클립보드에 복사되었습니다!
- Cross-cluster operations and migrations are not supported for non-administrator users.
-
Non-administrator volume snapshot locations (VSLs) are not supported. The VSL configured by the cluster administrator in the
DataProtectionApplicationcustom resource (CR) is used. - Backups and restores are scoped to the namespace from which the command is run. You cannot specify a different namespace.
- Cluster-scoped resources cannot be included in backups or restores.
-
ResourceModifiersand volume policies are not supported for non-administrator backup and restore operations. -
Backup and restore logs by using a
NonAdminDownloadRequestobject are not supported for default backup storage locations (BSLs). To access logs, you must create aNonAdminBackupStorageLocationobject.
5.17.1.12.2. Prerequisites for non-administrator users 링크 복사링크가 클립보드에 복사되었습니다!
Before you use OADP self-service, a cluster administrator must complete the following tasks:
-
Install and configure the OADP Operator with
nonAdmin.enable: truein theDataProtectionApplicationCR specification. - Create your user account, namespace, and namespace privileges, such as namespace administrator.
Grant editor roles for the following resources in your namespace:
-
nonadminbackups.oadp.openshift.io -
nonadminrestores.oadp.openshift.io -
nonadminbackupstoragelocations.oadp.openshift.io -
nonadmindownloadrequests.oadp.openshift.io
-
-
Optionally, create a
NonAdminBackupStorageLocationobject for your namespace.
5.17.1.13. Non-admin backup management commands 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to create, view, describe, and delete non-admin backups in your namespace.
5.17.1.13.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed and configured in non-admin mode.
- You are logged in to the OpenShift Container Platform cluster and your current namespace context is set to the namespace you want to back up.
-
You have editor roles for
nonadminbackups.oadp.openshift.ioin your namespace. -
A
NonAdminBackupStorageLocationobject exists in your namespace, or a default has been configured by running theoc oadp client config set default-nabsl=<name>command.
5.17.1.13.2. Non-admin backup creation command 링크 복사링크가 클립보드에 복사되었습니다!
To create a backup of resources in your current namespace, use the following command:
$ oc oadp nonadmin backup create <backup_name> [flags]
| Flag | Description |
|---|---|
|
|
The name of the |
|
|
The resources to include in the backup. You can specify simple kind names, for example, |
|
|
The resources to exclude from the backup. This flag uses the same format as the |
|
| Specifies to back up only the resources that match this label selector. |
|
|
Specifies to back up resources that match at least one of the label selectors, separated by |
|
|
The amount of time before the backup can be garbage collected. The default value is |
|
| The timeout for Container Storage Interface (CSI) snapshot creation. |
|
| The timeout for asynchronous plugin operations. |
|
| Specifies whether to take snapshots of persistent volumes (PVs) as part of the backup. |
|
| Specifies whether to move snapshot data to the backup storage location. |
|
| Specifies whether to use pod volume file system backups by default for all volumes. |
Example of the non-admin backup creation command
$ oc oadp nonadmin backup create my-backup \
--storage-location my-nabsl \
--include-resources deployments,services \
--selector app=myapp \
--snapshot-volumes \
--ttl 720h
To avoid specifying the storage location on each backup, run the following command to set a default:
$ oc oadp client config set default-nabsl=<nabsl_name>
5.17.1.13.3. Non-admin backup listing command 링크 복사링크가 클립보드에 복사되었습니다!
To list all backups in your current namespace, use the following command:
$ oc oadp nonadmin backup get [<backup_name>] [flags]
| Flag | Description |
|---|---|
|
|
The output format. Supported values are |
5.17.1.13.4. Non-admin backup description command 링크 복사링크가 클립보드에 복사되었습니다!
To view the details of a backup, use the following command:
$ oc oadp nonadmin backup describe <backup_name> [flags]
| Flag | Description |
|---|---|
|
| Specifies whether to display additional backup details, including volume snapshots, resource lists, and item operations. |
|
| The timeout for fetching backup details from the server. |
5.17.1.13.5. Non-admin backup logs command 링크 복사링크가 클립보드에 복사되었습니다!
To view the logs for a backup, use the following command:
$ oc oadp nonadmin backup logs <backup_name> [flags]
| Flag | Description |
|---|---|
|
| The timeout for fetching logs from the server. |
Backup logs are available only when you use a NonAdminBackupStorageLocation object. Logs are not available for backups that use the default cluster backup storage location.
5.17.1.13.6. Non-admin backup deletion command 링크 복사링크가 클립보드에 복사되었습니다!
To delete one or more backups, use the following command:
$ oc oadp nonadmin backup delete [<backup_name>...] [flags]
| Flag | Description |
|---|---|
|
| Specifies whether to skip the confirmation prompt and delete immediately. |
|
| Specifies whether to delete all backups in the current namespace. |
Backup deletion is performed asynchronously by the OADP non-admin controller.
Example of the non-admin backup deletion command
$ oc oadp nonadmin backup delete my-backup --confirm
5.17.1.14. Non-administrator restore management commands 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to create, view, describe, and delete non-administrator restores in your namespace.
5.17.1.14.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed and configured in non-administrator mode.
- You are logged in to the OpenShift Container Platform cluster and your current namespace context is set to the namespace you want to restore into.
-
You have editor roles for
nonadminrestores.oadp.openshift.ioin your namespace. - A completed non-administrator backup exists to restore from.
5.17.1.14.2. Non-administrator restore creation command 링크 복사링크가 클립보드에 복사되었습니다!
To create a restore from an existing non-administrator backup, use the following command:
$ oc oadp nonadmin restore create [<restore_name>] [flags]
where:
<restore_name>- Specifies the name of the restore. This value is optional. If you do not provide a name, a name is automatically generated.
| Flag | Description |
|---|---|
|
| The name of the non-administrator backup to restore from. This flag is required. |
|
|
The resources to include in the restore. You can specify simple kind names, for example, |
|
|
The resources to exclude from the restore. This flag uses the same format as the |
|
| Specifies that only the resources that match this label selector are restored. |
|
|
Specifies that resources that match at least one of the label selectors, separated by |
|
| The timeout for asynchronous plugin operations. |
Example of the non-administrator restore creation command
$ oc oadp nonadmin restore create my-restore \
--backup-name my-backup \
--include-resources deployments,services \
--selector app=myapp
5.17.1.14.3. Non-administrator restore listing command 링크 복사링크가 클립보드에 복사되었습니다!
To list all restores in your current namespace, use the following command:
$ oc oadp nonadmin restore get [<restore_name>] [flags]
where:
<restore_name>- Specifies the name of the restore. This value is optional.
| Flag | Description |
|---|---|
|
|
The output format. Supported values are |
5.17.1.14.4. Non-administrator restore description command 링크 복사링크가 클립보드에 복사되었습니다!
To view the details of a restore, use the following command:
$ oc oadp nonadmin restore describe <restore_name> [flags]
where:
<restore_name>- Specifies the name of the restore.
| Flag | Description |
|---|---|
|
| Specifies whether to display additional restore details. |
|
| The timeout for fetching restore details from the server. |
5.17.1.14.5. Non-administrator restore logs command 링크 복사링크가 클립보드에 복사되었습니다!
To view the logs for a restore, use the following command:
$ oc oadp nonadmin restore logs <restore_name> [flags]
where:
<restore_name>- Specifies the name of the restore.
| Flag | Description |
|---|---|
|
| The timeout for fetching logs from the server. |
Restore logs are available only when you use a NonAdminBackupStorageLocation object. Logs are not available for restores associated with backups that use the default cluster backup storage location.
5.17.1.14.6. Non-administrator restore deletion command 링크 복사링크가 클립보드에 복사되었습니다!
To delete one or more restores, use the following command:
$ oc oadp nonadmin restore delete [<restore_name>...] [flags]
where:
<restore_name>- Specifies the name of the restore. You can specify multiple restores.
| Flag | Description |
|---|---|
|
| Specifies whether to skip the confirmation prompt and delete immediately. |
|
| Specifies whether to delete all restores in the current namespace. |
Restore deletion is performed asynchronously by the OADP non-administrator controller.
Example of the non-administrator restore deletion command
$ oc oadp nonadmin restore delete my-restore --confirm
5.17.1.15. NonAdminBackupStorageLocation management commands 링크 복사링크가 클립보드에 복사되었습니다!
You can use the OADP command-line interface (CLI) to create and view NonAdminBackupStorageLocation (NABSL) objects in your namespace. NABSLs define where your backup data is stored by using object storage that you own and manage.
Updating or deleting NABSLs after creation is not supported for non-administrator users.
5.17.1.15.1. Prerequisites 링크 복사링크가 클립보드에 복사되었습니다!
- The OADP CLI plugin is installed and configured in non-administrator mode.
- You are logged in to the OpenShift Container Platform cluster and your current namespace context is set to the target namespace.
-
You have editor roles for
nonadminbackupstoragelocations.oadp.openshift.ioin your namespace. -
You have a Kubernetes
Secretobject in your namespace that contains the credentials for your object storage provider.
5.17.1.15.2. NonAdminBackupStorageLocation creation command 링크 복사링크가 클립보드에 복사되었습니다!
To create a non-administrator backup storage location, use the following command:
$ oc oadp nonadmin bsl create <bsl_name> [flags]
where:
<bsl_name>- Specifies the name of the backup storage location.
| Flag | Description |
|---|---|
|
|
The storage provider, for example, |
|
| The name of the object storage bucket. This flag is required. |
|
|
The credential for this location in the format |
|
| The prefix for backup objects in the bucket. |
|
| The storage region. This flag is required for some providers, such as AWS. |
|
|
Additional provider-specific configuration as |
If the cluster administrator has enabled the requireApprovalForBSL parameter, the NABSL remains in a pending state until an administrator approves the request.
Example of the NABSL creation command
$ oc oadp nonadmin bsl create my-storage \
--provider aws \
--bucket my-velero-bucket \
--prefix velero-backups \
--credential cloud-credentials=cloud \
--region us-east-1
After you create a backup storage location (BSL), run the following command to set it as the default and avoid specifying the storage location on each backup:
$ oc oadp client config set default-nabsl=<bsl_name>
where:
<bsl_name>- Specifies the name of the backup storage location.
5.17.1.15.3. NonAdminBackupStorageLocation listing command 링크 복사링크가 클립보드에 복사되었습니다!
To list all non-administrator backup storage locations in your current namespace, use the following command:
$ oc oadp nonadmin bsl get [<bsl_name>] [flags]
where:
<bsl_name>- Specifies the name of the backup storage location. This value is optional.
| Flag | Description |
|---|---|
|
|
The output format. Supported values are |