Skip to content

Commit

Permalink
fix: Detection of storage classes for EFS
Browse files Browse the repository at this point in the history
Signed-off-by: Denilson Nastacio <[email protected]>
  • Loading branch information
nastacio committed Mar 17, 2023
1 parent 3b34cbe commit 871e55a
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 10 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ The Argo CD `Application` resources have pre-synchronization hooks that will att

| Precedence | OpenShift platform | Storage | Storage classes |
| ---------- | ------------ | ------- | --------------- |
| Highest | All | OpenShift Data Foundation | `ocs-storagecluster-ceph-rbd` (RWO) and `ocs-storagecluster-cephfs` (RWX). |
| High | All | Rook Ceph | `rook-ceph-block` (RWO) and `rook-cephfs` (RWX) |
| Highest | All | OpenShift Data Foundation | `ocs-storagecluster-ceph-rbd` (RWO) and `ocs-storagecluster-cephfs` (RWX). |
| High | All | Rook Ceph | `rook-ceph-block` (RWO) and `rook-cephfs` (RWX) |
| Medium | All | NetApp ONTAP (Trident driver) | `trident-csi` (RWO and RWX.) Note about RWO access mode: the synchronization hooks give preference to a storage class named `trident-block-csi` if it can find one in the cluster. |
| Low | IBM Cloud (ROKS classic) | IBM Cloud File Storage | `ibmc-block-gold` (RWO) and `ibmc-file-gold-gid` (RWX) |
| Low | AWS (self-managed and ROSA) | Elastic Block Store and Elastic File System | `gp2` (RWO) and `efs` (RWX) |
| Low | AWS (self-managed and ROSA) | Elastic Block Store and Elastic File System | First storage class with provisioner `ebs.csi.aws.com` (RWO) and first storage class with provisioner `efs.csi.aws.com` (RWX) |
| Low | Azure (self-managed and ARO) | Azure Disk (classic) and Azure File System | `managed-premium` (RWO) and `azure-file` (RWX) |

Note that this is a list of supported storage providers for this repository.
Note that this is a list of validated storage providers for this repository.
Cloud Paks may support different matrixes of storage vendors.

## Installation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,14 @@ spec:
else
platform=$(oc get Infrastructure cluster -o jsonpath={.status.platform})
if [ "${platform}" == "AWS" ]; then
ebs=$(oc get StorageClasses | grep kubernetes.io/aws-ebs | cut -d " " -f 1) || true
efs=$(oc get StorageClasses | grep openshift.org/aws-efs | cut -d " " -f 1) || true
ebs=$(oc get StorageClasses | grep ebs.csi.aws.com | head -n 1 | cut -d " " -f 1) || true
if [ -z "${ebs}" ]; then
ebs=$(oc get StorageClasses | grep kubernetes.io/aws-ebs | cut -d " " -f 1) || true
fi
efs=$(oc get StorageClasses | grep efs.csi.aws.com | head -n 1 | cut -d " " -f 1) || true
if [ -z "${efs}" ]; then
efs=$(oc get StorageClasses | grep openshift.org/aws-efs | cut -d " " -f 1) || true
fi
if [ -n "${ebs}" ] && [ -n "${efs}" ]; then
storage_class_rwo="${ebs}"
storage_class_rwx="${efs}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,14 @@ spec:
else
platform=$(oc get Infrastructure cluster -o jsonpath={.status.platform})
if [ "${platform}" == "AWS" ]; then
ebs=$(oc get StorageClasses | grep kubernetes.io/aws-ebs | cut -d " " -f 1) || true
efs=$(oc get StorageClasses | grep openshift.org/aws-efs | cut -d " " -f 1) || true
ebs=$(oc get StorageClasses | grep ebs.csi.aws.com | head -n 1 | cut -d " " -f 1) || true
if [ -z "${ebs}" ]; then
ebs=$(oc get StorageClasses | grep kubernetes.io/aws-ebs | cut -d " " -f 1) || true
fi
efs=$(oc get StorageClasses | grep efs.csi.aws.com | head -n 1 | cut -d " " -f 1) || true
if [ -z "${efs}" ]; then
efs=$(oc get StorageClasses | grep openshift.org/aws-efs | cut -d " " -f 1) || true
fi
if [ -n "${ebs}" ] && [ -n "${efs}" ]; then
storage_class_rwo="${ebs}"
storage_class_rwx="${efs}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,11 @@ spec:
else
platform=$(oc get Infrastructure cluster -o jsonpath={.status.platform})
if [ "${platform}" == "AWS" ]; then
ebs=$(oc get StorageClasses | grep kubernetes.io/aws-ebs | cut -d " " -f 1) || true
if [ -n "${ebs}" ] && [ -n "${efs}" ]; then
ebs=$(oc get StorageClasses | grep ebs.csi.aws.com | head -n 1 | cut -d " " -f 1) || true
if [ -z "${ebs}" ]; then
ebs=$(oc get StorageClasses | grep kubernetes.io/aws-ebs | cut -d " " -f 1) || true
fi
if [ -n "${ebs}" ]; then
storage_class_rwo="${ebs}"
else
storage_class_rwo="{{.Values.storageclass.rwo.aws}}"
Expand Down

0 comments on commit 871e55a

Please sign in to comment.