Skip to content

Support custom CA certificates for OTLP endpoints in proxyrunner #4672

Closed

Description

@danbarr

Problem

When the OpenTelemetry collector endpoint uses TLS with a certificate signed by a private/internal CA, there is no way to inject a custom CA certificate into the proxyrunner pod for the OTLP exporter to trust it.

The CRD has CA bundle support for OIDC (spec.oidcConfig.*.caBundleRef), but the telemetry configuration (MCPTelemetryConfig and inline OpenTelemetryConfig) has no equivalent TLS/CA fields. The OTLP exporters in pkg/telemetry/providers/otlp/ only configure Endpoint and Insecure — they don't use WithTLSClientConfig().

Current workaround

Users can use podTemplateSpec to mount a ConfigMap containing the CA cert and set SSL_CERT_FILE via resourceOverrides.proxyDeployment.env. However, SSL_CERT_FILE replaces the entire system CA pool, so the user must concatenate the custom CA with the container's existing system CAs into a single bundle. This is fragile and error-prone.

Proposed solution

Add a caBundleRef field to MCPTelemetryOTelConfig (and optionally the inline OpenTelemetryConfig), reusing the existing CABundleSource type from OIDC. Then:

  1. CRD types: Add CABundleRef *CABundleSource to MCPTelemetryOTelConfig in cmd/thv-operator/api/v1alpha1/mcptelemetryconfig_types.go and to OpenTelemetryConfig in mcpserver_types.go.
  2. Volume mounting: In deploymentForMCPServer(), mount the ConfigMap as a volume following the same pattern as AddOIDCCABundleVolumes() in cmd/thv-operator/pkg/controllerutil/oidc_volumes.go.
  3. Config threading: Pass the CA bundle file path through telemetry.Config → otlp.Config → exporter options.
  4. Exporter TLS: Use otlptracehttp.WithTLSClientConfig() and otlpmetrichttp.WithTLSClientConfig() in pkg/telemetry/providers/otlp/tracing.go and metrics.go.

The building blocks are all there from the OIDC CA bundle implementation — this is primarily wiring the same pattern into the telemetry config path.

Key files

  • CRD types: cmd/thv-operator/api/v1alpha1/mcptelemetryconfig_types.go, mcpserver_types.go
  • OTLP exporters: pkg/telemetry/providers/otlp/tracing.go, metrics.go, config.go
  • Telemetry config: pkg/telemetry/config.go
  • Deployment assembly: cmd/thv-operator/controllers/mcpserver_controller.go
  • Existing pattern to follow: cmd/thv-operator/pkg/controllerutil/oidc_volumes.go
  • Spec-to-config conversion: cmd/thv-operator/pkg/spectoconfig/telemetry.go

Activity

  1. added
    enhancement
    on Apr 8, 2026
  2. added 2 commits that reference this issue on Apr 8, 2026
    21a6fdf
    d8f9345
  3. ChrisJBurns commented on Apr 8, 2026

    @ChrisJBurns
    Collaborator

    I'm picking this up, it's worth noting, we won't do the MCPServer type for OTEL because its deprecated and will be removed by the time we go to v1beta1

  4. added 2 commits that reference this issue on Apr 8, 2026
    58efec6
    4fe97ba
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementkubernetesoperatortelemetry

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions