From de01134331e554b3f47fba2d7a3843e985e1509a Mon Sep 17 00:00:00 2001 From: Vasily Oleynikov Date: Sun, 5 May 2024 22:07:48 +0300 Subject: [PATCH] [controller] Add NFSStorageClass CRD (#3) Signed-off-by: v.oleynikov --- crds/doc-ru-nfsstorageclass.yaml | 60 +++++++++++++ crds/nfsstorageclass.yaml | 140 +++++++++++++++++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 crds/doc-ru-nfsstorageclass.yaml create mode 100644 crds/nfsstorageclass.yaml diff --git a/crds/doc-ru-nfsstorageclass.yaml b/crds/doc-ru-nfsstorageclass.yaml new file mode 100644 index 0000000..d35c40b --- /dev/null +++ b/crds/doc-ru-nfsstorageclass.yaml @@ -0,0 +1,60 @@ +spec: + versions: + - name: v1alpha1 + schema: + openAPIV3Schema: + description: | + Интерфейс управления StorageСlass для CSI-драйвера nfs.csi.storage.deckhouse.io. Ручное создание StorageClass для данного драйвера запрещено. + properties: + spec: + properties: + server: + description: | + Настройки сервера NFS + properties: + host: + description: | + Адрес NFS сервера + share: + description: | + Путь к точке монтирования на NFS сервере + nfsVersion: + description: | + Версия NFS сервера + options: + description: | + Опции монтирования + properties: + mountMode: + description: | + Режим монтирования NFS раздела + timeout: + description: | + Таймаут NFS сервера + retransmissions: + description: | + Количество попыток подключения к NFS серверу + readOnly: + description: | + Монтирование в режиме "только чтение" + chmodPermissions: + description: | + Права монтирования субдиректории в NFS разделе + reclaimPolicy: + description: | + Режим поведения при удалении PVC. Может быть: + - Delete (При удалении PVC будет удален PV и данные на NFS-сервере) + - Retain (При удалении PVC не будут удалены PV и данные на NFS-сервере, потребуют ручного удаления пользователем) + volumeBindingMode: + description: | + Режим создания тома. Может быть Immediate (запрос при создании PVC) или WaitForFirstConsumer (до появления первого Pod) + status: + properties: + phase: + description: | + Общее текущее состояние StorageClass. Может быть: + - Failed (если контроллер получил некорректную конфигурацию ресурса или возникли ошибки в процессе выполнения операции) + - Created (если StorageClass создан успешно) + reason: + description: | + Дополнительная информация о текущем состоянии StorageClass. diff --git a/crds/nfsstorageclass.yaml b/crds/nfsstorageclass.yaml new file mode 100644 index 0000000..fdac42a --- /dev/null +++ b/crds/nfsstorageclass.yaml @@ -0,0 +1,140 @@ +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: nfsstorageclasses.storage.deckhouse.io + labels: + heritage: deckhouse + module: storage +spec: + group: storage.deckhouse.io + scope: Cluster + names: + plural: nfsstorageclasses + singular: nfsstorageclass + kind: NFSStorageClass + shortNames: + - nsc + preserveUnknownFields: false + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + type: object + description: | + NFSStorageClass is a Kubernetes Custom Resource that defines a configuration for a Kubernetes Storage class. + required: + - spec + properties: + spec: + type: object + description: | + Defines a Kubernetes Storage class configuration. + required: + - server + properties: + server: + type: object + description: | + Defines a Kubernetes Storage class configuration. + required: + - host + - share + - nfsVersion + properties: + host: + type: string + x-kubernetes-validations: + - rule: self == oldSelf + message: Value is immutable. + description: | + NFS server host + share: + type: string + x-kubernetes-validations: + - rule: self == oldSelf + message: Value is immutable. + description: | + NFS server share path + nfsVersion: + type: string + x-kubernetes-validations: + - rule: self == oldSelf + message: Value is immutable. + description: | + NFS server version + enum: + - "3" + - "4.1" + - "4.2" + options: + type: object + description: | + Storage class mount options + properties: + mountMode: + type: string + description: | + NFS share mount mode + enum: + - hard + - soft + timeout: + type: integer + description: | + NFS server timeout + retransmissions: + type: integer + description: | + NFS retries before fail + readOnly: + type: boolean + description: | + Share read-only flag + chmodPermissions: + type: string + description: | + chmod rights for PVs subdirectory + reclaimPolicy: + type: string + x-kubernetes-validations: + - rule: self == oldSelf + message: Value is immutable. + description: | + The storage class's reclaim policy. Might be: + - Delete (If the Persistent Volume Claim is deleted, deletes the Persistent Volume and its associated storage as well) + - Retain (If the Persistent Volume Claim is deleted, remains the Persistent Volume and its associated storage) + enum: + - Delete + - Retain + volumeBindingMode: + type: string + x-kubernetes-validations: + - rule: self == oldSelf + message: Value is immutable. + description: | + The storage class's volume binding mode. Might be Immediate or WaitForFirstConsumer + enum: + - Immediate + - WaitForFirstConsumer + status: + type: object + description: | + Displays current information about the Storage Class. + properties: + phase: + type: string + description: | + The Storage class current state. Might be: + - Failed (if the controller received incorrect resource configuration or some errors occurred during the operation) + - Create (if everything went fine) + enum: + - Failed + - Created + reason: + type: string + description: | + Additional information about the current state of the Storage Class. + subresources: + status: {}