华为云UCS-应用迁移:k8clone恢复使用方法

时间:2024-05-08 17:06:47

k8clone恢复使用方法

k8clone工具支持在Linux(x86、arm)和Windows环境中运行,使用方法相似。本文将以Linux(x86)环境为例进行介绍。

若使用Linux(arm)或Windows环境,请将下述命令中的k8clone-linux-amd64分别替换为k8clone-linux-arm64k8clone-windows-amd64.exe

在k8clone工具所在目录下执行./k8clone-linux-amd64 restore -h,可以查看k8clone工具恢复的使用方法。

  • -k, --kubeconfig:指定kubectl的KubeConfig位置,默认是$HOME/.kube/config。kubeConfig文件:用于配置对Kubernetes集群的访问,KubeConfig文件中包含访问注册Kubernetes集群所需要的认证凭据以及Endpoint(访问地址),详细介绍可参见Kubernetes文档
  • -s, --api-server:Kubernetes API Server URL,默认是""。
  • -q, --context:Kubernetes Configuration Context,默认是""。
  • -f, --restore-conf:指定restore.json的路径,默认是k8clone工具所在目录下。
  • -d, --local-dir:备份数据放置的路径,默认是k8clone工具所在目录下。
$ ./k8clone-linux-amd64 restore -h
ProcessRestore from backup

Usage:
     k8clone restore [flags]

Flags:
   -s, --api-server string     Kubernetes api-server url
   -q, --context string        Kubernetes configuration context
   -h, --help                  help for restore
   -k, --kubeconfig string     The kubeconfig of k8s cluster's. Default is the $HOME/.kube/config. 
   -d, --local-dir string      Where to restore (default "./k8clone-dump.zip")
   -f, --restore-conf string   restore conf file (default "./restore.json")

示例:

./k8clone-linux-amd64 restore -d ./k8clone-dump.zip -f ./restore.json

support.huaweicloud.com/usermanual-ucs/ucs_01_0192.html