From f5697ddfdfd01252318b9958e02b9d17a851161e Mon Sep 17 00:00:00 2001 From: Justin Riley Date: Tue, 19 Nov 2024 12:11:18 -0500 Subject: [PATCH] add weka storageclass for RWX volumes --- csi-wekafsplugin/base/kustomization.yaml | 1 + .../kustomization.yaml | 4 ++ .../storageclass.yaml | 39 +++++++++++++++++++ 3 files changed, 44 insertions(+) create mode 100644 csi-wekafsplugin/base/storage.k8s.io/storageclasses/storageclass-wekafs-dir-api/kustomization.yaml create mode 100644 csi-wekafsplugin/base/storage.k8s.io/storageclasses/storageclass-wekafs-dir-api/storageclass.yaml diff --git a/csi-wekafsplugin/base/kustomization.yaml b/csi-wekafsplugin/base/kustomization.yaml index ad55b59d..36593fd3 100644 --- a/csi-wekafsplugin/base/kustomization.yaml +++ b/csi-wekafsplugin/base/kustomization.yaml @@ -7,6 +7,7 @@ resources: - core/serviceaccounts/csi-wekafsplugin-node - core/serviceaccounts/csi-wekafsplugin-controller - storage.k8s.io/csidrivers/csi.weka.io + - storage.k8s.io/storageclasses/storageclass-wekafs-dir-api - security.openshift.io/securitycontextconstraints/csi-wekafsplugin-node-scc - security.openshift.io/securitycontextconstraints/csi-wekafsplugin-controller-scc - rbac.authorization.k8s.io/clusterrolebindings/csi-wekafsplugin-node diff --git a/csi-wekafsplugin/base/storage.k8s.io/storageclasses/storageclass-wekafs-dir-api/kustomization.yaml b/csi-wekafsplugin/base/storage.k8s.io/storageclasses/storageclass-wekafs-dir-api/kustomization.yaml new file mode 100644 index 00000000..23c2e0c6 --- /dev/null +++ b/csi-wekafsplugin/base/storage.k8s.io/storageclasses/storageclass-wekafs-dir-api/kustomization.yaml @@ -0,0 +1,4 @@ +apiVersion: kustomize.config.k8s.io/v1beta1 +kind: Kustomization +resources: + - storageclass.yaml diff --git a/csi-wekafsplugin/base/storage.k8s.io/storageclasses/storageclass-wekafs-dir-api/storageclass.yaml b/csi-wekafsplugin/base/storage.k8s.io/storageclasses/storageclass-wekafs-dir-api/storageclass.yaml new file mode 100644 index 00000000..a097eaa2 --- /dev/null +++ b/csi-wekafsplugin/base/storage.k8s.io/storageclasses/storageclass-wekafs-dir-api/storageclass.yaml @@ -0,0 +1,39 @@ +apiVersion: storage.k8s.io/v1 +kind: StorageClass +metadata: + name: storageclass-wekafs-dir-api +provisioner: csi.weka.io +reclaimPolicy: Delete +volumeBindingMode: Immediate +allowVolumeExpansion: true +parameters: + volumeType: dir/v1 + filesystemName: default + # optional parameters setting UID, GID and permissions on volume + # UID of the volume owner, default 0 (root) + # ownerUid: "1000" + + # GID of the volume owner, default 0 (root) + # ownerGid: "1000" + + # permissions in Unix octal format, default "0750" + # permissions: "0775" + + # capacity enforcement mode (either SOFT or HARD) + # - HARD or unspecified: pod will not be able to write above quota + # - SOFT: warning will be issued on Weka cluster, but writing will not be blocked + capacityEnforcement: HARD + # name of the secret that stores API credentials for a cluster + # change the name of secret to match secret of a particular cluster (if you have several Weka clusters) + csi.storage.k8s.io/provisioner-secret-name: &secretName csi-wekafs-api-secret + # change the name of the namespace in which the cluster API credentials + csi.storage.k8s.io/provisioner-secret-namespace: &secretNamespace csi-wekafsplugin + # do not change anything below this line, or set to same parameters as above + csi.storage.k8s.io/controller-publish-secret-name: *secretName + csi.storage.k8s.io/controller-publish-secret-namespace: *secretNamespace + csi.storage.k8s.io/controller-expand-secret-name: *secretName + csi.storage.k8s.io/controller-expand-secret-namespace: *secretNamespace + csi.storage.k8s.io/node-stage-secret-name: *secretName + csi.storage.k8s.io/node-stage-secret-namespace: *secretNamespace + csi.storage.k8s.io/node-publish-secret-name: *secretName + csi.storage.k8s.io/node-publish-secret-namespace: *secretNamespace