From dad271df0aaecd7e7daf320473659082e3b8bd8c Mon Sep 17 00:00:00 2001 From: Darshan Nagaraj Date: Wed, 7 Sep 2022 19:51:21 +0530 Subject: [PATCH] BZ2078813: Added CLI steps for StorageClass creation --- ...rage-csi-dynamic-provisioning-aws-efs.adoc | 34 +++---------------- modules/storage-create-storage-class-cli.adoc | 34 +++++++++++++++++++ .../storage-create-storage-class-console.adoc | 31 +++++++++++++++++ modules/storage-create-storage-class.adoc | 29 +--------------- .../persistent-storage-csi-aws-efs.adoc | 8 +++++ 5 files changed, 78 insertions(+), 58 deletions(-) create mode 100644 modules/storage-create-storage-class-cli.adoc create mode 100644 modules/storage-create-storage-class-console.adoc diff --git a/modules/persistent-storage-csi-dynamic-provisioning-aws-efs.adoc b/modules/persistent-storage-csi-dynamic-provisioning-aws-efs.adoc index 1e26d5af9c..775260a9be 100644 --- a/modules/persistent-storage-csi-dynamic-provisioning-aws-efs.adoc +++ b/modules/persistent-storage-csi-dynamic-provisioning-aws-efs.adoc @@ -6,6 +6,7 @@ [id="csi-dynamic-provisioning-aws-efs_{context}"] = Dynamic provisioning for AWS EFS +[role="_abstract"] 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. 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. @@ -20,41 +21,14 @@ Using monitoring of EFS volume sizes in AWS is strongly recommended. .Prerequisites -* xref:../../storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc#efs-create-volume_persistent-storage-csi-aws-efs[Created AWS EFS volume(s).] +* You have created AWS EFS volumes. +* You have created the AWS EFS storage class. .Procedure To enable dynamic provisioning: -. Create a `StorageClass` as follows: -+ -[source,yaml] ----- -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: efs-sc -provisioner: efs.csi.aws.com -parameters: - provisioningMode: efs-ap <1> - fileSystemId: fs-a5324911 <2> - directoryPerms: "700" <3> - gidRangeStart: "1000" <4> - gidRangeEnd: "2000" <4> - basePath: "/dynamic_provisioning" <5> ----- -<1> `provisioningMode` must be `efs-ap` to enable dynamic provisioning. -<2> `fileSystemId` must be the ID of the EFS volume created manually above. -<3> `directoryPerms` is the default permission of the root directory of the volume. In this case, the volume is accessible only by the owner. -<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. -<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/” on the EFS volume. Only the subdirectory is mounted to pods that use the PV. -+ -[NOTE] -==== -A cluster admin can create several `StorageClasses`, each using a different EFS volume. -==== -+ -. Create a PVC (or StatefulSet or Template) as usual, referring to the `StorageClass` created above. +* Create a PVC (or StatefulSet or Template) as usual, referring to the `StorageClass` created above. + [source,yaml] ---- diff --git a/modules/storage-create-storage-class-cli.adoc b/modules/storage-create-storage-class-cli.adoc new file mode 100644 index 0000000000..19eb8262fd --- /dev/null +++ b/modules/storage-create-storage-class-cli.adoc @@ -0,0 +1,34 @@ +:_content-type: PROCEDURE +[id="storage-create-storage-class-cli_{context}"] += Creating the {StorageClass} storage class using the CLI + +[role="_abstract"] +.Procedure + +* Create a `StorageClass` object: ++ +[source,yaml] +---- +kind: StorageClass +apiVersion: storage.k8s.io/v1 +metadata: + name: efs-sc +provisioner: efs.csi.aws.com +parameters: + provisioningMode: efs-ap <1> + fileSystemId: fs-a5324911 <2> + directoryPerms: "700" <3> + gidRangeStart: "1000" <4> + gidRangeEnd: "2000" <4> + basePath: "/dynamic_provisioning" <5> +---- +<1> `provisioningMode` must be `efs-ap` to enable dynamic provisioning. +<2> `fileSystemId` must be the ID of the EFS volume created manually. +<3> `directoryPerms` is the default permission of the root directory of the volume. In this example, the volume is accessible only by the owner. +<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. +<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/” on the EFS volume. Only the subdirectory is mounted to pods that use the PV. ++ +[NOTE] +==== +A cluster admin can create several `StorageClass` objects, each using a different EFS volume. +==== \ No newline at end of file diff --git a/modules/storage-create-storage-class-console.adoc b/modules/storage-create-storage-class-console.adoc new file mode 100644 index 0000000000..7fe8848a6c --- /dev/null +++ b/modules/storage-create-storage-class-console.adoc @@ -0,0 +1,31 @@ +:_content-type: PROCEDURE +[id="storage-create-storage-class-console_{context}"] += Creating the {StorageClass} storage class using the console + +[role="_abstract"] +.Procedure + +. In the {product-title} console, click *Storage* -> *StorageClasses*. + +. On the *StorageClasses* page, click *Create StorageClass*. + +. On the *StorageClass* page, perform the following steps: + +.. Enter a name to reference the storage class. + +.. Optional: Enter the description. + +.. Select the reclaim policy. + +.. Select *`{Provisioner}`* from the *Provisioner* drop-down list. ++ +ifeval::["{Provisioner}" == "kubernetes.io/aws-ebs"] +[NOTE] +==== +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_. +==== +endif::[] + +.. Optional: Set the configuration parameters for the selected provisioner. + +. Click *Create*. \ No newline at end of file diff --git a/modules/storage-create-storage-class.adoc b/modules/storage-create-storage-class.adoc index 9d4d86f8c1..2f7ac56042 100644 --- a/modules/storage-create-storage-class.adoc +++ b/modules/storage-create-storage-class.adoc @@ -17,35 +17,8 @@ usages. By defining a storage class, users can obtain dynamically provisioned persistent volumes. ifeval::["{Provisioner}" == "efs.csi.aws.com"] -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`. +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. endif::[] -.Procedure -. In the {product-title} console, click *Storage* -> *Storage Classes*. -. On the *StorageClasses* overview page, click *Create Storage Class*. - -. On the *StorageClasses* create page, enter values as desired: - -.. Enter a name to reference the storage class. - -.. Enter an optional description. - -.. Select the reclaim policy. - -.. Select *`{Provisioner}`* from the *Provisioner* drop-down list. -+ -ifeval::["{Provisioner}" == "kubernetes.io/aws-ebs"] -[NOTE] -==== -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_. -==== -endif::[] - -.. Enter additional parameters for the storage class as desired. - -. Click *Create*. - -// Undefine {StorageClass} attribute, so that any mistakes are easily spotted -:!StorageClass: diff --git a/storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc b/storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc index f2532771ca..cf8a7d3a3a 100644 --- a/storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc +++ b/storage/container_storage_interface/persistent-storage-csi-aws-efs.adoc @@ -41,11 +41,19 @@ include::modules/persistent-storage-csi-efs-sts.adoc[leveloffset=+1] :StorageClass: AWS EFS :Provisioner: efs.csi.aws.com include::modules/storage-create-storage-class.adoc[leveloffset=+1] +include::modules/storage-create-storage-class-console.adoc[leveloffset=+2] +include::modules/storage-create-storage-class-cli.adoc[leveloffset=+2] include::modules/persistent-storage-csi-efs-create-volume.adoc[leveloffset=+1] include::modules/persistent-storage-csi-dynamic-provisioning-aws-efs.adoc[leveloffset=+1] 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]. +[role="_additional-resources"] +.Additional resources +* 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)] +* 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] +// Undefine {StorageClass} attribute, so that any mistakes are easily spotted +:!StorageClass: include::modules/persistent-storage-csi-efs-static-pv.adoc[leveloffset=+1] 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].