### Example Usage of Priority Class Validation Source: https://github.com/velero-io/velero/blob/main/design/Implemented/priority-class-name-support_design.md Demonstrates how to call the validation function during installation and when reading configurations. ```go // During velero install if o.ServerPriorityClassName != "" { _ = kube.ValidatePriorityClass(ctx, kubeClient, o.ServerPriorityClassName, logger.WithField("component", "server")) // For install command, we continue even if validation fails (warnings are logged) } // When reading from ConfigMap in node-agent server priorityClassName, err := kube.GetDataMoverPriorityClassName(ctx, namespace, kubeClient, configMapName) if err == nil && priorityClassName != "" { // Validate the priority class exists in the cluster if kube.ValidatePriorityClass(ctx, kubeClient, priorityClassName, logger.WithField("component", "data-mover")) { dataMovePriorityClass = priorityClassName logger.WithField("priorityClassName", priorityClassName).Info("Using priority class for data mover pods") } else { logger.WithField("priorityClassName", priorityClassName).Warn("Priority class not found in cluster, data mover pods will use default priority") // Clear the priority class to prevent pod creation failures priorityClassName = "" } } ``` -------------------------------- ### View Restore Status Example Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/contributions/minio.md An example of the output from `velero restore get` after a restore has completed successfully. ```bash NAME BACKUP STATUS WARNINGS ERRORS CREATED SELECTOR nginx-backup-20170727200524 nginx-backup Completed 0 0 2017-07-27 20:05:24 +0000 UTC ``` -------------------------------- ### Velero Install for AWS Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/velero-install.md Example installation command for Velero on Amazon Web Services (AWS). Includes options for specifying the AWS provider, plugin, bucket, IAM credentials file, backup/snapshot location regions, and enabling the node agent. ```bash velero install --provider aws --plugins velero/velero-plugin-for-aws:v1.0.0 --bucket backups --secret-file ./aws-iam-creds --backup-location-config region=us-east-2 --snapshot-location-config region=us-east-2 --use-node-agent ``` -------------------------------- ### Velero Install for Azure Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/velero-install.md Example installation command for Velero on Microsoft Azure. Configures Azure provider, plugin, blob container, credentials file, and specifies backup/snapshot location details including API timeout and resource group. ```bash velero install --provider azure --plugins velero/velero-plugin-for-microsoft-azure:v1.0.0 --bucket $BLOB_CONTAINER --secret-file ./credentials-velero --backup-location-config resourceGroup=$AZURE_BACKUP_RESOURCE_GROUP,storageAccount=$AZURE_STORAGE_ACCOUNT_ID[,subscriptionId=$AZURE_BACKUP_SUBSCRIPTION_ID] --snapshot-location-config apiTimeout=[,resourceGroup=$AZURE_BACKUP_RESOURCE_GROUP,subscriptionId=$AZURE_BACKUP_SUBSCRIPTION_ID] ``` -------------------------------- ### Velero Install for GCP Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/velero-install.md Example installation command for Velero on Google Cloud Platform (GCP). Requires specifying the GCP provider, the corresponding plugin, a bucket name, and the path to the GCP service account JSON secret file. ```bash velero install --provider gcp --plugins velero/velero-plugin-for-gcp:v1.0.0 --bucket mybucket --secret-file ./gcp-service-account.json ``` -------------------------------- ### Install Velero server Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/contributions/minio.md Install Velero with the AWS plugin configured for a local Minio instance. ```bash velero install \ --provider aws \ --plugins velero/velero-plugin-for-aws:v1.2.1 \ --bucket velero \ --secret-file ./credentials-velero \ --use-volume-snapshots=false \ --backup-location-config region=minio,s3ForcePathStyle="true",s3Url=http://minio.velero.svc:9000 ``` -------------------------------- ### Install Velero in air-gapped environment Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/on-premises.md Use the velero install command with images sourced from a private registry. ```bash velero install \ --image=$PRIVATE_REG/velero:$VELERO_VERSION \ --plugins=$PRIVATE_REG/velero-plugin-for-aws:$PLUGIN_VERSION \ <....> ``` -------------------------------- ### Deploy example application Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/contributions/minio.md Deploy the nginx application to the cluster. ```bash kubectl apply -f examples/nginx-app/base.yaml ``` -------------------------------- ### Install Velero with VBDM Source: https://github.com/velero-io/velero/blob/main/design/Implemented/volume-snapshot-data-movement/volume-snapshot-data-movement.md Installation command for enabling CSI features and node-agent for VBDM. ```bash velero install \ --provider \ --image \ --features=EnableCSI \ --use-node-agent \ ``` -------------------------------- ### Start kind Cluster for Velero Tests Source: https://github.com/velero-io/velero/blob/main/test/e2e/README.md Command to start a kind cluster. Ensure your environment is set up for kind before running. ```bash kind create cluster ``` -------------------------------- ### Initialize volumeHelperImpl Source: https://github.com/velero-io/velero/blob/main/design/Implemented/Extend-VolumePolicies-to-support-more-actions.md Example of instantiating the volumeHelperImpl within the item_backupper workflow. ```go itemBackupper := &itemBackupper{ ... volumeHelperImpl: volumehelper.NewVolumeHelperImpl( resourcePolicy, backupRequest.Spec.SnapshotVolumes, log, kb.kbClient, boolptr.IsSetToTrue(backupRequest.Spec.DefaultVolumesToFsBackup), !backupRequest.ResourceIncludesExcludes.ShouldInclude(kuberesource.PersistentVolumeClaims.String()), ), } ``` -------------------------------- ### BackupRepository Example Source: https://github.com/velero-io/velero/blob/main/design/Implemented/repo_maintenance_job_config.md An example of a BackupRepository resource definition, showing labels that can be used for configuration matching. ```yaml - apiVersion: velero.io/v1 kind: BackupRepository metadata: generateName: test-default-kopia- labels: velero.io/repository-type: kopia velero.io/storage-location: default velero.io/volume-namespace: test name: test-default-kopia-kgt6n namespace: velero spec: backupStorageLocation: default maintenanceFrequency: 1h0m0s repositoryType: kopia resticIdentifier: gs:jxun:/restic/test volumeNamespace: test ``` -------------------------------- ### Clone Velero Examples Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/examples.md Clone the Velero repository to access example configurations and scripts. ```bash git clone https://github.com/vmware-tanzu/velero.git cd velero ``` -------------------------------- ### Install Velero with Pod Annotations Source: https://github.com/velero-io/velero/blob/main/site/content/posts/2019-08-22-announcing-velero-1.1.md The `velero install` command now supports the `--pod-annotations` argument for applying necessary annotations, which is useful for node-based IAM authentication systems like kube2iam. ```bash velero install --plugins --pod-annotations "=" ``` -------------------------------- ### Install Velero with Priority Class Configuration Source: https://github.com/velero-io/velero/blob/main/design/Implemented/priority-class-name-support_design.md Installs Velero using the `velero install` command, specifying priority class names for the server, node agent, and configuration ConfigMaps. Ensure the `--use-node-agent` flag is set if node agents are utilized. ```bash velero install \ --provider aws \ --server-priority-class-name velero-critical \ --node-agent-priority-class-name velero-standard \ --node-agent-configmap node-agent-config \ --repo-maintenance-job-configmap repo-maintenance-job-config \ --use-node-agent ``` -------------------------------- ### CLI Installation Commands Source: https://github.com/velero-io/velero/blob/main/design/Implemented/unified-repo-and-kopia-integration/unified-repo-and-kopia-integration.md Commands to install Velero with specific uploader types via CLI. ```bash velero install --uploader-type=restic --default-volumes-to-fs-backup --use-node-agent ``` ```bash velero install --uploader-type=kopia --default-volumes-to-fs-backup --use-node-agent ``` -------------------------------- ### Plugin Naming Examples Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/custom-plugins.md Valid formats for fully-qualified plugin names. ```text - example.io/azure - 1.2.3.4/5678 - example-with-dash.io/azure ``` -------------------------------- ### Run Velero server locally (AWS example) Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/run-locally.md Execute the Velero server binary locally. This example shows how to run it on macOS for AWS, specifying the path to cloud provider credentials. Ensure the Velero binary is in your PATH or use the full path. ```bash AWS_SHARED_CREDENTIALS_FILE= ./_output/bin/darwin/amd64/velero server [CLI flags] ``` -------------------------------- ### Install Velero with Backup Repository ConfigMap Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/backup-repository-configuration.md Use the CLI to specify the ConfigMap name during the initial Velero installation. ```shell velero install --backup-repository-configmap= ``` -------------------------------- ### Install Velero with Custom Resource Requests and Limits Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/customize-installation.md Use these flags with the `velero install` command to set custom resource requests and limits for Velero pods, node-agent pods, and the maintenance job. ```bash velero install \ --velero-pod-cpu-request \ --velero-pod-mem-request \ --velero-pod-cpu-limit \ --velero-pod-mem-limit \ [--use-node-agent] \ [--default-volumes-to-fs-backup] \ [--node-agent-pod-cpu-request ] \ [--node-agent-pod-mem-request ] \ [--node-agent-pod-cpu-limit ] \ [--node-agent-pod-mem-limit ] \ [--maintenance-job-cpu-request ] \ [--maintenance-job-mem-request ] \ [--maintenance-job-cpu-limit ] \ [--maintenance-job-mem-limit ] ``` -------------------------------- ### Add and Copy Operations Example Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/restore-resource-modifiers.md This example shows how to add a new container to a deployment and use the 'copy' operation to duplicate an existing container definition. Complex values like container specifications can be added by escaping YAML. ```yaml version: v1 resourceModifierRules: - conditions: groupResource: deployments.apps resourceNameRegex: "^test-.*$" namespaces: - bar - foo patches: # Dealing with complex values by escaping the yaml - operation: add path: "/spec/template/spec/containers/0" value: "{\"name\": \"nginx\", \"image\": \"nginx:1.14.2\", \"ports\": [{\"containerPort\": 80}]}" # Copy Operator - operation: copy from: "/spec/template/spec/containers/0" path: "/spec/template/spec/containers/1" ``` -------------------------------- ### Velero Install CLI Usage Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/velero-install.md This command installs Velero server components. Use flags to specify plugins, provider, bucket, secret file, resource requests/limits, and other configurations. Resource values follow Kubernetes format. Priority class names can be set for scheduling. ```bash velero install \ --plugins \ --provider \ --bucket \ --secret-file \ --velero-pod-cpu-request \ --velero-pod-mem-request \ --velero-pod-cpu-limit \ --velero-pod-mem-limit \ --kubelet-root-dir \ [--use-node-agent] \ [--default-volumes-to-fs-backup] \ [--node-agent-pod-cpu-request ] \ [--node-agent-pod-mem-request ] \ [--node-agent-pod-cpu-limit ] \ [--node-agent-pod-mem-limit ] \ [--maintenance-job-cpu-request ] \ [--maintenance-job-mem-request ] \ [--maintenance-job-cpu-limit ] \ [--maintenance-job-mem-limit ] \ [--server-priority-class-name ] \ [--node-agent-priority-class-name ] ``` -------------------------------- ### Plugin Configuration Source: https://github.com/velero-io/velero/blob/main/design/cli-install-changes.md Flags for installing plugins and managing service account credentials. ```text --plugins stringArray Plugin container images to install into the Velero Deployment --sa-annotations mapStringString annotations to add to the Velero ServiceAccount. Add iam.gke.io/gcp-service-account=[GSA_NAME]@[PROJECT_NAME].iam.gserviceaccount.com for workload identity. Optional. Format is key1=value1,key2=value2 --no-secret flag indicating if a secret should be created. Must be used as confirmation if --secret-file is not provided. Optional. --secret-file string (renamed `credentials-file`) file containing credentials for backup and volume provider. If not specified, --no-secret must be used for confirmation. Optional. ``` -------------------------------- ### ConfigMap Output Example Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/enable-api-group-versions-feature.md Expected output format when describing the enableapigroupversions ConfigMap. ```bash Name: enableapigroupversions Namespace: velero Labels: Annotations: Data ==== restoreResourcesVersionPriority: ---- rockbands.music.example.io=v2beta1,v2beta2 orchestras.music.example.io=v2,v3alpha1 subscriptions.operators.coreos.com=v2,v1 Events: ``` -------------------------------- ### Import Kubernetes API and Client Libraries Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/code-standards.md Example of importing Kubernetes API, client, and lister libraries with conventional aliases. ```go import ( corev1api "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" corev1client "k8s.io/client-go/kubernetes/typed/core/v1" corev1listers "k8s.io/client-go/listers/core/v1" velerov1api "github.com/vmware-tanzu/velero/pkg/apis/velero/v1" velerov1client "github.com/vmware-tanzu/velero/pkg/generated/clientset/versioned/typed/velero/v1" ) ``` -------------------------------- ### Register QEMU static binaries Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/build-from-source.md Run this command once to enable cross-platform container image building. ```bash $ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes ``` -------------------------------- ### Get Velero Backup Location Status Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/contributions/tencent-config.md Execute this command after installation to verify that Velero can access the configured storage location. A status of 'Available' indicates successful configuration. ```bash velero backup-location get ``` -------------------------------- ### Run website locally Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/website-guidelines.md Commands to start the website development server using either the project root or the site directory. ```bash make serve-docs ``` ```bash hugo serve ``` -------------------------------- ### Resource Modifier Rules Example Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/restore-resource-modifiers.md This YAML defines rules for modifying PersistentVolumeClaims (PVCs). It targets PVCs in 'bar' and 'foo' namespaces starting with 'mysql' and having the label 'foo: bar'. It replaces the storageClassName with 'premium' and removes the 'test' label. ```yaml version: v1 resourceModifierRules: - conditions: groupResource: persistentvolumeclaims resourceNameRegex: "^mysql.*$" namespaces: - bar - foo labelSelector: matchLabels: foo: bar patches: - operation: replace path: "/spec/storageClassName" value: "premium" - operation: remove path: "/metadata/labels/test" ``` -------------------------------- ### Velero Backup Setup Workflow Source: https://github.com/velero-io/velero/blob/main/design/cli-install-changes.md A high-level sequence of commands to prepare Velero for performing backups. ```bash velero config server [flags] (required) velero config restic [flags] velero plugin add IMAGES [flags] (add/config provider plugins) velero backup-location/snapshot-location create NAME [flags] (run `velero plugin --get` to see what kind of plugins are available; create locations) velero backup/restore/schedule create/get/delete NAME [flags] ``` -------------------------------- ### GET /velero backup-location get Source: https://github.com/velero-io/velero/blob/main/design/cli-install-changes.md Displays backup storage locations. ```APIDOC ## GET /velero backup-location get ### Description Display backup storage locations. ### Method GET ### Endpoint /velero backup-location get ### Parameters #### Query Parameters - **selector** (string) - Optional - Only show items matching this label selector. ``` -------------------------------- ### Confirm Velero Installation Source: https://github.com/velero-io/velero/blob/main/site/content/posts/2019-10-08-Velero-v1-1-on-vSphere.md Expected output message upon successful Velero installation. ```bash Velero is installed! ⛵ Use 'kubectl logs deployment/velero -n velero' to view the status. ``` -------------------------------- ### Create Certificate File Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/proxy.md Prepare a file containing all necessary certificates for proxy or object storage authentication. ```bash cat certs -----BEGIN CERTIFICATE----- certificates first content -----END CERTIFICATE----- -----BEGIN CERTIFICATE----- certificates second content -----END CERTIFICATE----- ``` -------------------------------- ### Example of failed build command Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/build-from-source.md Demonstrates a build failure when using the default driver for registry output. ```bash $ REGISTRY=ashishamarnath BUILDX_PLATFORMS=linux/arm64 BUILDX_OUTPUT_TYPE=registry make container auto-push is currently not implemented for docker driver make: *** [container] Error 1 ``` -------------------------------- ### Verify Velero Installation Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/contributions/oracle-config.md Run the velero command to verify the CLI is installed and accessible. ```bash $ velero Velero is a tool for managing disaster recovery, specifically for Kubernetes cluster resources. It provides a simple, configurable, and operationally robust way to back up your application state and associated data. If you're familiar with kubectl, Velero supports a similar model, allowing you to execute commands such as 'velero get backup' and 'velero create schedule'. The same operations can also be performed as 'velero backup get' and 'velero schedule create'. Usage: velero [command] ``` -------------------------------- ### Create and bootstrap Docker Buildx builder Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/build-from-source.md Initializes a new buildx builder instance required for multi-platform support. ```bash $ docker buildx create --use --name builder builder $ docker buildx inspect --bootstrap [+] Building 2.6s (1/1) FINISHED => [internal] booting buildkit 2.6s => => pulling image moby/buildkit:buildx-stable-1 1.9s => => creating container buildx_buildkit_builder0 0.7s Name: builder Driver: docker-container Nodes: Name: builder0 Endpoint: unix:///var/run/docker.sock Status: running Platforms: linux/amd64, linux/arm64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6 ``` -------------------------------- ### Policy Versioning Examples Source: https://github.com/velero-io/velero/blob/main/design/Implemented/handle-backup-of-volumes-by-resources-filters.md Examples of how policy versions are managed within the ConfigMap data. ```yaml version: v1 volumePolicies: .... ``` ```yaml version: v1 volumePolicies: .... clusterResourcePolicies: .... ``` ```yaml version: v2 # This is just an example, we should try to avoid break change volume-policies: .... ``` -------------------------------- ### Annotate Pod to Include Specific Volumes Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/file-system-backup.md Example command to include 'pvc-volume' and 'emptydir-volume' for file system backup for the pod 'sample' in the 'foo' namespace. ```bash kubectl -n foo annotate pod/sample backup.velero.io/backup-volumes=pvc-volume,emptydir-volume ``` -------------------------------- ### Install Velero Node Agent Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/file-system-backup.md Use this command to install the Velero Node Agent daemonset. ```bash velero install --use-node-agent ``` -------------------------------- ### Install Velero CLI on Windows Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/basic-install.md Use Chocolatey to install the Velero client on Windows systems. ```powershell choco install velero ``` -------------------------------- ### Create Nginx Backup (No PVs) Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/examples.md Create a Velero backup that includes the nginx-example namespace. This is for scenarios without Persistent Volumes. ```bash velero backup create nginx-backup --include-namespaces nginx-example ``` -------------------------------- ### Install Velero CLI on macOS Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/basic-install.md Use Homebrew to install the Velero client on macOS systems. ```bash brew install velero ``` -------------------------------- ### Run Tilt for Velero Development Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/tilt.md Launches the Velero development environment using Tilt. Ensure Tilt is installed and configured. ```bash tilt up ``` -------------------------------- ### Install Velero with Restic Source: https://github.com/velero-io/velero/blob/main/site/content/posts/2019-10-08-Velero-v1-1-on-vSphere.md Execute the Velero installation command with AWS provider and restic plugin enabled. ```bash $ velero install --provider aws --bucket velero \ --secret-file ./credentials-velero \ --use-volume-snapshots=false \ --use-restic \ --backup-location-config \ region=minio,s3ForcePathStyle="true",s3Url=http://minio.velero.svc:9000,publicUrl=http://192.168.192.5:32109 ``` -------------------------------- ### Install bash-completion v2 via Homebrew Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/customize-installation.md Use this command to install the required version of bash-completion on macOS. ```shell brew install bash-completion@2 ``` -------------------------------- ### Begin Directory Operation for Block Devices Source: https://github.com/velero-io/velero/blob/main/design/Implemented/volume-snapshot-data-movement/volume-snapshot-data-movement.md Initializes a directory operation, evaluating symlinks and verifying that the target path points to a block device. Requires the target path to be a block device. ```go func (o *BlockOutput) BeginDirectory(ctx context.Context, relativePath string, e fs.Directory) error { var err error o.targetFileName, err = filepath.EvalSymlinks(o.TargetPath) if err != nil { return errors.Wrapf(err, "unable to evaluate symlinks for %s", o.targetFileName) } fileInfo, err := os.Lstat(o.targetFileName) if err != nil { return errors.Wrapf(err, "unable to get the target device information for %s", o.TargetPath) } if (fileInfo.Sys().(*syscall.Stat_t).Mode & syscall.S_IFMT) != syscall.S_IFBLK { return errors.Errorf("target file %s is not a block device", o.TargetPath) } return nil } ``` -------------------------------- ### Create and Verify Backup with Hooks Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/backup-hooks.md Create a backup named nginx-hook-test and then use Velero logs to verify that the pre and post hooks are running and exiting without error. ```shell velero backup create nginx-hook-test ``` ```shell velero backup get nginx-hook-test ``` ```shell velero backup logs nginx-hook-test | grep hookCommand ``` -------------------------------- ### Install Velero with Repository Maintenance ConfigMap Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/repository-maintenance.md Use the CLI to specify a ConfigMap for repository maintenance job configurations during installation. ```bash velero install --repo-maintenance-job-configmap= ``` -------------------------------- ### Create Velero Backup Source: https://github.com/velero-io/velero/blob/main/site/content/posts/2019-10-10-Velero-v1-1-Stateful-Backup-vSphere.md Initiate a backup for the specified namespace. ```bash $ velero backup create cassandra --include-namespaces cassandra Backup request "cassandra" submitted successfully. Run `velero backup describe cassandra` or `velero backup logs cassandra` for more details. ``` -------------------------------- ### Install Velero with CSI Support Source: https://github.com/velero-io/velero/blob/main/site/content/posts/2020-05-27-CSI-integration.md Installs Velero with the required Microsoft Azure and CSI plugins, enabling the EnableCSI feature flag. ```bash velero install \ --provider azure \ --plugins velero/velero-plugin-for-microsoft-azure:v1.1.0,velero/velero-plugin-for-csi:v0.1.1 \ --bucket $BLOB_CONTAINER \ --secret-file /aks-creds \ --backup-location-config resourceGroup=$AZURE_BACKUP_RESOURCE_GROUP,storageAccount=$AZURE_STORAGE_ACCOUNT_ID,subscriptionId=$AZURE_BACKUP_SUBSCRIPTION_ID \ --snapshot-location-config apiTimeout=5m,resourceGroup=$AZURE_BACKUP_RESOURCE_GROUP,subscriptionId=$AZURE_BACKUP_SUBSCRIPTION_ID \ --image velero/velero:v1.4.0 \ --features=EnableCSI ``` -------------------------------- ### Install Velero with CSI support Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/csi.md Enable the EnableCSI feature flag during Velero installation to support CSI volume snapshot APIs. ```bash velero install \ --features=EnableCSI \ --plugins= \ ... ``` -------------------------------- ### Verify Namespace Status Source: https://github.com/velero-io/velero/blob/main/site/content/posts/2019-10-08-Velero-v1-1-on-vSphere.md List all namespaces to confirm the creation of the nginx-example namespace. ```bash $ kubectl get ns NAME STATUS AGE cassandra Active 23h default Active 5d3h kube-public Active 5d3h kube-system Active 5d3h nginx-example Active 4s velero Active 9m40s wavefront-collector Active 24h ``` -------------------------------- ### Uninstall Velero and Example App Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/contributions/minio.md Removes Velero, Minio, and the nginx example application from your Kubernetes cluster. This is a comprehensive cleanup step. ```bash kubectl delete namespace/velero clusterrolebinding/velero kubectl delete crds -l component=velero kubectl delete -f examples/nginx-app/base.yaml ``` -------------------------------- ### Apply Kustomize Overlays Source: https://github.com/velero-io/velero/blob/main/design/cli-install-changes.md Use this command to apply the kustomize overlays for plugin configurations. Ensure you have kustomize installed and configured. ```bash kubectl apply -k design/CLI/PoC/overlays/plugins/ ``` -------------------------------- ### Install Azure Disk CSI Driver Source: https://github.com/velero-io/velero/blob/main/site/content/posts/2020-05-27-CSI-integration.md Executes the installation script for the Azure disk CSI driver, including snapshot controller components. ```bash curl -skSL https://raw.githubusercontent.com/kubernetes-sigs/azuredisk-csi-driver/master/deploy/install-driver.sh | bash -s master snapshot -- ``` -------------------------------- ### Install Velero on Cluster 1 Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/migration-case.md Install Velero with the AWS plugin, specifying the object storage bucket and region. This configures the primary backup location. ```bash velero install --provider aws --image velero/velero:v1.8.0 --plugins velero/velero-plugin-for-aws:v1.4.0 --bucket velero-migration-demo --secret-file xxxx/aws-credentials-cluster1 --backup-location-config region=us-east-2 --snapshot-location-config region=us-east-2 ``` -------------------------------- ### Create backups Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/contributions/minio.md Create backups using label selectors to filter resources. ```bash velero backup create nginx-backup --selector app=nginx ``` ```bash velero backup create nginx-backup --selector 'backup notin (ignore)' ``` -------------------------------- ### Install Velero with a self-signed certificate Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/self-signed-certificates.md Use the `--cacert` flag with `velero install` to provide a path to a PEM-encoded certificate bundle for trusting self-signed certificates. ```bash velero install \ --plugins \ --provider \ --bucket \ --secret-file \ --cacert ``` -------------------------------- ### Prepare restore helper image for air-gapped registry Source: https://github.com/velero-io/velero/blob/main/site/content/docs/v1.18/on-premises.md Download, tag, and push the restore helper image required for File System Backup. ```bash PRIVATE_REG= VELERO_VERSION= docker pull velero/velero-restore-helper:$VELERO_VERSION docker tag velero/velero-restore-helper:$VELERO_VERSION $PRIVATE_REG/velero-restore-helper:$VELERO_VERSION docker push $PRIVATE_REG/velero-restore-helper:$VELERO_VERSION ```