storage capability

This commit is contained in:
zhangmin
2020-06-04 10:36:13 +08:00
parent 2f650dbac5
commit c6158a7cd3
84 changed files with 19178 additions and 110 deletions

View File

@@ -0,0 +1,80 @@
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
name: storageclasscapabilities.storage.kubesphere.io
spec:
group: storage.kubesphere.io
version: v1alpha1
names:
plural: storageclasscapabilities
singular: storageclasscapability
kind: StorageClassCapability
shortNames:
- sccap
preserveUnknownFields: false
additionalPrinterColumns:
- name: Provisioner
type: string
JSONPath: .spec.provisioner
- name: Volume
type: boolean
JSONPath: .spec.features.volume.create
- name: Snapshot
type: boolean
JSONPath: .spec.features.snapshot.create
- name: Age
type: date
JSONPath: .metadata.creationTimestamp
scope: Cluster
validation:
openAPIV3Schema:
type: object
properties:
apiVersion:
type: string
kind:
type: string
metadata:
type: object
spec:
type: object
properties:
provisioner:
type: string
features:
type: object
properties:
topology:
description: topology determines whether a provisioner support topology by looking up GetPluginCapabilities.PluginCapability
type: boolean
volume:
type: object
properties:
create:
description: 'Create/Delete volume. Determined by ControllerGetCapabilities in ControllerServer'
type: boolean
attach:
description: 'CSI Plugin implement ControllerPublishVolume/ControllerUnpublishVolume. Determined by ControllerGetCapabilities in ControllerServer'
type: boolean
list:
description: 'CSI Plugin implement ListVolume. Determined by ControllerGetCapabilities in ControllerServer'
type: boolean
clone:
description: 'Determined by ControllerGetCapabilities in ControllerServer'
type: boolean
stats:
description: 'Determined by NodeGetCapabilities in NodeServer'
type: boolean
expandMode:
description: 'Determined by GetPluginCapabilities in IdentityServer and StorageClass AllowVolumeExpansion'
type: string
items:
type: string
enum: ["UNKNOWN", "OFFLINE", "ONLINE"]
snapshot:
type: object
properties:
create:
type: boolean
list:
type: boolean

View File

@@ -141,3 +141,31 @@ rules:
- update
- patch
- delete
- apiGroups:
- "storage.k8s.io"
resources:
- storageclasses
verbs:
- get
- list
- watch
- apiGroups:
- "snapshot.storage.k8s.io"
resources:
- volumesnapshotclasses
verbs:
- get
- list
- watch
- apiGroups:
- "storage.kubesphere.io"
resources:
- storageclasscapabilities
verbs:
- create
- get
- list
- watch
- update
- patch
- delete

View File

@@ -0,0 +1,18 @@
apiVersion: storage.kubesphere.io/v1alpha1
kind: StorageClassCapability
metadata:
name: example-sc
spec:
provisioner: "csi.example.sc"
features:
topology: true
volume:
create: true
attach: true
clone: true
list: false
stats: true
expandMode: UNKNOWN
snapshot:
create: true
list: false