apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: dittos.iot.eclipse.org
spec:
  group: iot.eclipse.org
  scope: Namespaced
  names:
    plural: dittos
    singular: ditto
    kind: Ditto

  versions:
    - name: v1alpha1
      served: true
      storage: true
      schema:
        openAPIV3Schema:
          type: object
          properties:
            spec:
              type: object
              properties:
                createDefaultUser:
                  type: boolean
                  description: Create the default "ditto" user when initially deploying.
                devopsSecureStatus:
                  type: boolean
                  description: Secure the devops status information.
                version:
                  type: string
                  description: Override the image version of the Ditto images.

                mongoDb:
                  type: object
                  properties:
                    host:
                      type: string
                    port:
                      type: integer
                    database:
                      type: string
                    username:
                      type: string
                    password:
                      x-kubernetes-preserve-unknown-fields: true

                keycloak:
                  type: object
                  properties:
                    url:
                      type: string
                    realm:
                      type: string
                    clientId:
                      x-kubernetes-preserve-unknown-fields: true
                    clientSecret:
                      x-kubernetes-preserve-unknown-fields: true
                    groups:
                      type: array
                      items:
                        type: string
                    label:
                      type: string
                    description:
                      type: string

                openApi:
                  type: object
                  properties:
                    serverLabel:
                      type: string

                internalService:
                  type: object
                  properties:
                    username:
                      type: string
                    password:
                      type: string

            status:
              type: object
              properties:
                phase:
                  type: string
                message:
                  type: string

      subresources:
        status: {}
