apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: multiraftclusters.storage.atomix.io
spec:
  group: storage.atomix.io
  names:
    kind: MultiRaftCluster
    listKind: MultiRaftClusterList
    plural: multiraftclusters
    singular: multiraftcluster
  scope: Namespaced
  versions:
  - name: v2beta2
    served: true
    storage: true
    subresources:
      status: {}
    schema:
      openAPIV3Schema:
        type: object
        required:
        - spec
        properties:
          spec:
            type: object
            properties:
              replicas:
                type: integer
                minimum: 1
                default: 1
              groups:
                type: integer
                minimum: 1
                maximum: 1024
                default: 1
              template:
                type: object
                required:
                - spec
                properties:
                  spec:
                    type: object
                    properties:
                      members:
                        type: integer
                        minimum: 1
                      readOnlyMembers:
                        type: integer
                      image:
                        type: string
                      imagePullPolicy:
                        type: string
                      imagePullSecrets:
                        type: array
                        items:
                          type: object
                          required:
                          - name
                          properties:
                            name:
                              type: string
                      securityContext:
                        type: object
                        x-kubernetes-preserve-unknown-fields: true
                      volumeClaimTemplate:
                        x-kubernetes-preserve-unknown-fields: true
                        type: object
                      raftConfig:
                        type: object
                        properties:
                          heartbeatPeriod:
                            type: string
                          electionTimeout:
                            type: string
                          sessionTimeout:
                            type: string
                          snapshotStrategy:
                            type: object
                            properties:
                              type:
                                type: string
                              entryThreshold:
                                type: integer
                          compactionStrategy:
                            type: object
                            properties:
                              type:
                                type: string
                              retainEntries:
                                type: integer
          status:
            type: object
            properties:
              state:
                type: string
                default: NotReady
    additionalPrinterColumns:
    - name: Status
      type: string
      description: The Raft cluster state
      jsonPath: .status.state