apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: kuryrloadbalancers.openstack.org
spec:
  group: openstack.org
  scope: Namespaced
  names:
    plural: kuryrloadbalancers
    singular: kuryrloadbalancer
    kind: KuryrLoadBalancer
    shortNames:
      - klb
  versions:
  - name: v1
    served: true
    storage: true
    additionalPrinterColumns:
      - name: PROJECT-ID
        type: string
        description: The ID of the PROJECT associated to the loadbalancer
        jsonPath: .spec.project_id
      - name: Age
        type: date
        jsonPath: .metadata.creationTimestamp
    schema:
      openAPIV3Schema:
        type: object
        properties:
          spec:
            type: object
            properties:
              ip:
                type: string
              lb_ip:
                type: string
              ports:
                type: array
                items:
                  type: object
                  required:
                  - port
                  - protocol
                  - targetPort
                  properties:
                    name:
                      type: string
                    port:
                      type: integer
                    protocol:
                      type: string
                    targetPort:
                      type: string
              project_id:
                type: string
              security_groups_ids:
                type: array
                items:
                  type: string
              subnet_id:
                type: string
              type:
                type: string
              subsets:
                type: array
                items:
                  type: object
                  properties:
                    addresses:
                      type: array
                      items:
                        type: object
                        properties:
                          hostname:
                            type: string
                          ip:
                            type: string
                          nodeName:
                            type: string
                          targetRef:
                            type: object
                            properties:
                              apiVersion:
                                type: string
                              kind:
                                type: string
                              name:
                                type: string
                              namespace:
                                type: string
                              resourceVersion:
                                type: string
                              uid:
                                type: string
                    ports:
                      type: array
                      items:
                        type: object
                        properties:
                          name:
                            type: string
                          port:
                            type: integer
                          protocol:
                            type: string
          status:
            type: object
            properties:
              listeners:
                type: array
                items:
                  type: object
                  required:
                  - id
                  - loadbalancer_id
                  - name
                  - port
                  - project_id
                  - protocol
                  properties:
                    id:
                      type: string
                    loadbalancer_id:
                      type: string
                    name:
                      type: string
                    port:
                      type: integer
                    project_id:
                      type: string
                    protocol:
                      type: string
              loadbalancer:
                type: object
                required:
                - id
                - ip
                - name
                - port_id
                - project_id
                - provider
                - security_groups
                - subnet_id
                properties:
                  id:
                    type: string
                  ip:
                    type: string
                  name:
                    type: string
                  port_id:
                    type: string
                  project_id:
                    type: string
                  provider:
                    type: string
                  security_groups:
                    type: array
                    items:
                      type: string
                  subnet_id:
                    type: string
              members:
                type: array
                items:
                  type: object
                  required:
                  - id
                  - ip
                  - name
                  - pool_id
                  - port
                  - project_id
                  - subnet_id
                  properties:
                    id:
                      type: string
                    ip:
                      type: string
                    name:
                      type: string
                    pool_id:
                      type: string
                    port:
                      type: integer
                    project_id:
                      type: string
                    subnet_id:
                      type: string
              pools:
                type: array
                items:
                  type: object
                  required:
                  - id
                  - listener_id
                  - loadbalancer_id
                  - name
                  - project_id
                  - protocol
                  properties:
                    id:
                      type: string
                    listener_id:
                      type: string
                    loadbalancer_id:
                      type: string
                    name:
                      type: string
                    project_id:
                      type: string
                    protocol:
                      type: string
              service_pub_ip_info:
                type: object
                required:
                - ip_id
                - ip_addr
                - alloc_method
                properties:
                  ip_id:
                    type: string
                  ip_addr:
                    type: string
                  alloc_method:
                    type: string
