Skip to content

Commit 98955dd

Browse files
committed
Add a note about copying PV/PVC from source to destination cluster
1 parent a56c395 commit 98955dd

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

content/en/blog/_posts/2022-12-16-statefulset-migration.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -143,15 +143,14 @@ The following commands copy resources from `source` to `destionation`. Details
143143
that are not relevant in `destination` cluster are removed (eg: `uid`,
144144
`resourceVersion`, `status`).
145145

146-
Note: For the PV/PVC, this procedure only works if the underlying storage system
147-
that your `StorageClass` uses can support copying existing PVs into a
148-
new cluster. Storage that is associated with a specific node or topology
149-
may not be supported. Additionally, some storage systems may store
150-
addtional metadata about volumes outside of a PV object, and may require
151-
a more specialized sequence to import a volume.
152-
153146
Source Cluster
154147

148+
Note: If using a `StorageClass` with `reclaimPolicy: Delete` configured, you
149+
should patch the PVs in `source` with `reclaimPolicy: Retain` prior to
150+
deletion. See
151+
[Change the Reclaim Policy of a PersistentVolume](/docs/tasks/administer-cluster/change-pv-reclaim-policy/)
152+
for more details.
153+
155154
```
156155
kubectl get pvc redis-data-redis-redis-cluster-5 -o yaml | yq 'del(.metadata.uid, .metadata.resourceVersion, .metadata.annotations, .metadata.finalizers, .status)' > /tmp/pvc-redis-data-redis-redis-cluster-5.yaml
157156
kubectl get pv $(yq '.spec.volumeName' /tmp/pvc-redis-data-redis-redis-cluster-5.yaml) -o yaml | yq 'del(.metadata.uid, .metadata.resourceVersion, .metadata.annotations, .metadata.finalizers, .spec.claimRef, .status)' > /tmp/pv-redis-data-redis-redis-cluster-5.yaml
@@ -160,6 +159,13 @@ kubectl get secret redis-redis-cluster -o yaml | yq 'del(.metadata.uid, .metadat
160159

161160
Destination Cluster
162161

162+
Note: For the PV/PVC, this procedure only works if the underlying storage system
163+
that your PVs use can support being copied into `destination`. Storage
164+
that is associated with a specific node or topology may not be supported.
165+
Additionally, some storage systems may store addtional metadata about
166+
volumes outside of a PV object, and may require a more specialized
167+
sequence to import a volume.
168+
163169
```
164170
kubectl create -f /tmp/pv-redis-data-redis-redis-cluster-5.yaml
165171
kubectl create -f /tmp/pvc-redis-data-redis-redis-cluster-5.yaml

0 commit comments

Comments
 (0)