apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: topics.fluvio.infinyon.com
spec:
  group: fluvio.infinyon.com
  scope: Namespaced
  names:
    kind: Topic
    plural: topics
    singular: topic
  versions: 
    - name: v1
      served: true
      storage:  true
      schema:
        openAPIV3Schema:
          type: object
          required: ["spec"]
          properties:
            status:
              type: object
              x-kubernetes-preserve-unknown-fields: true
            spec:
              type: object
              properties:
                type:
                  type: string
                partitions:
                  type: integer
                  minimum: 1
                  maximum: 5000
                replicationFactor:
                  type: integer
                  minimum: 1
                  maximum: 5000
                ignoreRackAssignment:
                  type: boolean
                customReplicaAssignment:
                  type: array
                  items:
                    type: object
                    required:
                    - partition
                    properties:
                      partition:
                        type: object
                        required:
                        - id
                        - replicas
                        properties:
                          id:
                            type: integer
                            minimum: 0
                          replicas:
                            type: array
                            items:
                              type: integer
                              minimum: 0
      subresources:
          status: {}
      additionalPrinterColumns:
          - name: Partitions
            type: integer
            description: Parition count
            jsonPath: .spec.partitions
          - name: Replications
            type: integer
            description: Replication Count
            jsonPath: .spec.replicationFactor
          - name: Status
            type: string
            description: Topic Status
            jsonPath: .status.resolution

                   

