apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: partitions.fluvio.infinyon.com
spec:
  group: fluvio.infinyon.com
  scope: Namespaced
  names:
    kind: Partition
    plural: partitions
    singular: partition
  versions:
    - name: v1
      served: true
      storage:  true
      schema:
        openAPIV3Schema:
          type: object
          required: ["spec"]
          properties:
            spec:
              type: object
              required: ["leader", "replicas"]
              properties:
                leader:
                  type: integer
                replicas:
                  type: array
                  items:
                    type: integer
                cleanupPolicy:
                  type: object
                  properties:
                    segment:
                      type: object
                      properties:
                        timeInSeconds:
                          type: integer
                          minimum: 10
                storage:
                  type: object
                  properties:
                    segmentSize:
                      type: integer
                      minimum: 1024
                compressionType:
                  type: string
                  enum:
                    - Any
                    - Gzip
                    - Snappy
                    - Lz4
            status:
              type: object
              x-kubernetes-preserve-unknown-fields: true
      subresources:
        status: {}
      additionalPrinterColumns:
      - name: Leader
        type: integer
        format: int32
        description: Spu Id
        jsonPath: .spec.leader
      - name: Followers
        type: string
        description: Followers
        jsonPath: .spec.replicas
      - name: Status
        type: string
        description: Partition Status
        jsonPath: .status.resolution
      - name: Deleting
        type: boolean
        description: Being deleted
        jsonPath: .status.isBeingDeleted
      - name: LSR
        type: integer
        format: int32
        description: Live Replicas
        jsonPath: .status.lsr
      - name: HW
        type: integer
        format: int64
        description: Leader High Watermark
        jsonPath: .status.leader.hw
      - name: EOF
        type: integer
        format: int64
        description: Leader End Offset
        jsonPath: .status.leader.leo
      - name: Follower Offsets
        type: string
        description: Follower Offsets
        jsonPath: .status.replicas
    
