apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: topolvmclusters.topolvm.cybozu.com
spec:
  group: topolvm.cybozu.com
  names:
    kind: TopolvmCluster
    plural: topolvmclusters
    singular: topolvmcluster
  scope: Namespaced
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                topolvmVersion:
                  type: string
                deviceClasses:
                  type: array
                  nullable: false
                  items:
                    type: object
                    properties:
                      nodeName:
                        type: string
                      classes:
                        type: array
                        nullable: false
                        items:
                          type: object
                          properties:
                            className:
                              type: string
                            volumeGroup:
                              type: string
                            default:
                              type: boolean
                            devices:
                              type: array
                              nullable: false
                              items:
                                type: object
                                properties:
                                  name:
                                    type: string
                            spareGb:
                              type: integer
                              format: uint64
                            stripe:
                              type: integer
                              format: uint
                            stripeSize:
                              type: string
                              pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
                          required:
                            - className
                            - volumeGroup
                            - devices
                    required:
                      - nodeName
                      - classes
              required:
                - topolvmVersion
                - deviceClasses
            status:
              type: object
              x-kubernetes-preserve-unknown-fields: true
      subresources:
        status: {}