data-migate ns fix

This commit is contained in:
azykov@mail.ru
2026-07-20 21:23:28 +03:00
parent 1b426cc7e9
commit 5dac6a4913
2 changed files with 7 additions and 6 deletions
+6 -5
View File
@@ -1,11 +1,12 @@
0. the namespace will be the namespace for your target application
1. run the application you need 1. run the application you need
2. wait for its PVs to be created 2. wait for its PVs to be created
3. suspend the application: `kubectl scale deployment/statefulset/... NAME -n NAMESPACE --replicas=0` 3. suspend the application: `kubectl scale deployment/statefulset/... NAME -n NAMESPACE --replicas=0`
4. wait for it to scale down so that the ReadWriteOnce PVs are released (or data-migrate will not be able to mount them) 4. wait for it to scale down so that the ReadWriteOnce PVs are released (or data-migrate will not be able to mount them)
5. look up the destination PVC name you need: `kubectl get pvc NAME -n NAMESPACE` 5. look up the destination PVC name you need: `kubectl get pvc NAME -n NAMESPACE`
6. put the source host(node) and dir and destination PVC name to `install.yaml` 6. put the namespace, source host(node) and dir and destination PVC name to `install.yaml`
7. install the data-migrate: `kubectl create namespace data-migrate && kubectl delete pod data-migrate -n data-migrate --ignore-not-found=true && kubectl apply -f install.yaml` 7. install the data-migrate: `kubectl delete pod data-migrate -n NAMESPACE --ignore-not-found=true && kubectl apply -f install.yaml`
8. run the migration: `kubectl exec data-migrate -n data-migrate -- cp -a /old/. /new/` or anything you need instead of `cp` 8. run the migration: `kubectl exec data-migrate -n NAMESPACE -- cp -a /old/. /new/` or anything you need instead of `cp` or interactive shell `kubectl exec -it data-migrate -n NAMESPACE -- sh` (or `bash` or `zsh`)
9. validate you have everything migrated: `kubectl exec data-migrate -n data-migrate -- ls -laR /new` 9. validate you have everything migrated: `kubectl exec data-migrate -n NAMESPACE -- ls -laR /new`
10. uninstall the data-migrate: `kubectl delete pod data-migrate -n data-migrate` 10. uninstall the data-migrate: `kubectl delete pod data-migrate -n NAMESPACE`
11. resume the application back: `kubectl scale deployment/statefulset/... NAME -n NAMESPACE --replicas=1` 11. resume the application back: `kubectl scale deployment/statefulset/... NAME -n NAMESPACE --replicas=1`
+1 -1
View File
@@ -2,7 +2,7 @@ apiVersion: v1
kind: Pod kind: Pod
metadata: metadata:
name: data-migrate name: data-migrate
namespace: data-migrate namespace: <NAMESPACE_YOU_WANT_TO_MIGRATE_TO>
spec: spec:
restartPolicy: Never restartPolicy: Never
containers: containers: