apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  # name must match the spec fields below, and be in the form: <plural>.<group>
  name: domains.oauth2gateway.jberger.github.io
spec:
  # group name to use for REST API: /apis/<group>/<version>
  group: oauth2gateway.jberger.github.io
  # list of versions supported by this CustomResourceDefinition
  versions:
    - name: v1alpha1
      # Each version can be enabled/disabled by Served flag.
      served: true
      # One and only one version must be marked as the storage version.
      storage: true
      # subresources describes the subresources for custom resources.
      subresources:
        # status enables the status subresource.
        status: {}
      schema:
        openAPIV3Schema:
          type: object
          required:
            - spec
          properties:
            spec:
              type: object
              required:
                - gateway
                - host
              properties:
                gateway:
                  type: string
                host:
                  type: string
                tlsSecretName:
                  type: string
                oauth2Path:
                  type: string
                  default: /oauth2
                ingressAnnotations:
                  type: object
                  additionalProperties: true
                  default: {}
                paths:
                  type: array
                  items:
                    type: object
                    required:
                      - path
                      - service
                    properties:
                      path:
                        type: string
                      service:
                        type: object
                        required:
                          - name
                        properties:
                          name:
                            type: string
                          port:
                            type: integer
            status:
              type: object
  # either Namespaced or Cluster
  scope: Namespaced
  names:
    # plural name to be used in the URL: /apis/<group>/<version>/<plural>
    plural: domains
    # singular name to be used as an alias on the CLI and for display
    singular: domain
    # kind is normally the CamelCased singular type. Your resource manifests use this.
    kind: Domain
    # shortNames allow shorter string to match your resource on the CLI
    shortNames:
    - dom

