首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >velero与velero-备份作业失败

velero与velero-备份作业失败
EN

Stack Overflow用户
提问于 2022-10-17 18:22:53
回答 1查看 102关注 0票数 0

k3s聚类

我使用过velero头盔安装:

代码语言:javascript
复制
helm install vmware-tanzu/velero --namespace velero-minio -f helm-custom-values-minio.yaml --generate-name --create-namespace

代码语言:javascript
复制
helm install vmware-tanzu/velero --namespace velero-aws -f helm-custom-values-aws.yaml --generate-name --create-namespace

自定义头盔值:

helm-custom-values-minio.yaml

代码语言:javascript
复制
configuration:
  provider: aws
  backupStorageLocation:
    bucket: k3s-backup
    name: minio
    default: false
    config:
      region: minio
      s3ForcePathStyle: true
      s3Url: http://10.10.5.15:9009
  volumeSnapshotLocation:
    name: minio
    config:
      region: minio
credentials:
 secretContents:
  cloud: |
    [default]
    aws_access_key_id=minioadm
    aws_secret_access_key=<password>
initContainers:
  - name: velero-plugin-for-aws
    image: velero/velero-plugin-for-aws:latest
    imagePullPolicy: IfNotPresent
    volumeMounts:
      - mountPath: /target
        name: plugins
snapshotsEnabled: true
deployRestic: true

和头盔-自定义价值观-aws.yaml

代码语言:javascript
复制
configuration:
  provider: aws
  backupStorageLocation:
    name: aws-s3
    bucket: k3s-backup-aws
    default: false
    provider: aws
    config:
      region: us-east-1
      s3ForcePathStyle: false
  volumeSnapshotLocation:
    name: aws-s3
    provider: aws
    config:
      region: us-east-1
credentials:
 secretContents:
  cloud: |
    [default]
    aws_access_key_id=A..............MJ
    aws_secret_access_key=qZ79rA/yVUq2c................xnIA
initContainers:
  - name: velero-plugin-for-aws
    image: velero/velero-plugin-for-aws:latest
    imagePullPolicy: IfNotPresent
    volumeMounts:
      - mountPath: /target
        name: plugins
snapshotsEnabled: true
deployRestic: true

velero备份任务:

代码语言:javascript
复制
velero create backup k3s-mongodb-restic-minio --include-namespaces mongodb --default-volumes-to-restic=true --storage-location minio -n velero-minio

velero create backup k3s-mongodb-restic-aws --include-namespaces mongodb --default-volumes-to-restic=true --storage-location aws-s3 -n velero-aws

……

他们都失败了:

代码语言:javascript
复制
Restic Backups:
  Failed:
    mongodb/mongodb-cluster-0: agent-scripts, data-volume, healthstatus, hooks, logs-volume, mongodb-cluster-keyfile, tmp
    mongodb/mongodb-cluster-1: agent-scripts, data-volume, healthstatus, hooks, logs-volume, mongodb-cluster-keyfile, tmp

time="2022-10-17T17:42:32Z" level=error msg="Error backing up item" backup=velero-minio/k3s-mongodb-restic-minio error="pod volume backup failed: running Restic backup, stderr=Fatal: unable to open config file: Stat: The Access Key Id you provided does not exist in our records.\nIs there a repository at the following location?\ns3:http://10.10.5.15:9009/k3s-backup/restic/mongodb\n: exit status 1" error.file="/go/src/github.com/vmware-tanzu/velero/pkg/restic/backupper.go:199" error.function="github.com/vmware-tanzu/velero/pkg/restic.(*backupper).BackupPodVolumes" logSource="pkg/backup/backup.go:417" name=mongodb-cluster-0

..。

代码语言:javascript
复制
velero get backup-locations -n velero-aws

NAME     PROVIDER   BUCKET/PREFIX    PHASE       LAST VALIDATED                  ACCESS MODE   DEFAULT
aws-s3   aws        k3s-backup-aws   Available   2022-10-17 14:12:46 -0400 EDT   ReadWrite 

..。

代码语言:javascript
复制
velero get backup-locations -n velero-minio

NAME    PROVIDER   BUCKET/PREFIX   PHASE       LAST VALIDATED                  ACCESS MODE   DEFAULT
minio   aws        k3s-backup      Available   2022-10-17 14:16:25 -0400 EDT   ReadWrite  

velero备份部件没有错误,但是restic对我的所有作业都失败了(mongodb是唯一的例子)。看起来restic无法为我的nfs pvc创建快照。

我做错了什么?

EN

回答 1

Stack Overflow用户

发布于 2022-10-20 19:14:05

看起来velero不适用于多个安装,至少restic部分失败了(在我的例子中,名称空间velero-awsvelero-minio中有两个实例)。因此,我只安装了一个velero实例来处理minio。

从备份作业配置中删除--default-volumes-to-restic=true

使用选择舱卷备份与restic集成。每个有pvc卷的吊舱都需要进行注释,如下所示:

代码语言:javascript
复制
kubectl -n mongodb annotate pod/mongodb-cluster-0 backup.velero.io/backup-volumes=logs-volume,data-volume

我还没有试过velero-pvc观察者,也许效果很好

现在备份工作时没有错误。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74101557

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档