1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-06 06:46:26 +01:00

Add more examples to storage documentation.

This commit is contained in:
Yana Hontyk
2020-09-14 16:32:04 +02:00
parent 9acc8a21a9
commit 30d78f97ed
2 changed files with 56 additions and 7 deletions

View File

@@ -5,15 +5,67 @@
[id="adding-storage-to-the-application-components_{context}"]
= Adding storage to the application components
Persistent storage keeps data available between restarts of {odo-title}. You can add storage to your components with the `odo storage` command.
Persistent storage keeps data available between restarts of {odo-title}.
Use the `odo storage` command to add persistent data to your application. Examples of data that must persist include database files, dependencies, and build artifacts, such as a `.m2` Maven directory.
.Procedure
* Add storage to your components:
. Add the storage to your component:
+
[source,terminal]
----
$ odo storage create nodestorage --path=/opt/app-root/src/storage/ --size=1Gi
$ odo storage create <storage_name> --path=<path_to_the_directory> --size=<size>
----
Your component now has 1 GB storage.
. Push the storage to the cluser:
+
[source,terminal]
----
$ odo push
----
. Verify that the storage is now attached to your component by listing all storage in the component:
+
[source,terminal]
----
$ odo storage list
----
+
.Example output
+
[source,terminal]
----
The component 'nodejs' has the following storage attached:
NAME SIZE PATH STATE
mystorage 1Gi /data Pushed
----
. Delete the storage from your component:
+
[source,terminal]
----
$ odo storage delete <storage_name>
----
. List all storage to verify that the storage state is `Locally Deleted`:
+
[source,terminal]
----
$ odo storage list
----
+
.Example output
+
[source,terminal]
----
The component 'nodejs' has the following storage attached:
NAME SIZE PATH STATE
mystorage 1Gi /data Locally Deleted
----
. Push the changes to the cluster:
+
[source,terminal]
----
$ odo push
----

View File

@@ -478,9 +478,6 @@ Perform storage operations.
# Delete storage mystorage from the currently active component
odo storage delete mystorage
# Delete storage mystorage from component 'mongodb'
odo storage delete mystorage --component mongodb
# List all storage attached or mounted to the current component and
# all unattached or unmounted storage in the current application
odo storage list