apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: mayastorpools.openebs.io
spec:
  group: openebs.io
  versions:
    - name: v1alpha1
      served: true
      storage: true
      subresources:
        status: {}
      schema:
        openAPIV3Schema:
          type: object
          properties:
            apiVersion:
              type: string
            kind:
              type: string
            metadata:
              type: object
            spec:
              description: Specification of the mayastor pool.
              type: object
              required:
              - node
              - disks
              properties:
                node:
                  description: Name of the k8s node where the storage pool is located.
                  type: string
                disks:
                  description: Disk devices (paths or URIs) that should be used for the pool.
                  type: array
                  items:
                    type: string
            status:
              description: Status part updated by the pool controller.
              type: object
              properties:
                spec:
                  type: object
                  properties:
                    node:
                      description: Name of the k8s node where the storage pool is located. (set on creation)
                      type: string
                    disks:
                      description: Disk devices (paths or URIs) that should be used for the pool. (set on creation)
                      type: array
                      items:
                        type: string
                state:
                  description: Pool state.
                  type: string
                reason:
                  description: Reason for the pool state value if applicable.
                  type: string
                disks:
                  description: Disk device URIs that are actually used for the pool.
                  type: array
                  items:
                    type: string
                capacity:
                  description: Capacity of the pool in bytes.
                  type: integer
                  format: int64
                  minimum: 0
                used:
                  description: How many bytes are used in the pool.
                  type: integer
                  format: int64
                  minimum: 0
      additionalPrinterColumns:
      - name: Node
        type: string
        description: Node where the storage pool is located
        jsonPath: .spec.node
      - name: State
        type: string
        description: State of the storage pool
        jsonPath: .status.state
      - name: Age
        type: date
        jsonPath: .metadata.creationTimestamp
  scope: Namespaced
  names:
    kind: MayastorPool
    listKind: MayastorPoolList
    plural: mayastorpools
    singular: mayastorpool
    shortNames: ["msp"]
