kind: CustomResourceDefinition
spec:
  group: trino.stackable.tech
  names:
    kind: TrinoCatalog
    plural: trinocatalogs
    singular: trinocatalog
    categories: []
    shortNames: []
  scope: Namespaced
  versions:
    - name: v1alpha1
      schema:
        openAPIV3Schema:
          type: object
          title: TrinoCatalog
          required:
            - spec
          properties:
            spec:
              type: object
              required:
                - connector
              properties:
                connector:
                  type: object
                  oneOf:
                    - required:
                        - blackHole
                    - required:
                        - deltaLake
                    - required:
                        - googleSheet
                    - required:
                        - generic
                    - required:
                        - hive
                    - required:
                        - iceberg
                    - required:
                        - tpcds
                    - required:
                        - tpch
                  properties:
                    hive:
                      type: object
                      required:
                        - metastore
                      properties:
                        s3:
                          type: object
                          oneOf:
                            - required:
                                - inline
                            - required:
                                - reference
                          nullable: true
                          properties:
                            inline:
                              type: object
                              required:
                                - host
                              properties:
                                tls:
                                  type: object
                                  nullable: true
                                  required:
                                    - verification
                                  properties:
                                    verification:
                                      type: object
                                      oneOf:
                                        - required:
                                            - none
                                        - required:
                                            - server
                                      properties:
                                        none:
                                          type: object
                                          description: Use TLS but don't verify certificates.
                                        server:
                                          type: object
                                          required:
                                            - caCert
                                          properties:
                                            caCert:
                                              type: object
                                              oneOf:
                                                - required:
                                                    - webPki
                                                - required:
                                                    - secretClass
                                              properties:
                                                webPki:
                                                  type: object
                                                  description: >-
                                                    Use TLS and the CA
                                                    certificates trusted by the
                                                    common web browsers to
                                                    verify the server.

                                                    This can be useful when you
                                                    e.g. use public AWS S3 or
                                                    other public available
                                                    services.
                                                secretClass:
                                                  type: string
                                                  description: |-
                                                    Name of the [SecretClass](https://docs.stackable.tech/home/26.3/secret-operator/secretclass) which will provide the CA certificate.
                                                    Note that a SecretClass does not need to have a key but can also work with just a CA certificate,
                                                    so if you got provided with a CA cert but don't have access to the key you can still use this method.
                                              description: CA cert to verify the server.
                                          description: Use TLS and a CA certificate to verify the server.
                                      description: The verification method used to verify the certificates of the
                                        server and/or the client.
                                  description: Use a TLS connection. If not specified no TLS will be used.
                                host:
                                  type: string
                                  description: "Host of the S3 server without any protocol or port. For example:
                                    `west1.my-cloud.com`."
                                port:
                                  type: integer
                                  format: uint16
                                  maximum: 65535
                                  minimum: 0
                                  nullable: true
                                  description: >-
                                    Port the S3 server listens on.

                                    If not specified the product will determine
                                    the port to use.
                                region:
                                  type: object
                                  default:
                                    name: us-east-1
                                  properties:
                                    name:
                                      type: string
                                      default: us-east-1
                                  description: >-
                                    Bucket region used for signing headers
                                    (sigv4).


                                    This defaults to `us-east-1` which is
                                    compatible with other implementations such
                                    as Minio.


                                    WARNING: Some products use the Hadoop S3
                                    implementation which falls back to
                                    us-east-2.
                                accessStyle:
                                  enum:
                                    - Path
                                    - VirtualHosted
                                  type: string
                                  default: VirtualHosted
                                  description: |-
                                    Which access style to use.
                                    Defaults to virtual hosted-style as most of the data products out there.
                                    Have a look at the [AWS documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html).
                                credentials:
                                  type: object
                                  nullable: true
                                  required:
                                    - secretClass
                                  properties:
                                    scope:
                                      type: object
                                      nullable: true
                                      properties:
                                        pod:
                                          type: boolean
                                          default: false
                                          description: >-
                                            The pod scope is resolved to the
                                            name of the Kubernetes Pod.

                                            This allows the secret to
                                            differentiate between StatefulSet
                                            replicas.
                                        node:
                                          type: boolean
                                          default: false
                                          description: >-
                                            The node scope is resolved to the
                                            name of the Kubernetes Node object
                                            that the Pod is running on.

                                            This will typically be the DNS name
                                            of the node.
                                        services:
                                          type: array
                                          items:
                                            type: string
                                          default: []
                                          description: >-
                                            The service scope allows Pod objects
                                            to specify custom scopes.

                                            This should typically correspond to
                                            Service objects that the Pod
                                            participates in.
                                        listenerVolumes:
                                          type: array
                                          items:
                                            type: string
                                          default: []
                                          description: >-
                                            The listener volume scope allows
                                            Node and Service scopes to be
                                            inferred from the applicable
                                            listeners.

                                            This must correspond to Volume names
                                            in the Pod that mount Listeners.
                                      description: |-
                                        [Scope](https://docs.stackable.tech/home/26.3/secret-operator/scope) of the
                                        [SecretClass](https://docs.stackable.tech/home/26.3/secret-operator/secretclass).
                                    secretClass:
                                      type: string
                                      description: "[SecretClass](https://docs.stackable.tech/home/26.3/secret-operat\
                                        or/secretclass) containing the LDAP bind
                                        credentials."
                                  description: |-
                                    If the S3 uses authentication you have to specify you S3 credentials.
                                    In the most cases a [SecretClass](https://docs.stackable.tech/home/26.3/secret-operator/secretclass)
                                    providing `accessKey` and `secretKey` is sufficient.
                              description: |-
                                S3 connection definition as a resource.
                                Learn more on the [S3 concept documentation](https://docs.stackable.tech/home/26.3/concepts/s3).
                            reference:
                              type: string
                          description: |-
                            Connection to an S3 store.
                            Please make sure that the underlying Hive metastore also has access to the S3 store.
                            Learn more about S3 configuration in the [S3 concept docs](https://docs.stackable.tech/home/26.3/concepts/s3).
                        hdfs:
                          type: object
                          nullable: true
                          required:
                            - configMap
                          properties:
                            configMap:
                              type: string
                              description: Name of the [discovery
                                ConfigMap](https://docs.stackable.tech/home/26.3/concepts/service_discovery)
                                providing information about the HDFS cluster.
                          description: >-
                            Connection to an HDFS cluster.

                            Please make sure that the underlying Hive metastore
                            also has access to the HDFS.
                        metastore:
                          type: object
                          required:
                            - configMap
                          properties:
                            configMap:
                              type: string
                              description: Name of the [discovery
                                ConfigMap](https://docs.stackable.tech/home/26.3/concepts/service_discovery)
                                providing information about the Hive metastore.
                          description: Mandatory connection to a Hive Metastore, which will be used as a
                            storage for metadata.
                      description: An [Apache
                        Hive](https://docs.stackable.tech/home/26.3/trino/usage-guide/catalogs/hive)
                        connector.
                    tpch:
                      type: object
                      description: A
                        [TPC-H](https://docs.stackable.tech/home/26.3/trino/usage-guide/catalogs/tpch)
                        connector.
                    tpcds:
                      type: object
                      description: A
                        [TPC-DS](https://docs.stackable.tech/home/26.3/trino/usage-guide/catalogs/tpcds)
                        connector.
                    generic:
                      type: object
                      required:
                        - connectorName
                      properties:
                        properties:
                          type: object
                          default: {}
                          description: >-
                            A map of properties to put in the connector
                            configuration file.

                            They can be specified either as a raw value or be
                            read from a Secret or ConfigMap.
                          additionalProperties:
                            type: object
                            oneOf:
                              - required:
                                  - value
                              - required:
                                  - valueFromSecret
                              - required:
                                  - valueFromConfigMap
                            properties:
                              value:
                                type: string
                              valueFromSecret:
                                type: object
                                required:
                                  - key
                                  - name
                                properties:
                                  key:
                                    type: string
                                    description: The key of the secret to select from.  Must be a valid secret key.
                                  name:
                                    type: string
                                    description: "Name of the referent. This field is effectively required, but due
                                      to backwards compatibility is allowed to
                                      be empty. Instances of this type with an
                                      empty value here are almost certainly
                                      wrong. More info:
                                      https://kubernetes.io/docs/concepts/overv\
                                      iew/working-with-objects/names/#names"
                                  optional:
                                    type: boolean
                                    description: Specify whether the Secret or its key must be defined
                                description: SecretKeySelector selects a key of a Secret.
                              valueFromConfigMap:
                                type: object
                                required:
                                  - key
                                  - name
                                properties:
                                  key:
                                    type: string
                                    description: The key to select.
                                  name:
                                    type: string
                                    description: "Name of the referent. This field is effectively required, but due
                                      to backwards compatibility is allowed to
                                      be empty. Instances of this type with an
                                      empty value here are almost certainly
                                      wrong. More info:
                                      https://kubernetes.io/docs/concepts/overv\
                                      iew/working-with-objects/names/#names"
                                  optional:
                                    type: boolean
                                    description: Specify whether the ConfigMap or its key must be defined
                                description: Selects a key from a ConfigMap.
                        connectorName:
                          type: string
                          description: |-
                            Name of the Trino connector.
                            Will be passed to `connector.name`.
                      description: A
                        [generic](https://docs.stackable.tech/home/26.3/trino/usage-guide/catalogs/generic)
                        connector.
                    iceberg:
                      type: object
                      properties:
                        s3:
                          type: object
                          oneOf:
                            - required:
                                - inline
                            - required:
                                - reference
                          nullable: true
                          properties:
                            inline:
                              type: object
                              required:
                                - host
                              properties:
                                tls:
                                  type: object
                                  nullable: true
                                  required:
                                    - verification
                                  properties:
                                    verification:
                                      type: object
                                      oneOf:
                                        - required:
                                            - none
                                        - required:
                                            - server
                                      properties:
                                        none:
                                          type: object
                                          description: Use TLS but don't verify certificates.
                                        server:
                                          type: object
                                          required:
                                            - caCert
                                          properties:
                                            caCert:
                                              type: object
                                              oneOf:
                                                - required:
                                                    - webPki
                                                - required:
                                                    - secretClass
                                              properties:
                                                webPki:
                                                  type: object
                                                  description: >-
                                                    Use TLS and the CA
                                                    certificates trusted by the
                                                    common web browsers to
                                                    verify the server.

                                                    This can be useful when you
                                                    e.g. use public AWS S3 or
                                                    other public available
                                                    services.
                                                secretClass:
                                                  type: string
                                                  description: |-
                                                    Name of the [SecretClass](https://docs.stackable.tech/home/26.3/secret-operator/secretclass) which will provide the CA certificate.
                                                    Note that a SecretClass does not need to have a key but can also work with just a CA certificate,
                                                    so if you got provided with a CA cert but don't have access to the key you can still use this method.
                                              description: CA cert to verify the server.
                                          description: Use TLS and a CA certificate to verify the server.
                                      description: The verification method used to verify the certificates of the
                                        server and/or the client.
                                  description: Use a TLS connection. If not specified no TLS will be used.
                                host:
                                  type: string
                                  description: "Host of the S3 server without any protocol or port. For example:
                                    `west1.my-cloud.com`."
                                port:
                                  type: integer
                                  format: uint16
                                  maximum: 65535
                                  minimum: 0
                                  nullable: true
                                  description: >-
                                    Port the S3 server listens on.

                                    If not specified the product will determine
                                    the port to use.
                                region:
                                  type: object
                                  default:
                                    name: us-east-1
                                  properties:
                                    name:
                                      type: string
                                      default: us-east-1
                                  description: >-
                                    Bucket region used for signing headers
                                    (sigv4).


                                    This defaults to `us-east-1` which is
                                    compatible with other implementations such
                                    as Minio.


                                    WARNING: Some products use the Hadoop S3
                                    implementation which falls back to
                                    us-east-2.
                                accessStyle:
                                  enum:
                                    - Path
                                    - VirtualHosted
                                  type: string
                                  default: VirtualHosted
                                  description: |-
                                    Which access style to use.
                                    Defaults to virtual hosted-style as most of the data products out there.
                                    Have a look at the [AWS documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html).
                                credentials:
                                  type: object
                                  nullable: true
                                  required:
                                    - secretClass
                                  properties:
                                    scope:
                                      type: object
                                      nullable: true
                                      properties:
                                        pod:
                                          type: boolean
                                          default: false
                                          description: >-
                                            The pod scope is resolved to the
                                            name of the Kubernetes Pod.

                                            This allows the secret to
                                            differentiate between StatefulSet
                                            replicas.
                                        node:
                                          type: boolean
                                          default: false
                                          description: >-
                                            The node scope is resolved to the
                                            name of the Kubernetes Node object
                                            that the Pod is running on.

                                            This will typically be the DNS name
                                            of the node.
                                        services:
                                          type: array
                                          items:
                                            type: string
                                          default: []
                                          description: >-
                                            The service scope allows Pod objects
                                            to specify custom scopes.

                                            This should typically correspond to
                                            Service objects that the Pod
                                            participates in.
                                        listenerVolumes:
                                          type: array
                                          items:
                                            type: string
                                          default: []
                                          description: >-
                                            The listener volume scope allows
                                            Node and Service scopes to be
                                            inferred from the applicable
                                            listeners.

                                            This must correspond to Volume names
                                            in the Pod that mount Listeners.
                                      description: |-
                                        [Scope](https://docs.stackable.tech/home/26.3/secret-operator/scope) of the
                                        [SecretClass](https://docs.stackable.tech/home/26.3/secret-operator/secretclass).
                                    secretClass:
                                      type: string
                                      description: "[SecretClass](https://docs.stackable.tech/home/26.3/secret-operat\
                                        or/secretclass) containing the LDAP bind
                                        credentials."
                                  description: |-
                                    If the S3 uses authentication you have to specify you S3 credentials.
                                    In the most cases a [SecretClass](https://docs.stackable.tech/home/26.3/secret-operator/secretclass)
                                    providing `accessKey` and `secretKey` is sufficient.
                              description: |-
                                S3 connection definition as a resource.
                                Learn more on the [S3 concept documentation](https://docs.stackable.tech/home/26.3/concepts/s3).
                            reference:
                              type: string
                          description: |-
                            Connection to an S3 store.
                            Please make sure that the underlying Hive metastore also has access to the S3 store.
                            Learn more about S3 configuration in the [S3 concept docs](https://docs.stackable.tech/home/26.3/concepts/s3).
                        hdfs:
                          type: object
                          nullable: true
                          required:
                            - configMap
                          properties:
                            configMap:
                              type: string
                              description: Name of the [discovery
                                ConfigMap](https://docs.stackable.tech/home/26.3/concepts/service_discovery)
                                providing information about the HDFS cluster.
                          description: >-
                            Connection to an HDFS cluster.

                            Please make sure that the underlying Hive metastore
                            also has access to the HDFS.
                        metastore:
                          type: object
                          nullable: true
                          required:
                            - configMap
                          properties:
                            configMap:
                              type: string
                              description: Name of the [discovery
                                ConfigMap](https://docs.stackable.tech/home/26.3/concepts/service_discovery)
                                providing information about the Hive metastore.
                          description: >-
                            Optional connection to a Hive Metastore, which will
                            be used as a storage for metadata.


                            The connection is optional, as Iceberg also supports
                            other catalogs, such as a REST catalog,

                            which (currently) can only be added using
                            configOverrides.
                      description: An [Apache
                        Iceberg](https://docs.stackable.tech/home/26.3/trino/usage-guide/catalogs/iceberg)
                        connector.
                    blackHole:
                      type: object
                      description: A [Black
                        Hole](https://docs.stackable.tech/home/26.3/trino/usage-guide/catalogs/black-hole)
                        connector.
                    deltaLake:
                      type: object
                      required:
                        - metastore
                      properties:
                        s3:
                          type: object
                          oneOf:
                            - required:
                                - inline
                            - required:
                                - reference
                          nullable: true
                          properties:
                            inline:
                              type: object
                              required:
                                - host
                              properties:
                                tls:
                                  type: object
                                  nullable: true
                                  required:
                                    - verification
                                  properties:
                                    verification:
                                      type: object
                                      oneOf:
                                        - required:
                                            - none
                                        - required:
                                            - server
                                      properties:
                                        none:
                                          type: object
                                          description: Use TLS but don't verify certificates.
                                        server:
                                          type: object
                                          required:
                                            - caCert
                                          properties:
                                            caCert:
                                              type: object
                                              oneOf:
                                                - required:
                                                    - webPki
                                                - required:
                                                    - secretClass
                                              properties:
                                                webPki:
                                                  type: object
                                                  description: >-
                                                    Use TLS and the CA
                                                    certificates trusted by the
                                                    common web browsers to
                                                    verify the server.

                                                    This can be useful when you
                                                    e.g. use public AWS S3 or
                                                    other public available
                                                    services.
                                                secretClass:
                                                  type: string
                                                  description: |-
                                                    Name of the [SecretClass](https://docs.stackable.tech/home/26.3/secret-operator/secretclass) which will provide the CA certificate.
                                                    Note that a SecretClass does not need to have a key but can also work with just a CA certificate,
                                                    so if you got provided with a CA cert but don't have access to the key you can still use this method.
                                              description: CA cert to verify the server.
                                          description: Use TLS and a CA certificate to verify the server.
                                      description: The verification method used to verify the certificates of the
                                        server and/or the client.
                                  description: Use a TLS connection. If not specified no TLS will be used.
                                host:
                                  type: string
                                  description: "Host of the S3 server without any protocol or port. For example:
                                    `west1.my-cloud.com`."
                                port:
                                  type: integer
                                  format: uint16
                                  maximum: 65535
                                  minimum: 0
                                  nullable: true
                                  description: >-
                                    Port the S3 server listens on.

                                    If not specified the product will determine
                                    the port to use.
                                region:
                                  type: object
                                  default:
                                    name: us-east-1
                                  properties:
                                    name:
                                      type: string
                                      default: us-east-1
                                  description: >-
                                    Bucket region used for signing headers
                                    (sigv4).


                                    This defaults to `us-east-1` which is
                                    compatible with other implementations such
                                    as Minio.


                                    WARNING: Some products use the Hadoop S3
                                    implementation which falls back to
                                    us-east-2.
                                accessStyle:
                                  enum:
                                    - Path
                                    - VirtualHosted
                                  type: string
                                  default: VirtualHosted
                                  description: |-
                                    Which access style to use.
                                    Defaults to virtual hosted-style as most of the data products out there.
                                    Have a look at the [AWS documentation](https://docs.aws.amazon.com/AmazonS3/latest/userguide/VirtualHosting.html).
                                credentials:
                                  type: object
                                  nullable: true
                                  required:
                                    - secretClass
                                  properties:
                                    scope:
                                      type: object
                                      nullable: true
                                      properties:
                                        pod:
                                          type: boolean
                                          default: false
                                          description: >-
                                            The pod scope is resolved to the
                                            name of the Kubernetes Pod.

                                            This allows the secret to
                                            differentiate between StatefulSet
                                            replicas.
                                        node:
                                          type: boolean
                                          default: false
                                          description: >-
                                            The node scope is resolved to the
                                            name of the Kubernetes Node object
                                            that the Pod is running on.

                                            This will typically be the DNS name
                                            of the node.
                                        services:
                                          type: array
                                          items:
                                            type: string
                                          default: []
                                          description: >-
                                            The service scope allows Pod objects
                                            to specify custom scopes.

                                            This should typically correspond to
                                            Service objects that the Pod
                                            participates in.
                                        listenerVolumes:
                                          type: array
                                          items:
                                            type: string
                                          default: []
                                          description: >-
                                            The listener volume scope allows
                                            Node and Service scopes to be
                                            inferred from the applicable
                                            listeners.

                                            This must correspond to Volume names
                                            in the Pod that mount Listeners.
                                      description: |-
                                        [Scope](https://docs.stackable.tech/home/26.3/secret-operator/scope) of the
                                        [SecretClass](https://docs.stackable.tech/home/26.3/secret-operator/secretclass).
                                    secretClass:
                                      type: string
                                      description: "[SecretClass](https://docs.stackable.tech/home/26.3/secret-operat\
                                        or/secretclass) containing the LDAP bind
                                        credentials."
                                  description: |-
                                    If the S3 uses authentication you have to specify you S3 credentials.
                                    In the most cases a [SecretClass](https://docs.stackable.tech/home/26.3/secret-operator/secretclass)
                                    providing `accessKey` and `secretKey` is sufficient.
                              description: |-
                                S3 connection definition as a resource.
                                Learn more on the [S3 concept documentation](https://docs.stackable.tech/home/26.3/concepts/s3).
                            reference:
                              type: string
                          description: |-
                            Connection to an S3 store.
                            Please make sure that the underlying Hive metastore also has access to the S3 store.
                            Learn more about S3 configuration in the [S3 concept docs](https://docs.stackable.tech/home/26.3/concepts/s3).
                        hdfs:
                          type: object
                          nullable: true
                          required:
                            - configMap
                          properties:
                            configMap:
                              type: string
                              description: Name of the [discovery
                                ConfigMap](https://docs.stackable.tech/home/26.3/concepts/service_discovery)
                                providing information about the HDFS cluster.
                          description: >-
                            Connection to an HDFS cluster.

                            Please make sure that the underlying Hive metastore
                            also has access to the HDFS.
                        metastore:
                          type: object
                          required:
                            - configMap
                          properties:
                            configMap:
                              type: string
                              description: Name of the [discovery
                                ConfigMap](https://docs.stackable.tech/home/26.3/concepts/service_discovery)
                                providing information about the Hive metastore.
                          description: Mandatory connection to a Hive Metastore, which will be used as a
                            storage for metadata.
                      description: An [Delta
                        Lake](https://docs.stackable.tech/home/26.3/trino/usage-guide/catalogs/delta-lake)
                        connector.
                    googleSheet:
                      type: object
                      required:
                        - credentialsSecret
                        - metadataSheetId
                      properties:
                        cache:
                          type: object
                          nullable: true
                          properties:
                            sheetsDataMaxCacheSize:
                              type: string
                              nullable: true
                              description: Maximum number of spreadsheets to cache, defaults to 1000.
                            sheetsDataExpireAfterWrite:
                              type: string
                              nullable: true
                              description: How long to cache spreadsheet data or metadata, defaults to `5m`.
                          description: >-
                            Cache the contents of sheets.

                            This is used to reduce Google Sheets API usage and
                            latency.
                        metadataSheetId:
                          type: string
                          description: Sheet ID of the spreadsheet, that contains the table mapping.
                        credentialsSecret:
                          type: string
                          description: |-
                            The Secret containing the Google API JSON key file.
                            The key used from the Secret is `credentials`.
                      description: A [Google
                        sheets](https://docs.stackable.tech/home/26.3/trino/usage-guide/catalogs/google-sheets)
                        connector.
                  description: The `connector` defines which connector is used.
                configOverrides:
                  type: object
                  default: {}
                  description: >-
                    The `configOverrides` allow overriding arbitrary Trino
                    settings.

                    For example, for Hive you could add
                    `hive.metastore.username: trino`.
                  additionalProperties:
                    type: string
                experimentalConfigRemovals:
                  type: array
                  items:
                    type: string
                  default: []
                  description: >-
                    List of config properties which should be removed.


                    This is helpful, because Trino fails to start in case you
                    have any unused config

                    properties. The removals are executed after the
                    `configOverrides`.


                    This field is experimental, and might be replaced by a more
                    generic mechanism to edit config properties
              description: |-
                The TrinoCatalog resource can be used to define catalogs in Kubernetes objects.
                Read more about it in the [Trino operator concept docs](https://docs.stackable.tech/home/26.3/trino/concepts)
                and the [Trino operator usage guide](https://docs.stackable.tech/home/26.3/trino/usage-guide/catalogs/).
                The documentation also contains a list of all the supported backends.
          description: Auto-generated derived type for TrinoCatalogSpec via `CustomResource`
      served: true
      storage: true
      subresources: {}
      additionalPrinterColumns: []
metadata:
  name: trinocatalogs.trino.stackable.tech
apiVersion: apiextensions.k8s.io/v1
