Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] feat(shared-vg) : add support for create, delete, publish & unpublish of shared volumes #184

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add support for create, delete, publish & unpublish of shared volumes
Signed-off-by: Abhishek Agarwal <[email protected]>
  • Loading branch information
Abhishek Agarwal committed Apr 6, 2022
commit 79fc8ef74879abd4b88beb4b35d6e407908a5d94
128 changes: 42 additions & 86 deletions deploy/lvm-operator.yaml

Large diffs are not rendered by default.

60 changes: 21 additions & 39 deletions deploy/yamls/lvmnode-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: lvmnodes.local.openebs.io
spec:
Expand All @@ -32,34 +32,27 @@ spec:
- name: v1alpha1
schema:
openAPIV3Schema:
description: LVMNode records information about all lvm volume groups available
in a node. In general, the openebs node-agent creates the LVMNode object
& periodically synchronizing the volume groups available in the node. LVMNode
has an owner reference pointing to the corresponding node object.
description: LVMNode records information about all lvm volume groups available in a node. In general, the openebs node-agent creates the LVMNode object & periodically synchronizing the volume groups available in the node. LVMNode has an owner reference pointing to the corresponding node object.
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'
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'
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
volumeGroups:
items:
description: VolumeGroup specifies attributes of a given vg exists on
node.
description: VolumeGroup specifies attributes of a given vg exists on node.
properties:
allocationPolicy:
description: 'AllocationPolicy indicates the volume group allocation
policy. AllocationPolicy has the following mapping between int
and string for its value: [-1: "", 0: "normal", 1: "contiguous",
2: "cling", 3: "anywhere", 4: "inherited"]'
description: 'AllocationPolicy indicates the volume group allocation policy. AllocationPolicy has the following mapping between int and string for its value: [-1: "", 0: "normal", 1: "contiguous", 2: "cling", 3: "anywhere", 4: "inherited"]'
type: integer
attr:
description: Attributes of the lvm volume group
minLength: 1
type: string
free:
anyOf:
- type: integer
Expand All @@ -68,65 +61,53 @@ spec:
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
lvCount:
description: LVCount denotes total number of logical volumes in
volume group.
description: LVCount denotes total number of logical volumes in volume group.
format: int32
minimum: 0
type: integer
maxLv:
description: MaxLV denotes maximum number of logical volumes allowed
in volume group or 0 if unlimited.
description: MaxLV denotes maximum number of logical volumes allowed in volume group or 0 if unlimited.
format: int32
type: integer
maxPv:
description: MaxPV denotes maximum number of physical volumes allowed
in volume group or 0 if unlimited.
description: MaxPV denotes maximum number of physical volumes allowed in volume group or 0 if unlimited.
format: int32
type: integer
metadataCount:
description: MetadataCount denotes number of metadata areas on the
volume group.
description: MetadataCount denotes number of metadata areas on the volume group.
format: int32
type: integer
metadataFree:
anyOf:
- type: integer
- type: string
description: MetadataFree specifies the available metadata area
space for the volume group
description: MetadataFree specifies the available metadata area space for the volume group
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
metadataSize:
anyOf:
- type: integer
- type: string
description: MetadataSize specifies size of smallest metadata area
for the volume group
description: MetadataSize specifies size of smallest metadata area for the volume group
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
x-kubernetes-int-or-string: true
metadataUsedCount:
description: MetadataUsedCount denotes number of used metadata areas
in volume group
description: MetadataUsedCount denotes number of used metadata areas in volume group
format: int32
type: integer
missingPvCount:
description: MissingPVCount denotes number of physical volumes in
volume group which are missing.
description: MissingPVCount denotes number of physical volumes in volume group which are missing.
format: int32
type: integer
name:
description: Name of the lvm volume group.
minLength: 1
type: string
permissions:
description: 'Permission indicates the volume group permission which
can be writable or read-only. Permission has the following mapping
between int and string for its value: [-1: "", 0: "writeable",
1: "read-only"]'
description: 'Permission indicates the volume group permission which can be writable or read-only. Permission has the following mapping between int and string for its value: [-1: "", 0: "writeable", 1: "read-only"]'
type: integer
pvCount:
description: PVCount denotes total number of physical volumes constituting
the volume group.
description: PVCount denotes total number of physical volumes constituting the volume group.
format: int32
minimum: 0
type: integer
Expand All @@ -147,6 +128,7 @@ spec:
type: string
required:
- allocationPolicy
- attr
- free
- lvCount
- maxLv
Expand Down
20 changes: 6 additions & 14 deletions deploy/yamls/lvmsnapshot-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: lvmsnapshots.local.openebs.io
spec:
Expand All @@ -33,40 +33,32 @@ spec:
description: LVMSnapshot represents an LVM Snapshot of the lvm volume
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'
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'
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:
description: LVMSnapshotSpec defines LVMSnapshot spec
properties:
ownerNodeID:
description: OwnerNodeID is the Node ID where the volume group is
present which is where the snapshot has been provisioned. OwnerNodeID
can not be edited after the snapshot has been provisioned.
description: OwnerNodeID is the Node ID where the volume group is present which is where the snapshot has been provisioned. OwnerNodeID can not be edited after the snapshot has been provisioned.
minLength: 1
type: string
snapSize:
description: SnapSize specifies the space reserved for the snapshot
type: string
volGroup:
description: VolGroup specifies the name of the volume group where
the snapshot has been created.
description: VolGroup specifies the name of the volume group where the snapshot has been created.
type: string
required:
- ownerNodeID
- volGroup
type: object
status:
description: SnapStatus string that reflects if the snapshot was created
successfully
description: SnapStatus string that reflects if the snapshot was created successfully
properties:
state:
type: string
Expand Down
48 changes: 15 additions & 33 deletions deploy/yamls/lvmvolume-crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
annotations:
controller-gen.kubebuilder.io/version: v0.4.0
controller-gen.kubebuilder.io/version: v0.5.0
creationTimestamp: null
name: lvmvolumes.local.openebs.io
spec:
Expand Down Expand Up @@ -56,14 +56,10 @@ spec:
description: LVMVolume represents a LVM based volume
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'
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'
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
Expand All @@ -75,35 +71,29 @@ spec:
minLength: 1
type: string
ownerNodeID:
description: OwnerNodeID is the Node ID where the volume group is
present which is where the volume has been provisioned. OwnerNodeID
can not be edited after the volume has been provisioned.
description: OwnerNodeID is the Node ID where the volume group is present which is where the volume has been provisioned. OwnerNodeID can not be edited after the volume has been provisioned.
minLength: 1
type: string
shared:
description: Shared specifies whether the volume can be shared among
multiple pods. If it is not set to "yes", then the LVM LocalPV Driver
will not allow the volumes to be mounted by more than one pods.
description: Shared specifies whether the volume can be shared among multiple pods. If it is not set to "yes", then the LVM LocalPV Driver will not allow the volumes to be mounted by more than one pods.
enum:
- "yes"
- "no"
type: string
sharedMode:
description: SharedMode specifies whether the volume can be accessed from multiple nodes which are connected to the same storage device. Currently, only "none" and "exclusive" modes are allowed.
type: string
thinProvision:
description: ThinProvision specifies whether logical volumes can be
thinly provisioned. If it is set to "yes", then the LVM LocalPV
Driver will create thinProvision i.e. logical volumes that are larger
than the available extents.
description: ThinProvision specifies whether logical volumes can be thinly provisioned. If it is set to "yes", then the LVM LocalPV Driver will create thinProvision i.e. logical volumes that are larger than the available extents.
enum:
- "yes"
- "no"
type: string
vgPattern:
description: VgPattern specifies the regex to choose volume groups
where volume needs to be created.
description: VgPattern specifies the regex to choose volume groups where volume needs to be created.
type: string
volGroup:
description: VolGroup specifies the name of the volume group where
the volume has been created.
description: VolGroup specifies the name of the volume group where the volume has been created.
type: string
required:
- capacity
Expand All @@ -112,27 +102,19 @@ spec:
- volGroup
type: object
status:
description: VolStatus string that specifies the current state of the
volume provisioning request.
description: VolStatus string that specifies the current state of the volume provisioning request.
properties:
error:
description: Error denotes the error occurred during provisioning/expanding
a volume. Error field should only be set when State becomes Failed.
description: Error denotes the error occurred during provisioning/expanding a volume. Error field should only be set when State becomes Failed.
properties:
code:
description: VolumeErrorCode represents the error code to represent
specific class of errors.
description: VolumeErrorCode represents the error code to represent specific class of errors.
type: string
message:
type: string
type: object
state:
description: State specifies the current state of the volume provisioning
request. The state "Pending" means that the volume creation request
has not processed yet. The state "Ready" means that the volume has
been created and it is ready for the use. "Failed" means that volume
provisioning has been failed and will not be retried by node agent
controller.
description: State specifies the current state of the volume provisioning request. The state "Pending" means that the volume creation request has not processed yet. The state "Ready" means that the volume has been created and it is ready for the use. "Failed" means that volume provisioning has been failed and will not be retried by node agent controller.
enum:
- Pending
- Ready
Expand Down
Loading