更新时间:2023-03-28 GMT+08:00
分享

在CCE集群恢复Kubernetes对象

创建StorageClass

本示例WordPress应用使用阿里云SSD类型持久化数据卷,相应的在CCE中需要适配成华为云SSD。

本示例中使用的StorageClass是alicloud-disk-ssd,需要创建一个同名的SC,但后端存储介质使用华为云SSD存储。此处请根据自己的应用来适配。

[root@ccenode-roprr hujun]# cat cce-sc-csidisk-ack.yaml  
allowVolumeExpansion: true 
apiVersion: storage.k8s.io/v1 
kind: StorageClass 
metadata: 
  name: alicloud-disk-ssd 
  selfLink: /apis/storage.k8s.io/v1/storageclasses/csi-disk 
parameters: 
  csi.storage.k8s.io/csi-driver-name: disk.csi.everest.io 
  csi.storage.k8s.io/fstype: ext4 
  everest.io/disk-volume-type: SSD 
  everest.io/passthrough: "true" 
provisioner: everest-csi-provisioner 
reclaimPolicy: Delete 
volumeBindingMode: Immediate  

[root@ccenode-roprr hujun]# kubectl create -f cce-sc-csidisk-ack.yaml

恢复应用

[root@ccenode-roprr hujun]# velero restore create --from-backup   wordpress-ack-backup 
Restore request "wordpress-ack-backup-20200707212519" submitted successfully. 
Run `velero restore describe wordpress-ack-backup-20200707212519` or `velero restore logs wordpress-ack-backup-20200707212519` for more details  

[root@ccenode-roprr hujun]# velero restore get 
NAME  BACKUP STATUS  WARNINGS   ERRORS   CREATED SELECTOR 
wordpress-ack-backup-20200708112940   wordpress-ack-backup   Completed   0  02020-07-08 11:29:42 +0800 CST   <none>

此时查看wordpress应用运行情况,可能会有镜像拉取失败,服务访问不通等问题,需要进行适配处理。

相关文档