apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: cephclusters.ceph.rook.io
spec:
  group: ceph.rook.io
  names:
    kind: CephCluster
    plural: cephclusters
    singular: cephcluster
  scope: Namespaced
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                cephVersion:
                  type: object
                  properties:
                    allowUnsupported:
                      type: boolean
                    image:
                      type: string
                dashboard:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    urlPrefix:
                      type: string
                    port:
                      type: integer
                      minimum: 0
                      maximum: 65535
                    ssl:
                      type: boolean
                dataDirHostPath:
                  pattern: ^/(\S+)
                  type: string
                disruptionManagement:
                  type: object
                  properties:
                    machineDisruptionBudgetNamespace:
                      type: string
                    managePodBudgets:
                      type: boolean
                    osdMaintenanceTimeout:
                      type: integer
                    pgHealthCheckTimeout:
                      type: integer
                    manageMachineDisruptionBudgets:
                      type: boolean
                skipUpgradeChecks:
                  type: boolean
                continueUpgradeAfterChecksEvenIfNotHealthy:
                  type: boolean
                mon:
                  type: object
                  properties:
                    allowMultiplePerNode:
                      type: boolean
                    count:
                      maximum: 9
                      minimum: 0
                      type: integer
                    volumeClaimTemplate:
                      type: object
                      x-kubernetes-preserve-unknown-fields: true
                    stretchCluster:
                      type: object
                      nullable: true
                      properties:
                        failureDomainLabel:
                          type: string
                        subFailureDomain:
                          type: string
                        zones:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              arbiter:
                                type: boolean
                              volumeClaimTemplate:
                                type: object
                                x-kubernetes-preserve-unknown-fields: true
                mgr:
                  type: object
                  properties:
                    modules:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          enabled:
                            type: boolean
                crashCollector:
                  type: object
                  properties:
                    disable:
                      type: boolean
                network:
                  type: object
                  nullable: true
                  properties:
                    hostNetwork:
                      type: boolean
                    provider:
                      type: string
                    selectors:
                      type: object
                      nullable: true
                      x-kubernetes-preserve-unknown-fields: true
                    ipFamily:
                      type: string
                storage:
                  type: object
                  properties:
                    disruptionManagement:
                      type: object
                      nullable: true
                      properties:
                        machineDisruptionBudgetNamespace:
                          type: string
                        managePodBudgets:
                          type: boolean
                        osdMaintenanceTimeout:
                          type: integer
                        pgHealthCheckTimeout:
                          type: integer
                        manageMachineDisruptionBudgets:
                          type: boolean
                    useAllNodes:
                      type: boolean
                    nodes:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          config:
                            type: object
                            nullable: true
                            properties:
                              metadataDevice:
                                type: string
                              storeType:
                                type: string
                                pattern: ^(bluestore)$
                              databaseSizeMB:
                                type: string
                              walSizeMB:
                                type: string
                              journalSizeMB:
                                type: string
                              osdsPerDevice:
                                type: string
                              encryptedDevice:
                                type: string
                                pattern: ^(true|false)$
                          useAllDevices:
                            type: boolean
                          deviceFilter:
                            type: string
                            nullable: true
                          devicePathFilter:
                            type: string
                          devices:
                            type: array
                            items:
                              type: object
                              properties:
                                name:
                                  type: string
                                config:
                                  type: object
                                  nullable: true
                                  x-kubernetes-preserve-unknown-fields: true
                          resources:
                            type: object
                            nullable: true
                            x-kubernetes-preserve-unknown-fields: true
                    useAllDevices:
                      type: boolean
                    deviceFilter:
                      type: string
                      nullable: true
                    devicePathFilter:
                      type: string
                    config:
                      type: object
                      nullable: true
                      x-kubernetes-preserve-unknown-fields: true
                    storageClassDeviceSets:
                      type: array
                      nullable: true
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          count:
                            type: integer
                            format: int32
                          portable:
                            type: boolean
                          tuneDeviceClass:
                            type: boolean
                          tuneFastDeviceClass:
                            type: boolean
                          encrypted:
                            type: boolean
                          schedulerName:
                            type: string
                          config:
                            type: object
                            nullable: true
                            x-kubernetes-preserve-unknown-fields: true
                          placement:
                            type: object
                            nullable: true
                            x-kubernetes-preserve-unknown-fields: true
                          preparePlacement:
                            type: object
                            nullable: true
                            x-kubernetes-preserve-unknown-fields: true
                          resources:
                            type: object
                            nullable: true
                            x-kubernetes-preserve-unknown-fields: true
                          volumeClaimTemplates:
                            type: array
                            items:
                              type: object
                              x-kubernetes-preserve-unknown-fields: true
                driveGroups:
                  type: array
                  nullable: true
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      spec:
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      placement:
                        type: object
                        nullable: true
                        x-kubernetes-preserve-unknown-fields: true
                    required:
                      - name
                      - spec
                monitoring:
                  type: object
                  properties:
                    enabled:
                      type: boolean
                    rulesNamespace:
                      type: string
                    externalMgrEndpoints:
                      type: array
                      items:
                        type: object
                        properties:
                          ip:
                            type: string
                removeOSDsIfOutAndSafeToRemove:
                  type: boolean
                external:
                  type: object
                  properties:
                    enable:
                      type: boolean
                cleanupPolicy:
                  type: object
                  properties:
                    allowUninstallWithVolumes:
                      type: boolean
                    confirmation:
                      type: string
                      pattern: ^$|^yes-really-destroy-data$
                    sanitizeDisks:
                      type: object
                      properties:
                        method:
                          type: string
                          pattern: ^(complete|quick)$
                        dataSource:
                          type: string
                          pattern: ^(zero|random)$
                        iteration:
                          type: integer
                          format: int32
                security:
                  type: object
                  properties:
                    kms:
                      type: object
                      properties:
                        connectionDetails:
                          type: object
                          nullable: true
                          x-kubernetes-preserve-unknown-fields: true
                        tokenSecretName:
                          type: string
                annotations:
                  type: object
                  nullable: true
                  x-kubernetes-preserve-unknown-fields: true
                placement:
                  type: object
                  nullable: true
                  x-kubernetes-preserve-unknown-fields: true
                labels:
                  type: object
                  nullable: true
                  x-kubernetes-preserve-unknown-fields: true
                resources:
                  type: object
                  nullable: true
                  x-kubernetes-preserve-unknown-fields: true
                healthCheck:
                  type: object
                  nullable: true
                  x-kubernetes-preserve-unknown-fields: true
                priorityClassNames:
                  type: object
                  nullable: true
                  x-kubernetes-preserve-unknown-fields: true
            status:
              type: object
              x-kubernetes-preserve-unknown-fields: true
      additionalPrinterColumns:
        - name: DataDirHostPath
          type: string
          description: Directory used on the K8s nodes
          jsonPath: .spec.dataDirHostPath
        - name: MonCount
          type: string
          description: Number of MONs
          jsonPath: .spec.mon.count
        - name: Age
          type: date
          jsonPath: .metadata.creationTimestamp
        - name: Phase
          type: string
          description: Phase
          jsonPath: .status.phase
        - name: Message
          type: string
          description: Message
          jsonPath: .status.message
        - name: Health
          type: string
          description: Ceph Health
          jsonPath: .status.ceph.health
      subresources:
        status: {}
