Mirrored address batch replacement scheme
For scenarios involving cross-cluster and cross-platform recovery, you can use this scheme to restore application images, allowing them to pull images normally after migration.
-
Image repository migration: When the image repository needs to be migrated to a new one, the application image address needs to be modified to the new image address.
-
Image synchronization: When the image needs to be synchronized to other projects in this repository, such as when the operations team upgrades the image from a test version to a formal version, the application image address needs to be modified to the new image version.
Procedure
-
Before performing the recovery task, create a ConfigMap file for mapping the old and new image repositories. Please refer to the following ConfigMap and replace the
<old image repository address>and<new image repository address>parameters, and save it aschange-registry-config.yamlfile.apiVersion: v1 kind: ConfigMap metadata: name: change-registry-config namespace: cpaas-system labels: velero.io/plugin-config: "" alauda.io/change-registry: RestoreItemAction data: old: <Old Image Repository Address> new: <New Image Repository Address> -
Execute the command on the Master node of the target cluster to create a ConfigMap.
kubectl apply -f change-registry-config.yaml -
After creation, you can continue with the application recovery task .