tar zxf velero-v1.12.2-linux-amd64.tar.gz
mv velero-v1.12.2-linux-amd64/velero /usr/local/bin/
# S3 + Credential
velero install \
--provider aws \
--plugins docker.io/velero/velero-plugin-for-aws:v1.8.2 \
--bucket ps-lucas-velero-backup-test \
--backup-location-config region=ap-northeast-2 \
--snapshot-location-config region=ap-northeast-2 \
--secret-file velero-s3-test \ # IAM과 Key가 포함된 credential 파일 명
# S3 + ARN 사용
velero install \
--provider aws \
--plugins docker.io/velero/velero-plugin-for-aws:v1.8.2 \
--bucket ps-lucas-velero-backup-test \
--backup-location-config region=ap-northeast-2 \
--snapshot-location-config region=ap-northeast-2 \
--pod-annotations iam.amazonaws.com/role=arn:aws:iam::{ARN} \
--no-secret
# EFS + Credential 사용
velero install \
--provider aws \
--bucket velero \
--secret-file ./minio.credentials \
--backup-location-config region=minio,s3ForcePathStyle=true,s3Url=http://{cluster-ip}:9000 \
--plugins velero/velero-plugin-for-aws:v1.1.0 \
--use-volume-snapshots=false
kubectl create namespace test
kubectl apply -f https://k8s.io/examples/controllers/nginx-deployment.yaml -n test
# Namespace Backup
velero backup create backup --include-namespaces test
# Namespace Exclude Backup
velero backup create 231206-backup --exclude-namespaces kube-system,velero
# 백업 스케줄링 예시
velero schedule create backup --schedule="*/10 * * * *" --exclude-namespaces kube-system,velero
#예상 결과물
velero backup get
NAME STATUS ERRORS WARNINGS CREATED EXPIRES STORAGE LOCATION SELECTOR
backup-20220209044049 Completed 0 0 2022-02-09 13:40:49 +0900 KST 29d default <none>
backup-20220209043115 Completed 0 0 2022-02-09 13:31:15 +0900 KST 29d default <none>
# Restore
velero create restore --from-backup test-backup
[주의]
스토리지 클래스(StorageClass) 자원은 백업 및 복구되지 않으므로,
복구 전에 백업 클러스터에 존재하는 것과 동일한 이름의 스토리지 클래스를
복구 클러스터에 미리 생성해 두어야 합니다.
[주의]
백업 클러스터와 복구 클러스터의 버전이 다른 경우 복구 시 문제가 발생할 수 있습니다.
Backup 주기 결정
NS별로 백업을 할지 or 몇몇 NS 제외하고 전체 백업할지 결정
만약 제외방식 선택 시 Backup에서 제외해야할 NS 결정