From e44e974ec25ece05d1c6f97e5e6c3319243c0c43 Mon Sep 17 00:00:00 2001 From: Matthew Wong Date: Fri, 12 Mar 2021 13:51:07 -0800 Subject: [PATCH] Remove storageclass from static example --- .../kubernetes/static-provisioning/README.md | 5 +-- .../static-provisioning/specs/example.yaml | 41 ++++++++----------- 2 files changed, 18 insertions(+), 28 deletions(-) diff --git a/examples/kubernetes/static-provisioning/README.md b/examples/kubernetes/static-provisioning/README.md index c194027a11..2ca00aa615 100644 --- a/examples/kubernetes/static-provisioning/README.md +++ b/examples/kubernetes/static-provisioning/README.md @@ -1,5 +1,5 @@ # Static Provisioning -This example shows how to create and consume persistence volume from exising EBS using static provisioning. +This example shows how to create and consume persistent volume from exising EBS using static provisioning. ## Usage 1. Edit the PersistentVolume spec in [example manifest](./specs/example.yaml). Update `volumeHandle` with EBS volume ID that you are going to use, and update the `fsType` with the filesystem type of the volume. In this example, I have a pre-created EBS volume in us-east-1c availability zone and it is formatted with xfs filesystem. @@ -15,7 +15,6 @@ spec: volumeMode: Filesystem accessModes: - ReadWriteOnce - storageClassName: ebs-sc csi: driver: ebs.csi.aws.com volumeHandle: {volumeId} @@ -29,7 +28,7 @@ spec: values: - us-east-1c ``` -Note that node affinity is used here since EBS volume is created in us-east-1c, hence only node in the same AZ can consume this persisence volume. +Note that node affinity is used here since EBS volume is created in us-east-1c, hence only node in the same AZ can consume this persistent volume. 2. Deploy the example: ```sh diff --git a/examples/kubernetes/static-provisioning/specs/example.yaml b/examples/kubernetes/static-provisioning/specs/example.yaml index 40613d7ffc..dcc7e1dec5 100644 --- a/examples/kubernetes/static-provisioning/specs/example.yaml +++ b/examples/kubernetes/static-provisioning/specs/example.yaml @@ -1,11 +1,3 @@ -kind: StorageClass -apiVersion: storage.k8s.io/v1 -metadata: - name: ebs-sc -provisioner: ebs.csi.aws.com -volumeBindingMode: WaitForFirstConsumer -reclaimPolicy: Retain ---- apiVersion: v1 kind: PersistentVolume metadata: @@ -16,7 +8,6 @@ spec: volumeMode: Filesystem accessModes: - ReadWriteOnce - storageClassName: ebs-sc csi: driver: ebs.csi.aws.com volumeHandle: vol-05786ec9ec9526b67 @@ -24,11 +15,11 @@ spec: nodeAffinity: required: nodeSelectorTerms: - - matchExpressions: - - key: topology.ebs.csi.aws.com/zone - operator: In - values: - - us-east-1c + - matchExpressions: + - key: topology.ebs.csi.aws.com/zone + operator: In + values: + - us-east-1c --- apiVersion: v1 kind: PersistentVolumeClaim @@ -37,7 +28,6 @@ metadata: spec: accessModes: - ReadWriteOnce - storageClassName: ebs-sc resources: requests: storage: 50Gi @@ -48,14 +38,15 @@ metadata: name: app spec: containers: - - name: app - image: centos - command: ["/bin/sh"] - args: ["-c", "while true; do echo $(date -u) >> /data/out.txt; sleep 5; done"] - volumeMounts: - - name: persistent-storage - mountPath: /data + - name: app + image: centos + command: ["/bin/sh"] + args: + ["-c", "while true; do echo $(date -u) >> /data/out.txt; sleep 5; done"] + volumeMounts: + - name: persistent-storage + mountPath: /data volumes: - - name: persistent-storage - persistentVolumeClaim: - claimName: ebs-claim + - name: persistent-storage + persistentVolumeClaim: + claimName: ebs-claim