mirror of
https://github.com/TECHNOFAB11/zfs-localpv.git
synced 2025-12-12 06:20:11 +01:00
feat(scheduling): add zfs pool capacity tracking (#335)
Signed-off-by: shubham <shubham.bajpai@mayadata.io>
This commit is contained in:
parent
4fce22afb5
commit
3eb2c9e894
26 changed files with 2284 additions and 7 deletions
|
|
@ -677,6 +677,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"]
|
||||
|
|
@ -690,7 +693,7 @@ rules:
|
|||
resources: ["pods"]
|
||||
verbs: ["get", "list", "watch", "update", "patch"]
|
||||
- apiGroups: ["*"]
|
||||
resources: ["zfsvolumes", "zfssnapshots", "zfsbackups", "zfsrestores"]
|
||||
resources: ["zfsvolumes", "zfssnapshots", "zfsbackups", "zfsrestores", "zfsnodes"]
|
||||
verbs: ["*"]
|
||||
---
|
||||
|
||||
|
|
@ -897,7 +900,7 @@ rules:
|
|||
resources: ["persistentvolumes", "nodes", "services"]
|
||||
verbs: ["get", "list"]
|
||||
- apiGroups: ["*"]
|
||||
resources: ["zfsvolumes", "zfssnapshots", "zfsbackups", "zfsrestores"]
|
||||
resources: ["zfsvolumes", "zfssnapshots", "zfsbackups", "zfsrestores", "zfsnodes"]
|
||||
verbs: ["get", "list", "watch", "create", "update", "patch"]
|
||||
|
||||
---
|
||||
|
|
|
|||
87
deploy/yamls/zfsnode-crd.yaml
Normal file
87
deploy/yamls/zfsnode-crd.yaml
Normal file
|
|
@ -0,0 +1,87 @@
|
|||
|
||||
##############################################
|
||||
########### ############
|
||||
########### ZFSNode CRD ############
|
||||
########### ############
|
||||
##############################################
|
||||
|
||||
# ZFSNode 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/v1
|
||||
kind: CustomResourceDefinition
|
||||
metadata:
|
||||
annotations:
|
||||
controller-gen.kubebuilder.io/version: v0.4.0
|
||||
creationTimestamp: null
|
||||
name: zfsnodes.zfs.openebs.io
|
||||
spec:
|
||||
group: zfs.openebs.io
|
||||
names:
|
||||
kind: ZFSNode
|
||||
listKind: ZFSNodeList
|
||||
plural: zfsnodes
|
||||
shortNames:
|
||||
- zfsnode
|
||||
singular: zfsnode
|
||||
scope: Namespaced
|
||||
versions:
|
||||
- name: v1
|
||||
schema:
|
||||
openAPIV3Schema:
|
||||
description: ZFSNode records information about all zfs pools available in
|
||||
a node. In general, the openebs node-agent creates the ZFSNode object &
|
||||
periodically synchronizing the zfs pools available in the node. ZFSNode
|
||||
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'
|
||||
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
|
||||
pools:
|
||||
items:
|
||||
description: Pool specifies attributes of a given zfs pool exists on
|
||||
node.
|
||||
properties:
|
||||
free:
|
||||
anyOf:
|
||||
- type: integer
|
||||
- type: string
|
||||
description: Free specifies the available capacity of zfs pool.
|
||||
pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
|
||||
x-kubernetes-int-or-string: true
|
||||
name:
|
||||
description: Name of the zfs zfs pool.
|
||||
minLength: 1
|
||||
type: string
|
||||
uuid:
|
||||
description: UUID denotes a unique identity of a zfs pool.
|
||||
minLength: 1
|
||||
type: string
|
||||
required:
|
||||
- free
|
||||
- name
|
||||
- uuid
|
||||
type: object
|
||||
type: array
|
||||
required:
|
||||
- pools
|
||||
type: object
|
||||
served: true
|
||||
storage: true
|
||||
status:
|
||||
acceptedNames:
|
||||
kind: ""
|
||||
plural: ""
|
||||
conditions: []
|
||||
storedVersions: []
|
||||
Loading…
Add table
Add a link
Reference in a new issue