diff --git a/crds/lvmlogicalvolume.yaml b/crds/lvmlogicalvolume.yaml index bfa8ad23..70559630 100644 --- a/crds/lvmlogicalvolume.yaml +++ b/crds/lvmlogicalvolume.yaml @@ -115,12 +115,32 @@ spec: description: | If true, the Logical Volume will be created with the contiguous flag. Use it carefully as LV might not be created even if there is enough space in VG. source: - type: string + type: object description: | - Name of the source, if present. + Source of the volume, if present. x-kubernetes-validations: - rule: self == oldSelf message: Value is immutable. + required: + - kind + - name + properties: + kind: + type: string + enum: [LVMLogicalVolume, LVMLogicalVolumeSnapshot] + description: | + Kind of the source. Kind LVMLogicalVolume means that current resource is clone. Kind LVMLogicalVolumeSnapshot means that current resource is a restored volume. + x-kubernetes-validations: + - rule: self == oldSelf + message: Value is immutable. + name: + type: string + description: | + The name of the resource current resource is created from. + x-kubernetes-validations: + - rule: self == oldSelf + message: Value is immutable. + minLength: 1 status: type: object description: | diff --git a/crds/lvmlogicalvolumesnapshot.yaml b/crds/lvmlogicalvolumesnapshot.yaml new file mode 100644 index 00000000..afb1ade4 --- /dev/null +++ b/crds/lvmlogicalvolumesnapshot.yaml @@ -0,0 +1,93 @@ +--- +apiVersion: apiextensions.k8s.io/v1 +kind: CustomResourceDefinition +metadata: + name: lvmlogicalvolumesnapshots.storage.deckhouse.io + labels: + heritage: deckhouse + module: storage +spec: + group: storage.deckhouse.io + scope: Cluster + names: + kind: LVMLogicalVolumeSnapshot + plural: lvmlogicalvolumesnapshots + singular: lvmlogicalvolumesnapshot + shortNames: + - llvs + preserveUnknownFields: false + versions: + - name: v1alpha1 + served: true + storage: true + schema: + openAPIV3Schema: + type: object + description: | + The LVMLogicalVolumeSnapshot resource defines the storage where a VolumeSnapshot will be created in. + required: + - spec + properties: + spec: + type: object + required: + - nodeName + - lvmLogicalVolumeName + properties: + nodeName: + type: string + description: | + The name of the kubernetes node the snapshot is on. + x-kubernetes-validations: + - rule: self == oldSelf + message: Value is immutable. + minLength: 1 + lvmLogicalVolumeName: + type: string + description: | + The name of the LVMLogicalVolume resource the snapshot is created from. + x-kubernetes-validations: + - rule: self == oldSelf + message: Value is immutable. + minLength: 1 + status: + type: object + description: | + Describes the resource status. + properties: + phase: + type: string + enum: [Created, Pending, Failed] + description: | + The current resource's phase. + reason: + type: string + description: | + The reason of the phase. + size: + description: | + Snapshotted LV size on the node. + type: string + actualSize: + description: | + Snapshot LV size on the node. + type: string + subresources: + status: {} + additionalPrinterColumns: + - jsonPath: .spec.lvmLogicalVolumeName + name: Snapshotted LLV Name + type: string + description: Snapshotted LLV name + - jsonPath: .status.phase + name: Phase + type: string + description: The current resource status. + - jsonPath: .status.size + name: Size + type: string + description: Snapshotted LV size. + - jsonPath: .status.actualSize + name: ActualSize + type: string + description: Snapshot size.