From 3ba2a80fe5f54a8098583c28501fbc849c5e5c11 Mon Sep 17 00:00:00 2001 From: Vicente Cheng Date: Mon, 16 Sep 2024 12:16:32 +0800 Subject: [PATCH] charts: update NDM charts - add longhorn v2/lvm fields - add lvmvolumegroups CRD - add lvmvolumegroups permission Signed-off-by: Vicente Cheng --- .../crds/harvesterhci.io_blockdevices.yaml | 17 ++- .../crds/harvesterhci.io_lvmvolumegroups.yaml | 133 ++++++++++++++++++ .../templates/rbac.yaml | 2 +- 3 files changed, 149 insertions(+), 3 deletions(-) create mode 100644 charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_lvmvolumegroups.yaml diff --git a/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_blockdevices.yaml b/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_blockdevices.yaml index 2fa008cf..c7fcf1a0 100644 --- a/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_blockdevices.yaml +++ b/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_blockdevices.yaml @@ -74,8 +74,9 @@ spec: a string with the partition's mount point, or "" if no mount point was discovered type: string provisioned: - description: a bool indicating whether the filesystem can be provisioned - as a disk for the node to store data. + description: |- + a bool indicating whether the filesystem can be provisioned as a disk for the node to store data. + Deprecated: Replaced by field `spec.provision` type: boolean repaired: description: a bool indicating whether the filesystem is manually @@ -87,12 +88,24 @@ spec: nodeName: description: name of the node to which the block device is attached type: string + provision: + default: false + description: a bool for the device to be provisioned + type: boolean provisioner: properties: longhorn: description: a provisioner for provision Longhorn volume backend disk properties: + diskDriver: + description: specifies the driver to use for V2 data engine + disks + enum: + - "" + - auto + - aio + type: string engineVersion: description: a string with the engine version for the provisioner enum: diff --git a/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_lvmvolumegroups.yaml b/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_lvmvolumegroups.yaml new file mode 100644 index 000000000..9a35bf40 --- /dev/null +++ b/charts/harvester-node-disk-manager/templates/crds/harvesterhci.io_lvmvolumegroups.yaml @@ -0,0 +1,133 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + annotations: + {} + name: lvmvolumegroups.harvesterhci.io +spec: + group: harvesterhci.io + names: + kind: LVMVolumeGroup + listKind: LVMVolumeGroupList + plural: lvmvolumegroups + shortNames: + - lvmvg + - lvmvgs + singular: lvmvolumegroup + scope: Namespaced + versions: + - additionalPrinterColumns: + - jsonPath: .spec.parameters + name: Parameters + type: string + - jsonPath: .status.vgStatus + name: Status + type: string + - jsonPath: .spec.nodeName + name: Node + type: string + name: v1beta1 + schema: + openAPIV3Schema: + properties: + apiVersion: + description: |- + APIVersion defines the versioned schema of this representation of an object. + Servers should convert recognized schemas to the latest internal value, and + may reject unrecognized values. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources + type: string + kind: + description: |- + Kind is a string value representing the REST resource this object represents. + Servers may infer this from the endpoint the client submits requests to. + Cannot be updated. + In CamelCase. + More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds + type: string + metadata: + type: object + spec: + properties: + desireState: + description: |- + DesiredState is the desired state of the volume group + enabled means we will keep this vg active, disabled means we will keep this vg inactive + enum: + - Enabled + - Disabled + type: string + devices: + additionalProperties: + type: string + description: |- + The devices of the volume group + format: map[]=devPath" + type: object + nodeName: + description: NodeName is the name of the node where the volume group + is created + type: string + parameters: + description: Parameters is the parameters for creating the volume + group *optional* + type: string + vgName: + description: VGName is the name of the volume group + type: string + required: + - desireState + - nodeName + - vgName + type: object + status: + properties: + conditions: + description: The conditions of the volume group + items: + properties: + lastTransitionTime: + format: date-time + type: string + message: + type: string + reason: + type: string + status: + type: string + type: + type: string + required: + - lastTransitionTime + - status + - type + type: object + type: array + devices: + additionalProperties: + type: string + description: |- + The devices of the volume group + format: map[]=devPath" + type: object + parameters: + description: Parameters is the current parameters of the volume group + type: string + vgStatus: + default: Unknown + description: The status of the volume group + enum: + - Active + - Inactive + - Unknown + type: string + type: object + required: + - metadata + - spec + type: object + served: true + storage: true + subresources: + status: {} diff --git a/charts/harvester-node-disk-manager/templates/rbac.yaml b/charts/harvester-node-disk-manager/templates/rbac.yaml index 61f6cba6..3cbded9c 100644 --- a/charts/harvester-node-disk-manager/templates/rbac.yaml +++ b/charts/harvester-node-disk-manager/templates/rbac.yaml @@ -12,7 +12,7 @@ metadata: name: {{ include "harvester-node-disk-manager.name" . }} rules: - apiGroups: [ "harvesterhci.io" ] - resources: [ "blockdevices" ] + resources: [ "blockdevices", "lvmvolumegroups", "lvmvolumegroups/status" ] verbs: [ "*" ] - apiGroups: [ "longhorn.io" ] resources: [ "nodes" ]