apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: externalippools.crd.antrea.io
  labels:
    app: antrea
spec:
  group: crd.antrea.io
  versions:
    - name: v1alpha2
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          required:
            - spec
          properties:
            spec:
              type: object
              required:
                - ipRanges
                - nodeSelector
              properties:
                ipRanges:
                  type: array
                  items:
                    type: object
                    oneOf:
                      - required:
                          - cidr
                      - required:
                          - start
                          - end
                    properties:
                      cidr:
                        type: string
                        format: cidr
                      start:
                        type: string
                        oneOf:
                          - format: ipv4
                          - format: ipv6
                      end:
                        type: string
                        oneOf:
                          - format: ipv4
                          - format: ipv6
                nodeSelector:
                  type: object
                  properties:
                    matchExpressions:
                      items:
                        properties:
                          key:
                            type: string
                          operator:
                            enum:
                              - In
                              - NotIn
                              - Exists
                              - DoesNotExist
                            type: string
                          values:
                            items:
                              type: string
                              pattern: "^(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?$"
                            type: array
                        type: object
                      type: array
                    matchLabels:
                      x-kubernetes-preserve-unknown-fields: true
            status:
              type: object
              properties:
                usage:
                  type: object
                  properties:
                    total:
                      type: integer
                    used:
                      type: integer
      additionalPrinterColumns:
        - description: The number of total IPs
          jsonPath: .status.usage.total
          name: Total
          type: integer
        - description: The number of allocated IPs
          jsonPath: .status.usage.used
          name: Used
          type: integer
        - jsonPath: .metadata.creationTimestamp
          name: Age
          type: date
      subresources:
        status: {}
  scope: Cluster
  names:
    plural: externalippools
    singular: externalippool
    kind: ExternalIPPool
    shortNames:
      - eip
