apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: spugroups.fluvio.infinyon.com
spec:
  group: fluvio.infinyon.com
  scope: Namespaced
  names:
    kind: SpuGroup
    plural: spugroups
    singular: spugroup
    shortNames:
      - spg
  versions:
    - name: v1
      served: true
      storage:  true
      subresources:
          status: {}
      schema:
        openAPIV3Schema:
          required: ["spec"]
          type: object
          properties:
            status:
              type: object
              x-kubernetes-preserve-unknown-fields: true
            spec:
              type: object
              required: ["replicas"]
              properties:
                replicas:
                  type: integer
                  minimum: 1
                  maximum: 100
                minId:
                  type: integer
                  minimum: 0
                  maximum: 99999
                template:
                  type: object
                  required: ["spec"]
                  properties:
                    spec:
                      type: object
                      properties:
                        rack:
                          type: string                  
                        publicEndpoint:
                          type: object
                          properties:
                            port:
                              type: integer
                            encryption:
                              type: string
                              enum:
                                - PLAINTEXT
                                - SSL
                        privateEndpoint:
                          type: object
                          properties:
                            port:
                              type: integer
                            encryption:
                              type: string
                              enum:
                                - PLAINTEXT
                                - SSL
                        controllerSvc:
                          type: object
                          properties:
                            host:
                              type: integer
                            encryption:
                              type: string
                              enum:
                                - PLAINTEXT
                                - SSL
                        replication:
                          type: object
                          properties:
                            inSyncReplicaMin:
                              type: integer
                              minimum: 1
                        storage:
                          type: object
                          properties:
                            logDir:
                              type: string
                            size:
                              type: string
                        env:
                          type: array
                          items:
                            type: object
                            properties:
                              name:
                                type: string
                              value:
                                type: string

