You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tutorials/migrate-k8s-persistent-volumes-to-multi-az/index.mdx
+18-6Lines changed: 18 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ meta:
3
3
title: Migrating persistent volumes in a multi-zone Scaleway Kapsule cluster
4
4
description: This tutorial provides information about how to migrate existing Persistent Volumes in a Scaleway Kapsule multi-zone cluster to enhance availability and fault tolerance.
5
5
content:
6
-
h1: Migrating persistent volumes in a multi-zone Scaleway Kapsul cluster
6
+
h1: Migrating persistent volumes in a multi-zone Scaleway Kapsule cluster
7
7
paragraph: This tutorial provides information about how to migrate existing Persistent Volumes in a Scaleway Kapsule multi-zone cluster to enhance availability and fault tolerance.
@@ -29,7 +29,7 @@ This tutorial provides a generalized approach to migrating Persistent Volumes (P
29
29
30
30
<Messagetype="important">
31
31
**Backing up your data is crucial before making any changes.**
32
-
Ensure you have a backup strategy in place. You can use tools like Velero for Kubernetes backups or manually copy data to another storage solution. Always verify the integrity of your backups before proceeding.
32
+
Ensure you have a backup strategy in place. You can use tools like [Velero](/tutorials/k8s-velero-backup/) for Kubernetes backups or manually copy data to another storage solution. Always verify the integrity of your backups before proceeding.
33
33
</Message>
34
34
35
35
## Identify existing Persistent Volumes
@@ -50,6 +50,13 @@ This tutorial provides a generalized approach to migrating Persistent Volumes (P
50
50
scw instance volume list
51
51
```
52
52
53
+
3. To find the `VOLUME_ID` associated with a PV, correlate it with the output of the following command:
54
+
55
+
```sh
56
+
scw instance volume list
57
+
```
58
+
Match the PV's details with the corresponding volume in the Scaleway Instance list to identify the correct `VOLUME_ID`.
59
+
53
60
## Create snapshots of your existing Persistent Volumes
54
61
55
62
Use the Scaleway CLI to create snapshots of your volumes.
@@ -91,12 +98,17 @@ Repeat this for each zone required.
91
98
92
99
Modify your `PersistentVolumeClaims` to reference the newly created volumes.
93
100
94
-
1. Delete the existing PVC (PVCs are immutable and cannot be updated directly):
101
+
1. Before deleting the existing PVC, scale down your application to prevent data loss:
102
+
```sh
103
+
kubectl scale statefulset my-app --replicas=0
104
+
```
105
+
106
+
2. Delete the existing PVC (PVCs are immutable and cannot be updated directly):
95
107
```sh
96
108
kubectl delete pvc my-app-pvc
97
109
```
98
110
99
-
2. Create a new PVC with a multi-zone compatible `StorageClass`:
111
+
3. Create a new PVC with a multi-zone compatible `StorageClass`:
100
112
```yaml
101
113
apiVersion: v1
102
114
kind: PersistentVolumeClaim
@@ -111,15 +123,15 @@ Modify your `PersistentVolumeClaims` to reference the newly created volumes.
111
123
storage: 10Gi
112
124
```
113
125
114
-
3. Apply the updated PVCs:
126
+
4. Apply the updated PVCs:
115
127
```sh
116
128
kubectl apply -f my-app-pvc.yaml
117
129
```
118
130
119
131
## Reconfigure the StatefulSet to use multi-zone volumes
120
132
121
133
1. Edit the `StatefulSet` definition to use the newly created Persistent Volume Claims.
0 commit comments