-
Notifications
You must be signed in to change notification settings - Fork 99
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
feat(scheduling): add volume group capacity tracking #21
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -260,6 +260,118 @@ status: | |
conditions: [] | ||
storedVersions: [] | ||
|
||
|
||
############################################## | ||
########### ############ | ||
########### LVMNode CRD ############ | ||
########### ############ | ||
############################################## | ||
|
||
# LVMNode CRD is autogenerated via `make manifests` command. | ||
# Do the modification in the code and run the `make manifests` command | ||
# to generate the CRD definition | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.2.8 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can start using the controller-gen verison v0.4.0 version which will basically generates the |
||
creationTimestamp: null | ||
name: lvmnodes.local.openebs.io | ||
spec: | ||
group: local.openebs.io | ||
names: | ||
kind: LVMNode | ||
listKind: LVMNodeList | ||
plural: lvmnodes | ||
shortNames: | ||
- lvmnode | ||
singular: lvmnode | ||
preserveUnknownFields: false | ||
scope: Namespaced | ||
validation: | ||
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. | ||
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/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/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
volumeGroups: | ||
items: | ||
description: VolumeGroup specifies attributes of a given vg exists on | ||
node. | ||
properties: | ||
free: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
description: Free specifies the available capacity of 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 | ||
lvCount: | ||
description: LVCount denotes total number of logical volumes in volume | ||
group. | ||
format: int32 | ||
minimum: 0 | ||
type: integer | ||
name: | ||
description: Name of the lvm volume group. | ||
minLength: 1 | ||
type: string | ||
pvCount: | ||
description: PVCount denotes total number of physical volumes constituting | ||
the volume group. | ||
format: int32 | ||
minimum: 0 | ||
type: integer | ||
size: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
description: Size specifies the total size of 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 | ||
uuid: | ||
description: UUID denotes a unique identity of a lvm volume group. | ||
minLength: 1 | ||
type: string | ||
required: | ||
- free | ||
- lvCount | ||
- name | ||
- pvCount | ||
- size | ||
- uuid | ||
type: object | ||
type: array | ||
required: | ||
- volumeGroups | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] | ||
|
||
--- | ||
|
||
# Create the CSI Driver object | ||
|
@@ -939,6 +1051,9 @@ rules: | |
- apiGroups: ["storage.k8s.io"] | ||
resources: ["storageclasses", "csinodes"] | ||
verbs: ["get", "list", "watch"] | ||
- apiGroups: [ "storage.k8s.io" ] | ||
resources: [ "csistoragecapacities"] | ||
verbs: ["*"] | ||
- apiGroups: [""] | ||
resources: ["events"] | ||
verbs: ["list", "watch", "create", "update", "patch"] | ||
|
@@ -952,7 +1067,7 @@ rules: | |
resources: ["pods"] | ||
verbs: ["get", "list", "watch", "update", "patch"] | ||
- apiGroups: ["local.openebs.io"] | ||
resources: ["lvmvolumes", "lvmsnapshots"] | ||
resources: ["lvmvolumes", "lvmsnapshots", "lvmnodes"] | ||
verbs: ["*"] | ||
--- | ||
|
||
|
@@ -1159,7 +1274,7 @@ rules: | |
resources: ["persistentvolumes", "nodes", "services"] | ||
verbs: ["get", "list"] | ||
- apiGroups: ["local.openebs.io"] | ||
resources: ["lvmvolumes", "lvmsnapshots"] | ||
resources: ["lvmvolumes", "lvmsnapshots", "lvmnodes"] | ||
verbs: ["get", "list", "watch", "create", "update", "patch"] | ||
|
||
--- | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
|
||
|
||
############################################## | ||
########### ############ | ||
########### LVMNode CRD ############ | ||
########### ############ | ||
############################################## | ||
|
||
# LVMNode CRD is autogenerated via `make manifests` command. | ||
# Do the modification in the code and run the `make manifests` command | ||
# to generate the CRD definition | ||
|
||
--- | ||
apiVersion: apiextensions.k8s.io/v1beta1 | ||
kind: CustomResourceDefinition | ||
metadata: | ||
annotations: | ||
controller-gen.kubebuilder.io/version: v0.2.8 | ||
creationTimestamp: null | ||
name: lvmnodes.local.openebs.io | ||
spec: | ||
group: local.openebs.io | ||
names: | ||
kind: LVMNode | ||
listKind: LVMNodeList | ||
plural: lvmnodes | ||
shortNames: | ||
- lvmnode | ||
singular: lvmnode | ||
preserveUnknownFields: false | ||
scope: Namespaced | ||
validation: | ||
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. | ||
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/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/api-conventions.md#types-kinds' | ||
type: string | ||
metadata: | ||
type: object | ||
volumeGroups: | ||
items: | ||
description: VolumeGroup specifies attributes of a given vg exists on | ||
node. | ||
properties: | ||
free: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
description: Free specifies the available capacity of 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 | ||
lvCount: | ||
description: LVCount denotes total number of logical volumes in volume | ||
group. | ||
format: int32 | ||
minimum: 0 | ||
type: integer | ||
name: | ||
description: Name of the lvm volume group. | ||
minLength: 1 | ||
type: string | ||
pvCount: | ||
description: PVCount denotes total number of physical volumes constituting | ||
the volume group. | ||
format: int32 | ||
minimum: 0 | ||
type: integer | ||
size: | ||
anyOf: | ||
- type: integer | ||
- type: string | ||
description: Size specifies the total size of 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 | ||
uuid: | ||
description: UUID denotes a unique identity of a lvm volume group. | ||
minLength: 1 | ||
type: string | ||
required: | ||
- free | ||
- lvCount | ||
- name | ||
- pvCount | ||
- size | ||
- uuid | ||
type: object | ||
type: array | ||
required: | ||
- volumeGroups | ||
type: object | ||
version: v1alpha1 | ||
versions: | ||
- name: v1alpha1 | ||
served: true | ||
storage: true | ||
status: | ||
acceptedNames: | ||
kind: "" | ||
plural: "" | ||
conditions: [] | ||
storedVersions: [] |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can start using
v1
CRDs version ..v1beta
going to be deprecated in k8s 1.22There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I had initially configured the same, then saw that other crds (LVMSnapshot, LVMVolume etc) are using v1beta1. I think, we can take this up as part of separate pull request as it'll required changes to other crds as well.