|
| 1 | +--- |
| 2 | +title: "Install Velero" |
| 3 | +description: "Learn how to install Velero for Kubernetes backup, recovery, and migration, covering installation steps, AWS plugin configuration, and basic commands for backup and restore." |
| 4 | +sidebar_label: "Install Velero" |
| 5 | +--- |
| 6 | +<!-- markdownlint-disable MD025 --> |
| 7 | + |
| 8 | +# Install Velero |
| 9 | + |
| 10 | +<head> |
| 11 | + <link rel="canonical" href="https://docs.kuberocketci.io/docs/operator-guide/disaster-recovery/install-velero-add-ons" /> |
| 12 | +</head> |
| 13 | + |
| 14 | +[Velero](https://velero.io/) is an open source tool to safely back up, recover, and migrate Kubernetes clusters and persistent volumes. |
| 15 | +It works both on premises and in a public cloud. Velero consists of a server process running as a deployment in your |
| 16 | +Kubernetes cluster and a command-line interface (CLI) with which DevOps teams and platform operators configure scheduled |
| 17 | +backups, trigger ad-hoc backups, perform restores, and more. |
| 18 | + |
| 19 | +--- |
| 20 | +title: "Install Velero" |
| 21 | +description: "Learn how to install Velero for Kubernetes backup, recovery, and migration, covering installation steps, AWS plugin configuration, and basic commands for backup and restore." |
| 22 | +sidebar_label: "Install Velero" |
| 23 | +--- |
| 24 | +<!-- markdownlint-disable MD025 --> |
| 25 | + |
| 26 | +# Install Velero |
| 27 | + |
| 28 | +<head> |
| 29 | + <link rel="canonical" href="https://docs.kuberocketci.io/docs/operator-guide/disaster-recovery/install-velero-add-ons" /> |
| 30 | +</head> |
| 31 | + |
| 32 | +[Velero](https://velero.io/) is an open source tool to safely back up, recover, and migrate Kubernetes clusters and persistent volumes. |
| 33 | +It works both on premises and in a public cloud. Velero consists of a server process running as a deployment in your |
| 34 | +Kubernetes cluster and a command-line interface (CLI) with which DevOps teams and platform operators configure scheduled |
| 35 | +backups, trigger ad-hoc backups, perform restores, and more. |
| 36 | + |
| 37 | +Configuring and installing Velero involves two key steps: |
| 38 | + |
| 39 | +- **Setting up AWS resources** – configuring IAM roles and policies. |
| 40 | +- **Installing Velero** – deploying the Velero components into the Kubernetes cluster. |
| 41 | + |
| 42 | +### Configuring AWS IAM Roles and Policies |
| 43 | + |
| 44 | +Velero requires specific IAM permissions to interact with AWS resources. These permissions allow Velero to create and manage EBS snapshots and volumes, as well as read and write backup data to the designated S3 bucket. This policy ensures Velero can perform backup and restore operations within your AWS account. |
| 45 | + |
| 46 | +:::note |
| 47 | + Make sure that IRSA is enabled and [amazon-eks-pod-identity-webhook](https://github.com/aws/amazon-eks-pod-identity-webhook/tree/master) is deployed according to the [Associate IAM Roles With Service Accounts](../infrastructure-providers/aws/enable-irsa.md) documentation. |
| 48 | +::: |
| 49 | + |
| 50 | +To simplify the setup, we recommend using the [terraform-module/velero/kubernetes](https://registry.terraform.io/modules/terraform-module/velero/kubernetes/latest) module. This module automates the creation of the necessary IAM roles and policies for Velero. |
| 51 | + |
| 52 | +This setup assumes your cluster uses on-demand instances with 24/7 availability. If your cluster configuration differs, adjust the settings to match your needs. You can find Velero configuration parameters in the [terraform-aws-platform](https://github.com/KubeRocketCI/terraform-aws-platform/blob/master/eks/irsa.tf#L345) repository. |
| 53 | + |
| 54 | +With this configuration, the following IAM role will be created: |
| 55 | + |
| 56 | +- **AWSIRSA_\<ClusterName\>_Velero**: This role will be used by Velero to perform backup and restore operations by managing EBS snapshots and accessing the S3 backup bucket. The attached policy grants Velero the required permissions to perform backup and restore operations in AWS. It includes the following capabilities: |
| 57 | + |
| 58 | + - **EC2 permissions** — allow Velero to create, describe, tag, and delete EBS snapshots and volumes used during backup and restore processes. |
| 59 | + - **S3 bucket access** — allows listing the backup bucket and performing read/write operations on objects, including uploading backup data, retrieving it during restores, and deleting or tagging objects as needed. |
| 60 | + |
| 61 | +### Install Velero |
| 62 | + |
| 63 | +To deploy Velero in your Kubernetes cluster, we recommend using the [add-ons approach](https://github.com/epam/edp-cluster-add-ons/tree/main/clusters/core/addons/velero). Here's an example of how to configure values.yaml before installation: |
| 64 | + |
| 65 | +```yaml title="values.yaml" |
| 66 | +velero: |
| 67 | + serviceAccount: |
| 68 | + server: |
| 69 | + create: true |
| 70 | + name: velero-server |
| 71 | + annotations: |
| 72 | + eks.amazonaws.com/role-arn: "arn:aws:iam::01234567890:role/AWSIRSA_Core_Velero" |
| 73 | + |
| 74 | + credentials: |
| 75 | + useSecret: false |
| 76 | + |
| 77 | + configuration: |
| 78 | + backupStorageLocation: |
| 79 | + - name: default |
| 80 | + provider: aws |
| 81 | + bucket: velero-core |
| 82 | + prefix: velero |
| 83 | + config: |
| 84 | + region: eu-central-1 |
| 85 | + volumeSnapshotLocation: |
| 86 | + - name: default |
| 87 | + provider: aws |
| 88 | + config: |
| 89 | + region: eu-central-1 |
| 90 | + |
| 91 | + initContainers: |
| 92 | + - name: velero-plugin-for-aws |
| 93 | + image: velero/velero-plugin-for-aws:v1.13.1 |
| 94 | + volumeMounts: |
| 95 | + - mountPath: /target |
| 96 | + name: plugins |
| 97 | + |
| 98 | + schedules: |
| 99 | + krci: |
| 100 | + disabled: true |
| 101 | + paused: false |
| 102 | + labels: |
| 103 | + cluster: core |
| 104 | + region: eu-central-1 |
| 105 | + schedule: "0 13 * * 1-5" |
| 106 | + useOwnerReferencesInBackup: false |
| 107 | + template: |
| 108 | + excludedClusterScopedResources: |
| 109 | + - persistentvolumes |
| 110 | + excludedNamespaceScopedResources: |
| 111 | + - persistentvolumeclaims |
| 112 | + includedNamespaces: |
| 113 | + - krci |
| 114 | + snapshotVolumes: false |
| 115 | + storageLocation: default |
| 116 | + ttl: 72h0m0s |
| 117 | +``` |
| 118 | +At the end of the file, you will find backup schedule settings that you can use as a template for creating your own schedules. |
| 119 | +
|
| 120 | +## Related Articles |
| 121 | +
|
| 122 | +* [Associate IAM Roles With Service Accounts](../infrastructure-providers/aws/enable-irsa.md) |
0 commit comments