Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion modules/storage-ephemeral-vols-lifecycle.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
[id="generic-ephemeral-vols-lifecycle_{context}"]
= Lifecycle and persistent volume claims

The parameters for a volume claim are allowed inside a volume source of a pod. Labels, annotations, and the whole set of fields for persistent volume claims (PVCs) are supported. When such a pod is created, the ephemeral volume controller then creates an actual PVC object (from the template shown in the _Creating generic ephemeral volumes_ procedure) in the same namespace as the pod, and ensures that the PVC is deleted when the pod is deleted. This triggers volume binding and provisioning in one of two ways:
[role="_abstract"]
The parameters for a volume claim are allowed inside a volume source of a pod. Labels, annotations, and the whole set of fields for persistent volume claims (PVCs) are supported. When such a pod is created, the ephemeral volume controller then creates an actual PVC object (from the template shown in the _Creating generic ephemeral volumes_ procedure) in the same namespace as the pod, and ensures that the PVC is deleted when the pod is deleted.

This triggers volume binding and provisioning in one of two ways:

* Either immediately, if the storage class uses immediate volume binding.
+
Expand Down
3 changes: 1 addition & 2 deletions modules/storage-ephemeral-vols-overview.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
[id="generic-ephemeral-vols-overview_{context}"]
= Overview

Generic ephemeral volumes are a type of ephemeral volume that can be provided by all storage drivers that support persistent volumes and dynamic provisioning. Generic ephemeral volumes are similar to `emptyDir` volumes in that they provide a per-pod directory for scratch data, which is usually empty after provisioning.

[role="_abstract"]
Generic ephemeral volumes are specified inline in the pod spec and follow the pod's lifecycle. They are created and deleted along with the pod.

Generic ephemeral volumes have the following features:
Expand Down
9 changes: 6 additions & 3 deletions modules/storage-ephemeral-vols-procedure.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
// * storage/generic-ephemeral-vols.adoc
//* microshift_storage/generic-ephemeral-volumes-microshift.adoc


:_mod-docs-content-type: PROCEDURE
[id="generic-ephemeral-vols-procedure_{context}"]
= Creating generic ephemeral volumes

[role="_abstract"]
You can create generic ephemeral volumes as needed.

.Procedure

. Create the `pod` object definition and save it to a file.
Expand All @@ -30,7 +32,7 @@ spec:
name: data
command: [ "sleep", "1000000" ]
volumes:
- name: data <1>
- name: data
ephemeral:
volumeClaimTemplate:
metadata:
Expand All @@ -49,4 +51,5 @@ endif::microshift[]
storage: 1Gi

----
<1> Generic ephemeral volume claim.
+
* `spec.volumes.name`: Name of the generic ephemeral volume claim.
1 change: 1 addition & 0 deletions modules/storage-ephemeral-vols-pvc-naming.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[id="generic-ephemeral-vols-pvc-naming_{context}"]
= Persistent volume claim naming

[role="_abstract"]
Automatically created persistent volume claims (PVCs) are named by a combination of the pod name and the volume name, with a hyphen (-) in the middle. This naming convention also introduces a potential conflict between different pods, and between pods and manually created PVCs.

For example, `pod-a` with volume `scratch` and `pod` with volume `a-scratch` both end up with the same PVC name, `pod-a-scratch`.
Expand Down
1 change: 1 addition & 0 deletions modules/storage-ephemeral-vols-security.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
[id="generic-ephemeral-security_{context}"]
= Security

[role="_abstract"]
You can enable the generic ephemeral volume feature to allows users who can create pods to also create persistent volume claims (PVCs) indirectly. This feature works even if these users do not have permission to create PVCs directly. Cluster administrators must be aware of this. If this does not fit your security model, use an admission webhook that rejects objects such as pods that have a generic ephemeral volume.

The normal namespace quota for PVCs still applies, so even if users are allowed to use this new mechanism, they cannot use it to circumvent other policies.
6 changes: 5 additions & 1 deletion storage/generic-ephemeral-vols.adoc
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
:_mod-docs-content-type: ASSEMBLY
[id="generic-ephemeral-volumes"]
= Generic ephemeral volumes

include::_attributes/common-attributes.adoc[]
:context: generic-ephemeral-volumes
= Generic ephemeral volumes

[role="_abstract"]
Generic ephemeral volumes are a type of ephemeral volume that can be provided by all storage drivers that support persistent volumes and dynamic provisioning. Generic ephemeral volumes are similar to `emptyDir` volumes in that they provide a per-pod directory for scratch data, which is usually empty after provisioning.

toc::[]

Expand Down