apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: externaldnss.cis.f5.com
spec:
  group: cis.f5.com
  names:
    kind: ExternalDNS
    plural: externaldnss
    shortNames:
      - edns
    singular: externaldns
  scope: Namespaced
  versions:
    -
      name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                domainName:
                  type: string
                  pattern: '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$'
                dnsRecordType:
                  type: string
                  pattern: 'A'
                loadBalanceMethod:
                  type: string
                pools:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                        pattern: '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$'
                      dataServerName:
                        type: string
                      dnsRecordType:
                        type: string
                        pattern: 'A'
                      loadBalanceMethod:
                        type: string
                      monitor:
                        type: object
                        properties:
                          type:
                            type: string
                            enum: [http, https]
                          send:
                            type: string
                          recv:
                            type: string
                          interval:
                            type: integer
                          timeout:
                            type: integer
                        required:
                          - type
                          - send
                          - interval
                    required:
                      - name
                      - dataServerName
              required:
                - domainName
