apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: dnsrecordsets.demos.fearofoblivion.com
spec:
  scope: Cluster
  group: demos.fearofoblivion.com
  names:
    plural: dnsrecordsets
    singular: dnsrecordset
    kind: DnsRecordset
  versions:
    - name: v1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          description: "A set of credentials to access Azure DNS"
          properties:
            spec:
              type: object
              properties:
                dnsZone:
                  type: string
                aRecords:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      ttlSecs:
                        type: integer
                        default: 3600
                      ipAddresses:
                        type: array
                        items:
                          type: string
                          pattern: "^([0-9]{1,3}.){3}[0-9]{1,3}$"
                txtRecords:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      ttlSecs:
                        type: integer
                        default: 3600
                      values:
                        type: array
                        items:
                          type: string
                cnameRecords:
                  type: array
                  items:
                    type: object
                    properties:
                      name:
                        type: string
                      ttlSecs:
                        type: integer
                        default: 3600
                      alias:
                        type: string