odo lets users manage storage volumes attached to the components. A storage volume can be either an ephemeral volume using an
emptyDir Kubernetes volume, or a PVC, which is a way for users to "claim" a persistent volume (such as a GCE PersistentDisk or an iSCSI volume) without understanding the details of the particular cloud environment. The persistent storage volume can be used to persist data across restarts and rebuilds of the component.
We can add a storage volume to the cluster using
odo storage create.
In the above example, the first storage volume has been mounted to the
/data path and has a size of
and the second volume has been mounted to
/tmp and is ephemeral.
We can check the storage volumes currently used by the component using
odo storage list.
We can delete a storage volume using
odo storage delete.
In the above example, using
-f forcefully deletes the storage without asking user permission.
If your devfile has multiple containers, you can specify to which container you want the
storage to attach to using the
--container flag in the
odo storage create command.
Following is an excerpt from an example devfile with multiple containers :
Here, we have two containers -
funtime. To attach a storage, only to the
funtime container, we can do
You can list the same, using
odo storage list command