Kubernetes 针对GKE群集的velero备份失败
我正在尝试使用Kubernetes 针对GKE群集的velero备份失败,kubernetes,backup,google-kubernetes-engine,velero,Kubernetes,Backup,Google Kubernetes Engine,Velero,我正在尝试使用velero创建GKE集群的备份。我成功地安装在GKE集群上,如下所示 $ kubectl get deployment/velero --namespace velero NAME READY UP-TO-DATE AVAILABLE AGE velero 1/1 1 1 43h $ kubectl get pods --namespace velero NAME
velero
创建GKE集群的备份。我成功地安装在GKE集群上
,如下所示
$ kubectl get deployment/velero --namespace velero
NAME READY UP-TO-DATE AVAILABLE AGE
velero 1/1 1 1 43h
$ kubectl get pods --namespace velero
NAME READY STATUS RESTARTS AGE
velero-847c69f497-hwv6l 1/1 Running 0 43h
gsutil mb gs://$BUCKET/
velero install --provider gcp --plugins velero/velero-plugin-for-gcp:v1.1.0 --bucket $BUCKET --secret-file ./credentials-velero
BUCKET=bucketname
$ velero backup describe backup-test-ns
Name: backup-test-ns
Namespace: velero
Labels: <none>
Annotations: <none>
Phase: New
Errors: 0
Warnings: 0
Namespaces:
Included: backup-test
Excluded: <none>
Resources:
Included: *
Excluded: <none>
Cluster-scoped: auto
Label selector: <none>
Storage Location:
Velero-Native Snapshot PVs: auto
TTL: 720h0m0s
Hooks: <none>
Backup Format Version:
Started: <n/a>
Completed: <n/a>
Expiration: <nil>
Velero-Native Snapshots: <none included>
我执行了下面的命令来启动备份
$ velero backup create cluster1-backup --include-namespaces default --snapshot-volumes
Backup request "cluster1-backup" submitted successfully.
Run `velero backup describe cluster1-backup` or `velero backup logs cluster1-backup` for more details.
看起来备份过程失败了
$ velero backup describe cluster1-backup
Name: cluster1-backup
Namespace: velero
Labels: velero.io/storage-location=default
Annotations: velero.io/source-cluster-k8s-gitversion=v1.15.12-gke.20
velero.io/source-cluster-k8s-major-version=1
velero.io/source-cluster-k8s-minor-version=15+
Phase: Failed (run `velero backup logs cluster1-backup` for more information)
Errors: 0
Warnings: 0
Namespaces:
Included: default
Excluded: <none>
Resources:
Included: *
Excluded: <none>
Cluster-scoped: auto
Label selector: <none>
Storage Location: default
Velero-Native Snapshot PVs: true
TTL: 720h0m0s
Hooks: <none>
Backup Format Version: 1.1.0
Started: 2020-10-05 09:57:12 +0000 UTC
Completed: <n/a>
Expiration: 2020-11-04 09:57:12 +0000 UTC
Velero-Native Snapshots: <none included>
$ velero get backups
NAME STATUS ERRORS WARNINGS CREATED EXPIRES STORAGE LOCATION SELECTOR
cluster1-backup Failed 0 0 2020-10-05 09:57:12 +0000 UTC 29d default <none>
我在SharedVPC
上使用public GKE群集
,并且主授权网络
仅启用
35.235.240.0/20 . 有什么解决问题的建议吗?问题现在已经解决了
在日志中看到以下错误
kubectl logs deployment/velero -n velero
time=“2020-10-05T13:41:19Z”level=error msg=“获取此位置的备份存储”backupLocation=default controller=backup sync error=“备份存储位置的bucket name\”gs://bucketname/\”不能包含“/”(如果使用前缀,则将其放在“prefix”字段中)“error.file”=“/go/src/github.com/vmware tanzu/velero/pkg/persistence/object_store.go:110”error.function=github.com/vmware-tanzu/velero/pkg/persistence.NewObjectBackupStore logSource=“pkg/controller/backup_sync_controller.go:168”
创建环境变量时,bucket名称后面有一个“/”
似乎在创建环境变量时,我们不必在环境变量中添加“gs://”
BUCKET=bucketname
如果铲斗不存在,则按如下所示创建铲斗
$ kubectl get deployment/velero --namespace velero
NAME READY UP-TO-DATE AVAILABLE AGE
velero 1/1 1 1 43h
$ kubectl get pods --namespace velero
NAME READY STATUS RESTARTS AGE
velero-847c69f497-hwv6l 1/1 Running 0 43h
gsutil mb gs://$BUCKET/
velero install --provider gcp --plugins velero/velero-plugin-for-gcp:v1.1.0 --bucket $BUCKET --secret-file ./credentials-velero
BUCKET=bucketname
$ velero backup describe backup-test-ns
Name: backup-test-ns
Namespace: velero
Labels: <none>
Annotations: <none>
Phase: New
Errors: 0
Warnings: 0
Namespaces:
Included: backup-test
Excluded: <none>
Resources:
Included: *
Excluded: <none>
Cluster-scoped: auto
Label selector: <none>
Storage Location:
Velero-Native Snapshot PVs: auto
TTL: 720h0m0s
Hooks: <none>
Backup Format Version:
Started: <n/a>
Completed: <n/a>
Expiration: <nil>
Velero-Native Snapshots: <none included>
在安装velero服务器期间,不要在velero安装
命令中的bucket name之前添加gs://如下所示
$ kubectl get deployment/velero --namespace velero
NAME READY UP-TO-DATE AVAILABLE AGE
velero 1/1 1 1 43h
$ kubectl get pods --namespace velero
NAME READY STATUS RESTARTS AGE
velero-847c69f497-hwv6l 1/1 Running 0 43h
gsutil mb gs://$BUCKET/
velero install --provider gcp --plugins velero/velero-plugin-for-gcp:v1.1.0 --bucket $BUCKET --secret-file ./credentials-velero
BUCKET=bucketname
$ velero backup describe backup-test-ns
Name: backup-test-ns
Namespace: velero
Labels: <none>
Annotations: <none>
Phase: New
Errors: 0
Warnings: 0
Namespaces:
Included: backup-test
Excluded: <none>
Resources:
Included: *
Excluded: <none>
Cluster-scoped: auto
Label selector: <none>
Storage Location:
Velero-Native Snapshot PVs: auto
TTL: 720h0m0s
Hooks: <none>
Backup Format Version:
Started: <n/a>
Completed: <n/a>
Expiration: <nil>
Velero-Native Snapshots: <none included>
有没有办法检查备份的进度?