Skip to content

Commit 443af22

Browse files
Merge pull request #51344 from snarayan-redhat/BZ2078813
BZ#2078813: Added CLI steps for StorageClass creation
2 parents 5d9b376 + a184770 commit 443af22

5 files changed

+78
-58
lines changed

modules/persistent-storage-csi-dynamic-provisioning-aws-efs.adoc

Lines changed: 4 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
[id="csi-dynamic-provisioning-aws-efs_{context}"]
77
= Dynamic provisioning for AWS EFS
88

9+
[role="_abstract"]
910
The AWS EFS CSI Driver supports a different form of dynamic provisioning than other CSI drivers. It provisions new PVs as subdirectories of a pre-existing EFS volume. The PVs are independent of each other. However, they all share the same EFS volume. When the volume is deleted, all PVs provisioned out of it are deleted too.
1011
The EFS CSI driver creates an AWS Access Point for each such subdirectory. Due to AWS AccessPoint limits, you can only dynamically provision 120 PVs from a single `StorageClass`/EFS volume.
1112

@@ -20,41 +21,14 @@ Using monitoring of EFS volume sizes in AWS is strongly recommended.
2021

2122
.Prerequisites
2223

23-
* xref:../../storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc#efs-create-volume_persistent-storage-csi-aws-efs[Created AWS EFS volume(s).]
24+
* You have created AWS EFS volumes.
25+
* You have created the AWS EFS storage class.
2426
2527
.Procedure
2628

2729
To enable dynamic provisioning:
2830

29-
. Create a `StorageClass` as follows:
30-
+
31-
[source,yaml]
32-
----
33-
kind: StorageClass
34-
apiVersion: storage.k8s.io/v1
35-
metadata:
36-
name: efs-sc
37-
provisioner: efs.csi.aws.com
38-
parameters:
39-
provisioningMode: efs-ap <1>
40-
fileSystemId: fs-a5324911 <2>
41-
directoryPerms: "700" <3>
42-
gidRangeStart: "1000" <4>
43-
gidRangeEnd: "2000" <4>
44-
basePath: "/dynamic_provisioning" <5>
45-
----
46-
<1> `provisioningMode` must be `efs-ap` to enable dynamic provisioning.
47-
<2> `fileSystemId` must be the ID of the EFS volume created manually above.
48-
<3> `directoryPerms` is the default permission of the root directory of the volume. In this case, the volume is accessible only by the owner.
49-
<4> `gidRangeStart` and `gidRangeEnd` set the range of POSIX Group IDs (GIDs) that are used to set the GID of the AWS access point. If not specified, the default range is 50000-7000000. Each provisioned volume, and thus AWS access point, is assigned a unique GID from this range.
50-
<5> `basePath` is the directory on the EFS volume that is used to create dynamically provisioned volumes. In this case, a PV is provisioned as “/dynamic_provisioning/<random uuid>” on the EFS volume. Only the subdirectory is mounted to pods that use the PV.
51-
+
52-
[NOTE]
53-
====
54-
A cluster admin can create several `StorageClasses`, each using a different EFS volume.
55-
====
56-
+
57-
. Create a PVC (or StatefulSet or Template) as usual, referring to the `StorageClass` created above.
31+
* Create a PVC (or StatefulSet or Template) as usual, referring to the `StorageClass` created above.
5832
+
5933
[source,yaml]
6034
----
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
:_content-type: PROCEDURE
2+
[id="storage-create-storage-class-cli_{context}"]
3+
= Creating the {StorageClass} storage class using the CLI
4+
5+
[role="_abstract"]
6+
.Procedure
7+
8+
* Create a `StorageClass` object:
9+
+
10+
[source,yaml]
11+
----
12+
kind: StorageClass
13+
apiVersion: storage.k8s.io/v1
14+
metadata:
15+
name: efs-sc
16+
provisioner: efs.csi.aws.com
17+
parameters:
18+
provisioningMode: efs-ap <1>
19+
fileSystemId: fs-a5324911 <2>
20+
directoryPerms: "700" <3>
21+
gidRangeStart: "1000" <4>
22+
gidRangeEnd: "2000" <4>
23+
basePath: "/dynamic_provisioning" <5>
24+
----
25+
<1> `provisioningMode` must be `efs-ap` to enable dynamic provisioning.
26+
<2> `fileSystemId` must be the ID of the EFS volume created manually.
27+
<3> `directoryPerms` is the default permission of the root directory of the volume. In this example, the volume is accessible only by the owner.
28+
<4> `gidRangeStart` and `gidRangeEnd` set the range of POSIX Group IDs (GIDs) that are used to set the GID of the AWS access point. If not specified, the default range is 50000-7000000. Each provisioned volume, and thus AWS access point, is assigned a unique GID from this range.
29+
<5> `basePath` is the directory on the EFS volume that is used to create dynamically provisioned volumes. In this case, a PV is provisioned as “/dynamic_provisioning/<random uuid>” on the EFS volume. Only the subdirectory is mounted to pods that use the PV.
30+
+
31+
[NOTE]
32+
====
33+
A cluster admin can create several `StorageClass` objects, each using a different EFS volume.
34+
====
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
:_content-type: PROCEDURE
2+
[id="storage-create-storage-class-console_{context}"]
3+
= Creating the {StorageClass} storage class using the console
4+
5+
[role="_abstract"]
6+
.Procedure
7+
8+
. In the {product-title} console, click *Storage* -> *StorageClasses*.
9+
10+
. On the *StorageClasses* page, click *Create StorageClass*.
11+
12+
. On the *StorageClass* page, perform the following steps:
13+
14+
.. Enter a name to reference the storage class.
15+
16+
.. Optional: Enter the description.
17+
18+
.. Select the reclaim policy.
19+
20+
.. Select *`{Provisioner}`* from the *Provisioner* drop-down list.
21+
+
22+
ifeval::["{Provisioner}" == "kubernetes.io/aws-ebs"]
23+
[NOTE]
24+
====
25+
To create the storage class with the equivalent CSI driver, select `{CsiDriver}` from the drop-down list. For more details, see _AWS Elastic Block Store CSI Driver Operator_.
26+
====
27+
endif::[]
28+
29+
.. Optional: Set the configuration parameters for the selected provisioner.
30+
31+
. Click *Create*.

modules/storage-create-storage-class.adoc

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -17,35 +17,8 @@ usages. By defining a storage class, users can obtain dynamically provisioned
1717
persistent volumes.
1818

1919
ifeval::["{Provisioner}" == "efs.csi.aws.com"]
20-
The _AWS EFS CSI Driver Operator_, after being installed, does not create a storage class by default. However, you can manually create the AWS EFS `StorageClass`.
20+
The _AWS EFS CSI Driver Operator_, after being installed, does not create a storage class by default. However, you can manually create the AWS EFS storage class.
2121
endif::[]
2222

23-
.Procedure
2423

25-
. In the {product-title} console, click *Storage* -> *Storage Classes*.
2624

27-
. On the *StorageClasses* overview page, click *Create Storage Class*.
28-
29-
. On the *StorageClasses* create page, enter values as desired:
30-
31-
.. Enter a name to reference the storage class.
32-
33-
.. Enter an optional description.
34-
35-
.. Select the reclaim policy.
36-
37-
.. Select *`{Provisioner}`* from the *Provisioner* drop-down list.
38-
+
39-
ifeval::["{Provisioner}" == "kubernetes.io/aws-ebs"]
40-
[NOTE]
41-
====
42-
To create the storage class with the equivalent CSI driver, select `{CsiDriver}` from the drop-down list. For more details, see _AWS Elastic Block Store CSI Driver Operator_.
43-
====
44-
endif::[]
45-
46-
.. Enter additional parameters for the storage class as desired.
47-
48-
. Click *Create*.
49-
50-
// Undefine {StorageClass} attribute, so that any mistakes are easily spotted
51-
:!StorageClass:

storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,19 @@ include::modules/persistent-storage-csi-efs-sts.adoc[leveloffset=+1]
4141
:StorageClass: AWS EFS
4242
:Provisioner: efs.csi.aws.com
4343
include::modules/storage-create-storage-class.adoc[leveloffset=+1]
44+
include::modules/storage-create-storage-class-console.adoc[leveloffset=+2]
45+
include::modules/storage-create-storage-class-cli.adoc[leveloffset=+2]
4446

4547
include::modules/persistent-storage-csi-efs-create-volume.adoc[leveloffset=+1]
4648

4749
include::modules/persistent-storage-csi-dynamic-provisioning-aws-efs.adoc[leveloffset=+1]
4850
If you have problems setting up dynamic provisioning, see xref:../../storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc#efs-troubleshooting_persistent-storage-csi-aws-efs[AWS EFS troubleshooting].
51+
[role="_additional-resources"]
52+
.Additional resources
53+
* xref:../../storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc#efs-create-volume_persistent-storage-csi-aws-efs[Creating and configuring access to AWS EFS volume(s)]
54+
* xref:../../storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc#storage-create-storage-class_persistent-storage-csi-aws-efs[Creating the AWS EFS storage class]
55+
// Undefine {StorageClass} attribute, so that any mistakes are easily spotted
56+
:!StorageClass:
4957

5058
include::modules/persistent-storage-csi-efs-static-pv.adoc[leveloffset=+1]
5159
If you have problems setting up static PVs, see xref:../../storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc#efs-troubleshooting_persistent-storage-csi-aws-efs[AWS EFS troubleshooting].

0 commit comments

Comments
 (0)