mirror of
https://github.com/openshift/openshift-docs.git
synced 2026-02-05 12:46:18 +01:00
71 lines
1.6 KiB
Plaintext
71 lines
1.6 KiB
Plaintext
// Module included in the following assemblies:
|
|
//
|
|
//creating_and_deploying_applications_with_odo/working-with-storage.adoc
|
|
|
|
:_mod-docs-content-type: PROCEDURE
|
|
[id="adding-storage-to-a-specific-container_{context}"]
|
|
= Adding storage to a specific container
|
|
|
|
If your devfile has multiple containers, you can use the `--container` flag to specify the container you want to attach storage to.
|
|
|
|
.Procedure
|
|
|
|
. Create a devfile with multiple containers:
|
|
+
|
|
[source,yaml]
|
|
----
|
|
components:
|
|
- name: runtime <1>
|
|
container:
|
|
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
|
|
memoryLimit: 1024Mi
|
|
endpoints:
|
|
- name: "3000-tcp"
|
|
targetPort: 3000
|
|
mountSources: true
|
|
- name: funtime <2>
|
|
container:
|
|
image: registry.access.redhat.com/ubi8/nodejs-12:1-36
|
|
memoryLimit: 1024Mi
|
|
----
|
|
<1> The `runtime` container.
|
|
<2> The `funtime` container.
|
|
|
|
. To create storage for the `runtime` container:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ odo storage create store --path /data --size 1Gi --container runtime
|
|
----
|
|
+
|
|
.Output of the command
|
|
+
|
|
[source,terminal]
|
|
----
|
|
✓ Added storage store to nodejs-testing-xnfg
|
|
Please use `odo push` command to make the storage accessible to the component
|
|
----
|
|
|
|
. 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-testing-xnfg' has the following storage attached:
|
|
NAME SIZE PATH CONTAINER STATE
|
|
store 1Gi /data runtime Not Pushed
|
|
----
|
|
|
|
. Push the changes to the cluster:
|
|
+
|
|
[source,terminal]
|
|
----
|
|
$ odo push
|
|
----
|