【问题标题】:Problem restoring k8s cluster backup using heptio ark使用 heptio ark 恢复 k8s 集群备份时出现问题
【发布时间】:2020-02-06 19:11:42
【问题描述】:
我们正在尝试创建 k8s 集群的副本。我们已经在 s3 中进行了集群备份,这是由 ark 在集群内运行(作为计划)完成的。我正在尝试手动将数据恢复到新集群,我在 vm 中有 tar.gz 文件,但我不知道如何恢复它,文档和其他博客告诉使用 ark restore create --from-backup <backup-name> 。
我不确定我必须提供什么作为备份名称,我提取了备份文件并拥有资源目录,如 velero 文档中所述。我尝试了任何我能想到的名字。但是得到了An error occurred: backups.ark.heptio.com "<strings that I am trying as backup_name>" not found。
我是新手,所以请询问我是否需要提供更多信息。
【问题讨论】:
标签:
kubernetes
devops
velero
【解决方案1】:
我们将ark创建的备份存储在s3中,在ark的yml文件中配置。
为了查看旧集群中的备份,我们必须将新集群中的 ark schedular 映射到同一个 s3 存储桶,这可以通过在 ark yml 文件中配置 schedular 来完成。然后我们可以使用命令kubectl get crd检查自定义资源。
我们将获取所有自定义资源,检查 ark,它将类似于
backups.ark.heptio.com.
然后我们可以看到这个 crd 中有哪些备份。使用kubectl get backups.ark.heptio.com -n <ark-namespace>。
它应该显示所有可用的备份。应该有一个备份列表。然后使用恢复命令。
ark restore create --from-backup <name of the backup that you want to restore, we got it in the previous step> -n <namespace-where-ark-running>. It should start restoring the backup. You can check the restore status using `ark restore describe --from-backup <name of the backup that you want to restore, we got it in the previous step> -n <namespace-where-ark-running>`.
另外,我们可以查看集群内运行的 ark pod 的日志,它应该会显示正在恢复的东西。