Rename a volume¶
syslet always names the podman volume after its spec, so a renamed spec points at a new, empty volume. To keep the data, create the new volume next to the old one, copy the data over, and switch the container. The container is down while the data is copied.
The steps rename webapp-data, mounted by the container webapp, to webapp-files.
Add the new volume¶
Add a spec for webapp-files, with the markers you want (see Manage volumes), and apply.
Nothing references it yet, so create the podman volume through its service:
| Bash | |
|---|---|
Copy the data¶
Stop the container, so nothing writes while you copy, and copy the volume's content:
| Bash | |
|---|---|
Don't let a deployment run until step 3, since any apply starts the container again on the old volume.
Switch the container¶
Point the container's Volume= at the new volume:
Preview and apply; syslet starts the container on the new volume. Check the data is there before you go on.
Remove the old volume¶
Remove the webapp-data spec as in Manage volumes.
With reclaimPolicy: "Retain", the old podman volume stays as a backup until you delete it with podman volume rm webapp-data.