Skip to content

Commit 1bf5a4a

Browse files
authored
doc: add general ephemeral disk usage (kubernetes#2073)
1 parent 276ab03 commit 1bf5a4a

File tree

1 file changed

+41
-2
lines changed

1 file changed

+41
-2
lines changed

docs/cinder-csi-plugin/examples.md

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,11 @@ $ mount /dev/vdb /mnt; ls /mnt
101101
index.html lost+found
102102
```
103103

104-
## Deploy app using Inline volumes
104+
## Deploy app using ephemeral volumes
105105

106-
Sample App definition on using Inline volumes can be found at [here](../../examples/cinder-csi-plugin/ephemeral/csi-ephemeral-volumes-example.yaml)
106+
### CSI Ephemeral Volumes
107+
108+
Sample App definition on using CSI ephemeral volumes can be found at [here](../../examples/cinder-csi-plugin/ephemeral/csi-ephemeral-volumes-example.yaml)
107109

108110
Prerequisites:
109111
* Deploy CSI Driver, with both volumeLifecycleModes enabled as specified [here](../../manifests/cinder-csi-plugin/csi-cinder-driver.yaml)
@@ -130,6 +132,43 @@ Volumes:
130132
131133
```
132134

135+
### Generic Ephemeral Volumes
136+
137+
Sample App definition on using generic ephemeral volumes can be found at [here](../../examples/cinder-csi-plugin/ephemeral/generic-ephemeral-volumes.yaml)
138+
139+
Create a pod with ephemeral volume and storage class
140+
141+
```
142+
# kubectl create -f examples/cinder-csi-plugin/ephemeral/generic-ephemeral-volumes.yaml
143+
storageclass.storage.k8s.io/scratch-storage-class created
144+
pod/ephemeral-example created
145+
```
146+
147+
```
148+
# kubectl get pods -A
149+
NAMESPACE NAME READY STATUS RESTARTS AGE
150+
default ephemeral-example 1/1 Running 0 28s
151+
```
152+
153+
we can find pv/pvc/volumes created just like general volume.
154+
155+
```
156+
# kubectl get pvc
157+
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
158+
ephemeral-example-scratch-volume Bound pvc-9848ed86-8aa1-439b-9839-9ceba6e6f653 1Gi RWO scratch-storage-class 32s
159+
160+
# kubectl get pv
161+
NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
162+
pvc-9848ed86-8aa1-439b-9839-9ceba6e6f653 1Gi RWO Delete Bound default/ephemeral-example-scratch-volume scratch-storage-class 35s
163+
164+
# cinder list
165+
+--------------------------------------+-----------+------------------------------------------+------+-------------+----------+--------------------------------------+
166+
| ID | Status | Name | Size | Volume Type | Bootable | Attached to |
167+
+--------------------------------------+-----------+------------------------------------------+------+-------------+----------+--------------------------------------+
168+
| 7f4a09de-a8a9-4b89-9b70-d01028fcb789 | in-use | pvc-9848ed86-8aa1-439b-9839-9ceba6e6f653 | 1 | lvmdriver-1 | false | d438644c-864e-4b36-8a6e-794d35902f97 |
169+
+--------------------------------------+-----------+------------------------------------------+------+-------------+----------+--------------------------------------+
170+
```
171+
133172
## Volume Expansion Example
134173

135174
Sample App definition for volume resize could be found [here](../../examples/cinder-csi-plugin/resize/example.yaml)

0 commit comments

Comments
 (0)