apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  name: servicetelemetrys.infra.watch
spec:
  conversion:
    strategy: None
  group: infra.watch
  names:
    plural: servicetelemetrys
    singular: servicetelemetry
    kind: ServiceTelemetry
    listKind: ServiceTelemetryList
    shortNames:
    - stf
  scope: Namespaced
  versions:
  - name: v1beta1
    subresources:
      status: {}
    served: true
    storage: true
    schema:
      openAPIV3Schema:
        description: ServiceTelemetry represents the Service Telemetry Framework resource in a kubernetes cluster.
        properties:
          apiVersion:
            description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
            type: string
          kind:
            description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
            type: string
          metadata:
            type: object
          spec:
            description: ServiceTelemetrySpec holds the specification of an STF instance.
            properties:
              observabilityStrategy:
                description: 'The strategy to use for observability systems. Options are "none" (do not deploy any observability components), and "use_community" (community operators with administrator managed subscriptions).'
                type: string
                enum:
                - use_community
                - none
              alerting:
                properties:
                  enabled:
                    description: Whether to enable alerting functionality
                    type: boolean
                  alertmanager:
                    description: Alertmanager configuration
                    properties:
                      receivers:
                        properties:
                          snmpTraps:
                            properties:
                              enabled:
                                description: Deploy container to send snmp traps
                                type: boolean
                              target:
                                description: Target address for SNMP traps to send to
                                type: string
                            type: object
                        type: object
                      storage:
                        properties:
                          strategy:
                            description: Storage strategy. One of 'ephemeral' or 'persistent'. Persistent storage must be made available by the platform.
                            type: string
                            enum:
                            - ephemeral
                            - persistent
                          persistent:
                            properties:
                              storageClass:
                                description: Storage class name used for Alertmanager PVC
                                type: string
                              storageSelector:
                                description: Storage selector definition for Alertmanager
                                type: string
                              pvcStorageRequest:
                                description: PVC storage requested size for Alertmanager
                                type: string
                            type: object
                        type: object
                    type: object
                type: object
              highAvailability:
                description: High availability related configuration
                properties:
                  enabled:
                    description: Enable high availability globally for Service Telemetry
                    type: boolean
                type: object
              backends:
                description: Backend storage configuration
                properties:
                  metrics:
                    description: Metrics related backend configuration.
                    properties:
                      prometheus:
                        description: Metrics storage backend Prometheus
                        properties:
                          enabled:
                            description: Enable Prometheus as a storage backend for metrics
                            type: boolean
                          scrapeInterval:
                            description: How often Prometheus should be configured to scrape this endpoint. Value in seconds.
                            type: string
                          storage:
                            description: Metrics storage configuration for Prometheus
                            properties:
                              strategy:
                                description: Storage strategy. One of 'ephemeral' or 'persistent'. Persistent storage must be made available by the platform.
                                type: string
                                enum:
                                - ephemeral
                                - persistent
                              retention:
                                description: Time duration Prometheus shall retain data for. Default
                                  is '24h', and must match the regular expression `[0-9]+(ms|s|m|h|d|w|y)`
                                  (milliseconds seconds minutes hours days weeks years).
                                type: string
                                pattern: '^[0-9]+(ms|s|m|h|d|w|y)$'
                              persistent:
                                description: Persistent storage configuration for Prometheus
                                properties:
                                  storageClass:
                                    description: Storage class name used for Prometheus PVC
                                    type: string
                                  storageSelector:
                                    description: Storage selector definition for Prometheus
                                    type: string
                                  pvcStorageRequest:
                                    description: PVC storage requested size for Prometheus
                                    type: string
                                type: object
                            type: object
                        type: object
                    type: object
                  events:
                    description: Events related backend configuration.
                    properties:
                      elasticsearch:
                        description: Events storage backend ElasticSearch
                        properties:
                          enabled:
                            description: Enable ElasticSearch as a storage backend for events
                            type: boolean
                          version:
                            description: Version of ElasticSearch to deploy. Elasticsearch licensing has changed as of version 7.11. See https://www.elastic.co/pricing/faq/licensing for details.
                            type: string
                          nodeCount:
                            description: Elasticsearch node count
                            type: string
                          storage:
                            description: Events storage configuration for ElasticSearch
                            properties:
                              strategy:
                                description: Storage strategy. One of 'ephemeral' or 'persistent'. Persistent storage must be made available by the platform.
                                type: string
                                enum:
                                - ephemeral
                                - persistent
                              persistent:
                                description: Persistent storage configuration for ElasticSearch
                                properties:
                                  storageClass:
                                    description: Storage class name used for ElasticSearch PVC
                                    type: string
                                  storageSelector:
                                    description: Storage selector definition for ElasticSearch
                                    type: string
                                  pvcStorageRequest:
                                    description: How much storage space to request in the PVC
                                    type: string
                                type: object
                            type: object
                        type: object
                    type: object
                  logs:
                    description: Logs related backend configuration.
                    properties:
                      loki:
                        description: Logs storage backend Loki
                        properties:
                          enabled:
                            description: '[TESTING ONLY] Enable Loki as a storage backend for logs'
                            type: boolean
                          replicationFactor:
                            description: Loki replication factor
                            format: int32
                            minimum: 1
                            type: integer
                          flavor:
                            description: Loki flavor
                            enum:
                            - 1x.extra-small
                            - 1x.small
                            - 1x.medium
                            type: string
                          storage:
                            description: Logs storage configuration for Loki
                            properties:
                              objectStorageSecret:
                                description: Secret containing informaiton required for S3 object storage
                                type: string
                              storageClass:
                                description: Storage class used for temporary log storage before they are forwarded to object storage or when querying.
                                type: string
                            type: object
                          compactor:
                            description: Template for the compactor microservice
                            properties:
                              replicas:
                                description: Number of replicas for this microservice
                                type: string
                            type: object
                          distributor:
                            description: Template for the distributor microservice
                            properties:
                              replicas:
                                description: Number of replicas for this microservice
                                type: string
                            type: object
                          ingester:
                            description: Template for the ingester microservice
                            properties:
                              replicas:
                                description: Number of replicas for this microservice
                                type: string
                            type: object
                          querier:
                            description: Template for the querier microservice
                            properties:
                              replicas:
                                description: Number of replicas for this microservice
                                type: string
                            type: object
                          queryFrontend:
                            description: Template for the query frontend microservice
                            properties:
                              replicas:
                                description: Number of replicas for this microservice
                                type: string
                            type: object
                        type: object
                    type: object
                type: object
              transports:
                description: Data transport configuration
                properties:
                  qdr:
                    description: QDR configuration for data transport
                    properties:
                      enabled:
                        description: Enable QDR data transort
                        type: boolean
                      web:
                        description: QDR web configuration
                        properties:
                          enabled:
                            description: Enable web interface for QDR
                            type: boolean
                        type: object
                    type: object
                type: object
              graphing:
                description: Graphing configuration
                properties:
                  enabled:
                    description: Whether the Service Telemetry Operator should deploy a graphing components and setup available datasources. If enabled will use default graphing components.
                    type: boolean
                  grafana:
                    description: Grafana related configuration
                    properties:
                      disableSignoutMenu:
                        description: Whether to disable the Grafana signout menu
                        type: boolean
                      ingressEnabled:
                        description: Enable ingress access to Grafana
                        type: boolean
                      adminPassword:
                        description: Grafana admin password
                        type: string
                        format: password
                      adminUser:
                        description: Grafana admin user
                        type: string
                      baseImage:
                        description: Path to the base container image used to instantiate a Grafana instance
                        type: string
                    type: object
                type: object
              cloudsRemoveOnMissing:
                description: If cloud object is missing from list on subsequent runs then delete the corresponding SmartGateway object. Default is 'true'.
                type: boolean
              clouds:
                description: A list of cloud objects
                items:
                  properties:
                    name:
                      description: Name of the cloud object. Must be alphanumeric and a maximum length of 10 characters.
                      type: string
                      pattern: ^[a-zA-Z0-9]{1,10}$
                    metrics:
                      description: Metrics related configuration for this cloud object.
                      properties:
                        collectors:
                          description: List of available metrics collectors for this cloud object
                          items:
                            properties:
                              collectorType:
                                description: Set the collector type, value of 'ceilometer', 'collectd' or 'sensubility'.
                                type: string
                                enum:
                                - ceilometer
                                - collectd
                                - sensubility
                              subscriptionAddress:
                                description: Address to subscribe on the data transport to receive telemetry.
                                type: string
                              debugEnabled:
                                description: Enable console debugging. Default is 'false'.
                                type: boolean
                              bridge:
                                description: Bridge configuration and tuning configurations.
                                properties:
                                  ringBufferCount:
                                    description: sg-bridge ring buffer count. This affects the potential number of messages in queue, which can result in increased memory usage within the sg-bridge container.
                                    type: integer
                                  ringBufferSize:
                                    description: sg-bridge ring buffer size. This affects the size of messages that can be passed between sg-bridge and sg-core.
                                    type: integer
                                  verbose:
                                    description: Enable verbosity for debugging purposes.
                                    type: boolean
                                type: object
                            type: object
                          type: array
                      type: object
                    events:
                      description: Events related configuration for this cloud object.
                      properties:
                        collectors:
                          description: List of available events collectors for this cloud object.
                          items:
                            properties:
                              collectorType:
                                description: Set the collector type, value of 'ceilometer' or 'collectd'.
                                type: string
                                enum:
                                - ceilometer
                                - collectd
                              subscriptionAddress:
                                description: Address to subscribe on the data transport to receive notifications.
                                type: string
                              debugEnabled:
                                description: Enable console debugging. Default is 'false'.
                                type: boolean
                              bridge:
                                description: Bridge configuration and tuning configurations.
                                properties:
                                  ringBufferCount:
                                    description: sg-bridge ring buffer count. This affects the potential number of messages in queue, which can result in increased memory usage within the sg-bridge container.
                                    type: integer
                                  ringBufferSize:
                                    description: sg-bridge ring buffer size. This affects the size of messages that can be passed between sg-bridge and sg-core.
                                    type: integer
                                  verbose:
                                    description: Enable verbosity for debugging purposes.
                                    type: boolean
                                type: object
                            type: object
                          type: array
                      type: object
                    logs:
                      description: Logs related configuration for this cloud object.
                      properties:
                        collectors:
                          description: List of available logs collectors for this cloud
                            object.
                          items:
                            properties:
                              collectorType:
                                description: Set the collector type, value of 'rsyslog'
                                enum:
                                - rsyslog
                                type: string
                              debugEnabled:
                                description: Enable console debugging. Default is 'false'.
                                type: boolean
                              subscriptionAddress:
                                description: Address to subscribe on the data transport
                                  to receive notifications.
                                type: string
                              bridge:
                                description: Bridge configuration and tuning configurations.
                                properties:
                                  ringBufferCount:
                                    description: sg-bridge ring buffer count. This affects the potential number of messages in queue, which can result in increased memory usage within the sg-bridge container.
                                    type: integer
                                  ringBufferSize:
                                    description: sg-bridge ring buffer size. This affects the size of messages that can be passed between sg-bridge and sg-core.
                                    type: integer
                                  verbose:
                                    description: Enable verbosity for debugging purposes.
                                    type: boolean
                                type: object
                            type: object
                          type: array
                      type: object
                  type: object
                type: array
            type: object
            x-kubernetes-preserve-unknown-fields: true
          status:
            description: Status results of an instance of Service Telemetry
            properties:
              conditions:
                description: The resulting conditions when a Service Telemetry is instantiated
                items:
                  properties:
                    status:
                      type: string
                    type:
                      type: string
                    reason:
                      type: string
                    lastTransitionTime:
                      type: string
                  type: object
                type: array
              ephemeralStorageEnabled:
                description: Whether ephemeral storage is enabled and a warning should be provided
                properties:
                  lastTransitionTime:
                    type: string
                  message:
                    type: string
                  status:
                    type: boolean
                type: object
            type: object
        type: object
