From ef7e22249e485b93a8086c1196d38e047b7e8464 Mon Sep 17 00:00:00 2001 From: blublinsky Date: Mon, 6 Jul 2026 11:58:05 +0100 Subject: [PATCH] OLS-1894 Add ROSA-aware OKP retrieval spec Add spec documentation for ROSA cluster detection and ROSA-specific OKP product filtering. The operator detects ROSA via Console brand and Infrastructure controlPlaneTopology, passing the product identifier as OLS_ROSA_PRODUCT env var to the service. Co-authored-by: Cursor --- .ai/spec/how/config-generation.md | 1 + .ai/spec/how/deployment-generation.md | 2 ++ .ai/spec/what/app-server.md | 9 +++++++++ 3 files changed, 12 insertions(+) diff --git a/.ai/spec/how/config-generation.md b/.ai/spec/how/config-generation.md index f8685f468..90938f988 100644 --- a/.ai/spec/how/config-generation.md +++ b/.ai/spec/how/config-generation.md @@ -209,6 +209,7 @@ These schemas are created by the bootstrap script. | TLS certs | Service-ca operator or user-provided secret | Path: `/etc/certs/lightspeed-tls/` | | BYOK RAG indexes | CR `spec.ols.rag[]` | File paths in config YAML (BYOK only) | | RHOKP image | `--rhokp-image` flag | Image for RHOKP sidecar container | +| ROSA product | Console brand + Infrastructure topology | `OLS_ROSA_PRODUCT` env var on app-server (not in config YAML). [PLANNED: OLS-1894] | | MCP servers | CR `spec.mcpServers[]` + `spec.ols.introspectionEnabled` | Feature gated by `MCPServer` gate | | Tool filtering | CR `spec.ols.toolFilteringConfig` | Feature gated by `ToolFiltering` gate; requires MCP servers | | Proxy config | CR `spec.ols.proxyConfig` | Proxy URL + optional CA cert configmap | diff --git a/.ai/spec/how/deployment-generation.md b/.ai/spec/how/deployment-generation.md index 150b6b2d6..20d21c230 100644 --- a/.ai/spec/how/deployment-generation.md +++ b/.ai/spec/how/deployment-generation.md @@ -32,6 +32,8 @@ GenerateOLSDeployment(r, cr) 15. Assemble Deployment: - Container: "lightspeed-service-api", image: r.GetAppServerImage(), port: 8443 - Env: OLS_CONFIG_FILE path + proxy vars (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) + - Env: OCP_CLUSTER_VERSION (`.`) when `!byokRAGOnly` + - Env: OLS_ROSA_PRODUCT (ROSA OKP product identifier) when `!byokRAGOnly` AND cluster brand is `ROSA`. Value: `red_hat_openshift_service_on_aws` (HCP) or `red_hat_openshift_service_on_aws_classic_architecture` (Classic), determined from Console brand + Infrastructure controlPlaneTopology. [PLANNED: OLS-1894] - Probes: HTTPS GET on /readiness, /liveness (initial: 30s, period: 30s, timeout: 30s, failure: 15) - Default resources: 500m CPU request, 1Gi memory request (no limits) 16. Apply pod-level config (replicas, nodeSelector, tolerations) diff --git a/.ai/spec/what/app-server.md b/.ai/spec/what/app-server.md index bc33b2314..99dfb2c16 100644 --- a/.ai/spec/what/app-server.md +++ b/.ai/spec/what/app-server.md @@ -21,6 +21,15 @@ The App Server is the backend deployment for OpenShift Lightspeed. It runs the l 12. If `spec.ols.querySystemPrompt` is set, the custom prompt is written as a second key in the config ConfigMap and referenced by file path in the config. 13. BYOK reference content indexes from `spec.ols.rag` are configured when present. OCP documentation is served by OKP via the RHOKP sidecar, not via FAISS indexes. 14. The operator always generates a `solr_hybrid` config section in `olsconfig.yaml` pointing to `http://localhost:8080` with default hybrid retrieval tuning parameters, unless `byokRAGOnly` is true. +15a. Unless `byokRAGOnly` is true, the app-server container receives `OCP_CLUSTER_VERSION` (`.` from the operator's cluster-version lookup) for Solr `chunk_filter_query` resolution in lightspeed-service. + +### ROSA-Aware OKP Retrieval [PLANNED: OLS-1894] +15b. Unless `byokRAGOnly` is true, the operator detects whether the cluster is ROSA and, if so, which variant (Classic vs HCP). Detection uses two standard OpenShift API resources, following the same pattern as OCP version detection — determined once and passed to the service as an environment variable: + - **ROSA detection:** Read `console.operator.openshift.io/v1` Console `cluster` resource, field `.spec.customization.brand`. Value `ROSA` indicates a ROSA cluster (reliable on OCP 4.16+). + - **Variant detection:** Read `infrastructure.config.openshift.io/v1` Infrastructure `cluster` resource, field `.status.controlPlaneTopology`. `External` = HCP, `HighlyAvailable` = Classic. + - When ROSA is detected, the operator sets `OLS_ROSA_PRODUCT` on the app-server container: `red_hat_openshift_service_on_aws` for HCP, `red_hat_openshift_service_on_aws_classic_architecture` for Classic. + - On non-ROSA clusters the env var is absent and the service uses OCP-only retrieval. + - RBAC: requires `get` on `consoles` in the `operator.openshift.io` API group (Infrastructure is already covered by existing cluster-version permissions). ### MCP Server Integration 15. When `spec.ols.introspectionEnabled` is true, an "openshift" MCP server entry is added to the config pointing to localhost on the sidecar port.