zadig社区分享:https://community.koderover.com/t/topic/672
安装velero参考这里:安装velero实现集群迁移
从旧集群导出需要的crd资源清单yaml文件
Code Block |
---|
kubectl get crd routetables.gateway.solo.io -oyaml >routetables.gateway.solo.io.yaml kubectl get crd upstreamgroups.gloo.solo.io -oyaml >upstreamgroups.gloo.solo.io.yaml kubectl get crd authconfigs.enterprise.gloo.solo.io -oyaml >authconfigs.enterprise.gloo.solo.io.yaml kubectl get crd ratelimitconfigs.ratelimit.solo.io -oyaml >ratelimitconfigs.ratelimit.solo.io.yaml kubectl get crd virtualhostoptions.gateway.solo.io -oyaml >virtualhostoptions.gateway.solo.io.yaml kubectl get crd routeoptions.gateway.solo.io -oyaml >routeoptions.gateway.solo.io.yaml |
旧的集群上执行备份
Code Block |
---|
miniopodname=`kubectl -n zadig get pod -l app=minio|grep -v NAME|awk '{print $1}'` kubectl -n zadig annotate pod/$miniopodname backup.velero.io/backup-volumes=kr-minio --overwrite kubectl -n zadig annotate pod/kr-mysql-0 backup.velero.io/backup-volumes=data-kr-mysql-0 --overwrite kubectl -n zadig annotate pod/kr-mongodb-0 backup.velero.io/backup-volumes=data-kr-mongodb-0 --overwrite velero backup create zadig-20230717 --include-namespaces zadig |
可以看到备份进度
新的集群上(如果存储类发生变化需要创建以下文件,因为我是从nfs-storage迁移到cephfs-sc
)
创建crd资源文件,就是我们第一步导出的yaml
kubectl create -f routetables.gateway.solo.io.yaml
......
Code Block |
---|
vi change-storage-class-config.yaml apiVersion: v1 kind: ConfigMap metadata: name: change-storage-class-config namespace: velero labels: velero.io/plugin-config: "" velero.io/change-storage-class: RestoreItemAction data: nfs-storage: cephfs-sc |
kubectl create -f change-storage-class-config.yaml
velero restore create --from-backup zadig-20230717
迁移到此结束
PS:如果在安装的时候选择的是IP:Port形式安装的想要用ingress代理的可以修改如下两个confimap
aslan-config和warpdrive-config,修改ADDRESS和REDIRECT_URI的值后重启aslan和warpdrive两个deployment即可生效
ingress指向gateway-proxy这个service的80端口就行