---
apiVersion: apiextensions.k8s.io/v1
kind: CustomResourceDefinition
metadata:
  annotations:
    controller-gen.kubebuilder.io/version: v0.20.1
  name: meshopentelemetrybackends.kuma.io
spec:
  group: kuma.io
  names:
    categories:
    - kuma
    kind: MeshOpenTelemetryBackend
    listKind: MeshOpenTelemetryBackendList
    plural: meshopentelemetrybackends
    shortNames:
    - motb
    singular: meshopentelemetrybackend
  scope: Namespaced
  versions:
  - name: v1alpha1
    schema:
      openAPIV3Schema:
        description: |-
          MeshOpenTelemetryBackend defines a shared OTel collector endpoint for observability policies.
          An empty spec is valid and represents the node-local default flow
          (kuma-dp resolves the address at runtime using HOST_IP or 127.0.0.1).
        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: Spec is the specification of the Kuma MeshOpenTelemetryBackend
              resource.
            properties:
              endpoint:
                description: |-
                  Endpoint optionally defines the OTel collector address and port.
                  When omitted, the CP defaults port to 4317 and leaves address empty;
                  kuma-dp resolves the address at runtime using HOST_IP or 127.0.0.1.
                properties:
                  address:
                    description: |-
                      Address of the OTel collector (hostname or IP).
                      When omitted, kuma-dp resolves it at runtime using HOST_IP or 127.0.0.1.
                    type: string
                  path:
                    description: |-
                      Path is an optional base path prefix for HTTP endpoints.
                      The CP appends signal-specific suffixes (/v1/traces, /v1/metrics, /v1/logs).
                      Non-empty value is rejected by validation when protocol is grpc.
                    type: string
                  port:
                    description: Port of the OTel collector. Defaults to 4317 when
                      omitted.
                    format: int32
                    type: integer
                type: object
              env:
                description: |-
                  Env controls whether standard OTEL exporter env vars participate in the
                  final exporter config for this backend.
                properties:
                  allowSignalOverrides:
                    description: |-
                      AllowSignalOverrides controls whether signal-specific OTEL env vars such
                      as `OTEL_EXPORTER_OTLP_TRACES_*` may diverge from the shared config.
                    type: boolean
                  mode:
                    default: Optional
                    description: Mode controls whether OTEL env vars are ignored,
                      allowed, or required.
                    enum:
                    - Disabled
                    - Optional
                    - Required
                    type: string
                  precedence:
                    default: EnvFirst
                    description: |-
                      Precedence controls whether explicit backend fields or env vars win when
                      both are present for the same field.
                    enum:
                    - ExplicitFirst
                    - EnvFirst
                    type: string
                type: object
              protocol:
                description: |-
                  Protocol selects gRPC or HTTP transport for the collector connection.
                  Defaults to grpc when omitted.
                enum:
                - grpc
                - http
                type: string
            type: object
          status:
            description: Status is the current status of the Kuma MeshOpenTelemetryBackend
              resource.
            properties:
              conditions:
                items:
                  properties:
                    message:
                      description: |-
                        message is a human readable message indicating details about the transition.
                        This may be an empty string.
                      maxLength: 32768
                      type: string
                    reason:
                      description: |-
                        reason contains a programmatic identifier indicating the reason for the condition's last transition.
                        Producers of specific condition types may define expected values and meanings for this field,
                        and whether the values are considered a guaranteed API.
                        The value should be a CamelCase string.
                        This field may not be empty.
                      maxLength: 1024
                      minLength: 1
                      pattern: ^[A-Za-z]([A-Za-z0-9_,:]*[A-Za-z0-9_])?$
                      type: string
                    status:
                      description: status of the condition, one of True, False, Unknown.
                      enum:
                      - "True"
                      - "False"
                      - Unknown
                      type: string
                    type:
                      description: type of condition in CamelCase or in foo.example.com/CamelCase.
                      maxLength: 316
                      pattern: ^([a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*/)?(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])$
                      type: string
                  required:
                  - message
                  - reason
                  - status
                  - type
                  type: object
                type: array
            type: object
        type: object
    served: true
    storage: true
