Install Velero
Velero is an open source tool to safely back up, recover, and migrate Kubernetes clusters and persistent volumes. It works both on premises and in a public cloud. Velero consists of a server process running as a deployment in your Kubernetes cluster and a command-line interface (CLI) with which DevOps teams and platform operators configure scheduled backups, trigger ad-hoc backups, perform restores, and more.
Installation​
To install Velero, follow the steps below:
-
Create velero namespace:
kubectl create namespace velero
-
Add a chart repository:
helm repo add vmware-tanzu https://vmware-tanzu.github.io/helm-charts
helm repo updatenoteVelero AWS Plugin requires access to AWS resources. To configure access, please refer to the IRSA for Velero documentation.
-
Install Velero v.2.14.13:
helm install velero vmware-tanzu/velero \
--version 2.14.13 \
--values values.yaml \
--namespace veleroCheck out the values.yaml file sample of the Velero customization:
View: values.yaml
image:
repository: velero/velero
tag: v1.5.3
securityContext:
fsGroup: 65534
restic:
securityContext:
fsGroup: 65534
serviceAccount:
server:
create: true
name: edp-velero
annotations:
eks.amazonaws.com/role-arn: "arn:aws:iam::<AWS_ACCOUNT_ID>:role/AWSIRSA‹CLUSTER_NAME›‹VELERO_NAMESPACE›Velero"
credentials:
useSecret: false
configuration:
provider: aws
backupStorageLocation:
name: default
bucket: velero-<CLUSTER_NAME>
config:
region: eu-central-1
volumeSnapshotLocation:
name: default
config:
region: <AWS_REGION>
initContainers:
- name: velero-plugin-for-aws
image: velero/velero-plugin-for-aws:v1.1.0
volumeMounts:
- mountPath: /target
name: plugins -
Install the client side (velero cli) according to the official documentation.
Configuration​
-
Create backup for all components in the namespace:
velero backup create <BACKUP_NAME> --include-namespaces <NAMESPACE>
-
Create a daily backup of the namespace:
velero schedule create <BACKUP_NAME> --schedule "0 10 * * MON-FRI" --include-namespaces <NAMESPACE> --ttl 120h0m0s
-
To restore from backup, use the following command:
velero restore create <RESTORE_NAME> --from-backup <BACKUP_NAME>