Repository navigation
Description
Summary
Add opt-in TLS to the operator-wide Redis/Valkey session storage fallback configured through operator.defaultRedis and TOOLHIVE_DEFAULT_REDIS_*.
#6731 added runtime TLS support, and #6767 added per-workload spec.sessionStorage.tls for MCPServer, MCPRemoteProxy, and VirtualMCPServer. The global fallback was explicitly deferred in both PRs. This issue tracks that remaining operator integration, rather than reopening #6730.
Current behavior
Checked upstream main at 1ce13bbbb (v0.54.0):
- Helm exposes only the default Redis address and password Secret reference. It injects
TOOLHIVE_DEFAULT_REDIS_ADDR,TOOLHIVE_DEFAULT_REDIS_SECRET_NAME, andTOOLHIVE_DEFAULT_REDIS_SECRET_KEYinto the operator. DefaultRedisConfigcarries only those values; it cannot represent TLS.- All three workload types build their global-fallback runtime Redis configuration without TLS. Their CA projection helpers currently consume only the workload's own
spec.sessionStorage. - Consequently, a workload relying on the global fallback still connects in plaintext and emits the startup warning. A TLS-only Redis endpoint cannot be used through that fallback.
The existing workaround is to configure spec.sessionStorage with TLS explicitly on each workload. The limitation is also documented in GHSA-cppv-wvj3-6r9j and the scalability documentation.
Expected behavior and scope
- Global configuration: expose optional TLS settings under
operator.defaultRedisand carry them through the operator configuration/environment bridge. Support verified TLS with system roots and a private CA referenced by Secret name/key. The representation must distinguish TLS omitted from TLS enabled with system roots, including Helm rendering of an empty settings object if that syntax is chosen. Do not infer TLS from a port number. - Existing runtime integration: when the global Redis fallback is selected, propagate its TLS settings into the existing proxy session/vMCP configuration for all three workload kinds. Redis-backed rate limiting should continue to share the selected session storage TLS settings through the existing runtime wiring.
- CA projection: mount a referenced CA into the workload container that opens the Redis connection and configure the corresponding runtime file path. Resolve the CA Secret in each workload's namespace, consistent with the existing default Redis password Secret behavior; an operator-local file alone is insufficient.
- Deployment updates: changes to the selected TLS configuration or CA Secret name/key must update the desired workload Deployment without causing a reconciliation loop. Reuse the existing session Redis TLS conversion, projection, and drift handling where practical. Document the restart requirement for changing CA contents under the same Secret reference.
- Compatibility: omitting global TLS preserves the current plaintext behavior and warnings. Explicit per-workload Redis configuration remains authoritative, including an explicitly configured Redis connection without TLS; global TLS must not be mixed into a different per-workload Redis endpoint. Preserve existing address/password precedence, including the parent-chart
global.redis.host/port fallback. - Failure behavior: invalid configured TLS or CA data must fail clearly, with no fallback to plaintext or system roots when a custom CA was explicitly requested. Missing CA Secrets/keys must prevent the workload from starting successfully, consistent with per-workload TLS.
Provider-selection detail to keep separate
The existing paths differ when spec.sessionStorage.provider: memory is explicit: MCPRemoteProxy suppresses the global fallback, while the MCPServer and VirtualMCPServer conversion paths can still select it. This predates TLS. Do not change that behavior incidentally; if effective-configuration reuse requires resolving it, agree on the behavior and track the correction explicitly.
Acceptance criteria
- Helm values, rendered operator settings, and configuration parsing distinguish TLS disabled, verified TLS with system roots, and verified TLS with a custom CA.
- Conversion and Deployment tests cover the global TLS path for MCPServer, MCPRemoteProxy, and VirtualMCPServer, including CA mounts and changes to CA references.
- Tests preserve per-workload Redis override behavior, omitted-global-TLS compatibility, and existing address/password precedence. Unchanged configurations do not produce repeated Deployment updates.
- An operator-created workload connects to a TLS-only Redis instance using a private CA; an untrusted CA fails without a plaintext downgrade. Retain the existing runtime coverage for shared rate-limiter TLS settings.
- Helm documentation and operator architecture/scalability guidance explain global TLS, workload-namespace CA Secret availability, precedence, and restart requirements.
Out of scope
- New CLI flags or another Redis client implementation: runtime TLS already exists.
- mTLS client certificates, live CA reload, Redis topology changes, or changes to embedded authorization-server storage.
- Changing the default to require TLS for existing installations.
Relevant code
deploy/charts/operator/values.yamlandtemplates/deployment.yamlcmd/thv-operator/pkg/controllerutil/defaultredis.goandsession_redis_tls.gocmd/thv-operator/controllers/mcpserver_runconfig.goandmcpremoteproxy_runconfig.gocmd/thv-operator/pkg/vmcpconfig/converter.go- The three workload Deployment builders and their existing session TLS tests
Related: #5595 (global defaults), #6679 (default password propagation), #6730, #6731, #6767.
Activity