From 2d7dde9564debaeeb3788e2d0436e0be917b4c18 Mon Sep 17 00:00:00 2001 From: Dragos Gheorghioiu Date: Fri, 26 Jun 2026 11:51:28 +0300 Subject: [PATCH] chore: Add more explicit volume attach usage Signed-off-by: Dragos Gheorghioiu --- pages/platform/volumes.mdx | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/pages/platform/volumes.mdx b/pages/platform/volumes.mdx index 258ffc7..f92c5f2 100644 --- a/pages/platform/volumes.mdx +++ b/pages/platform/volumes.mdx @@ -334,7 +334,7 @@ If you try to detach a volume while the instance is running, the platform will q The detach operation will trigger when the instance goes into `stopped`. ::: -Now start another instance and, like before, mount the same volume: +Now start another instance: @@ -342,7 +342,6 @@ Now start another instance and, like before, mount the same volume: unikraft run --metro fra \ -m 512M \ -p 443:8080/http+tls \ - -v my-volume:/mnt \ --image /httpserver-python312-flask30:latest ``` @@ -351,7 +350,6 @@ kraft cloud instance create \ --start \ -M 512Mi \ -p 443:8080 \ - --volume my-volume:/mnt \ /httpserver-python312-flask30:latest ``` @@ -375,10 +373,6 @@ This should output something like:  name: winter-field-v6m37jgs  domains:  - fqdn: winter-field-v6m37jgs.fra.unikraft.app -volumes: -- name: my-volume - uuid: 4d5576f7-315a-4eab-98b8-6c18fec076e0 - at: /mnt networks: - uuid: 935ba4ef-39c2-07e7-d2ae-8cd3c9aae07c  private-ip: 10.0.6.5 @@ -404,6 +398,24 @@ This should output something like: +Attach the volume to the new instance: + + + +```bash title="unikraft" +unikraft volumes attach my-volume \ + --to httpserver-python312-flask30-0s9c7 \ + --at /mnt +``` + +```bash title="kraft" +kraft cloud volume attach my-volume \ + --to httpserver-python312-flask30-0s9c7 \ + --at /mnt +``` + + + Run one final `curl` to this new address. You should see the previous contents plus a new entry at the bottom: @@ -426,12 +438,16 @@ To clean up, first detach the volume from all instances and then remove it: unikraft instances stop httpserver-python312-flask30-0s9c7 unikraft volumes detach my-volume --from httpserver-python312-flask30-0s9c7 unikraft volumes delete my-volume +unikraft instances delete httpserver-python312-flask30-0s9c7 +unikraft instances delete httpserver-python312-flask30-bxwxm ``` ```bash title="kraft" kraft cloud instance stop httpserver-python312-flask30-0s9c7 kraft cloud volume detach my-volume --from httpserver-python312-flask30-0s9c7 kraft cloud volume remove my-volume +kraft cloud instance remove httpserver-python312-flask30-bxwxm +kraft cloud instance remove httpserver-python312-flask30-0s9c7 ```