odo storage
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.
#
Adding a storage volumeWe can add a storage volume to the cluster using odo storage create
.
For example:
In the above example, the first storage volume has been mounted to the /data
path and has a size of 1Gi
,
and the second volume has been mounted to /tmp
and is ephemeral.
#
Listing the storage volumesWe can check the storage volumes currently used by the component using odo storage list
.
For example:
#
Deleting a storage volumeWe can delete a storage volume using odo storage delete
.
For example:
In the above example, using -f
forcefully deletes the storage without asking user permission.
#
Adding storage to specific containerIf 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 - runtime
and funtime
. To attach a storage, only to the funtime
container, we can do
You can list the same, using odo storage list
command