You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Default images are stored in a `defaultImages` map in `cmd/main.go` keyed by logical name (e.g., `"lightspeed-service"`, `"postgres-image"`, `"console-plugin"`). Default values come from `internal/relatedimages/` which reads `related_images.json` at build time. Command-line flags override individual images. The map is passed to the reconciler via `OLSConfigReconcilerOptions` as individual named fields (e.g., `LightspeedServiceImage`, `ConsoleUIImage`).
105
+
Default images are stored in a `defaultImages` map in `cmd/main.go` keyed by logical name (e.g., `"lightspeed-service"`, `"postgres-image"`, `"console-plugin"`, `"alerts-adapter"`). Default values come from `internal/relatedimages/` which reads `related_images.json` at build time. Command-line flags override individual images. The map is passed to the reconciler via `OLSConfigReconcilerOptions` as individual named fields (e.g., `LightspeedServiceImage`, `ConsoleUIImage`, `AlertsAdapterImage`).
101
106
102
107
### WatcherConfig
103
108
Declarative configuration for external resource watching. Contains:
|-- checkDeploymentStatus() for each # Collect diagnostics
30
32
+-- UpdateStatusCondition() # Single status update
31
33
```
32
34
33
35
## Key Abstractions
34
36
35
37
### Reconciler Interface
36
-
The `reconciler.Reconciler` interface breaks the circular dependency between the main controller and component packages. Component packages (appserver, postgres, console) receive this interface instead of importing the controller package directly. It embeds `client.Client` and adds getter methods for images, namespace, and OpenShift version.
38
+
The `reconciler.Reconciler` interface breaks the circular dependency between the main controller and component packages. Component packages (appserver, postgres, console, alertsadapter) receive this interface instead of importing the controller package directly. It embeds `client.Client` and adds getter methods for images, namespace, and OpenShift version.
37
39
38
40
### ReconcileSteps Pattern
39
41
Both phases use a slice of `ReconcileSteps` structs, each containing a Name, reconcile function, and (for Phase 2) a ConditionType and Deployment name. Phase 1 iterates with continue-on-error; Phase 2 iterates but tracks all conditions and diagnostics.
@@ -44,7 +46,7 @@ Two ownership models:
44
46
2.**External resources**: Watches() with custom predicates. Annotation-based filtering. Secret/ConfigMap handlers compare data and trigger deployment restarts.
45
47
46
48
### Finalizer Cleanup
47
-
The `finalizeOLSConfig()` method uses `listOwnedResources()` which queries every resource type by owner reference UID (not labels). This is more reliable than label-based cleanup. The wait loop polls with a fixed interval and timeout, using `wait.PollUntilContextTimeout`.
49
+
The `finalizeOLSConfig()` method removes Console UI, deletes alerts adapter cross-namespace RBAC via `alertsadapter.RemoveAlertsAdapter()`, then uses `listOwnedResources()` which queries every resource type by owner reference UID (not labels). This is more reliable than label-based cleanup. The wait loop polls with a fixed interval and timeout, using `wait.PollUntilContextTimeout`.
48
50
49
51
### Status Update Mechanics
50
52
`UpdateStatusCondition()` uses `retry.RetryOnConflict` with `client.MergeFrom` patch. It preserves `LastTransitionTime` for conditions whose status hasn't changed. It re-fetches the CR before each update attempt to get the latest ResourceVersion.
Copy file name to clipboardExpand all lines: .ai/spec/what/bundle-composition.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,8 +36,8 @@ The lightspeed-operator OLM bundle installs both the lightspeed-operator control
36
36
37
37
### Agentic Operand Deployment
38
38
39
-
16.[PLANNED: OLS-3236]The lightspeed-operator deploys the agentic alerts adapter and the agentic console plugin as fully reconciled operands, with Phase 1/2 reconciliation, status conditions, health monitoring, and finalizer cleanup. The agentic-operator does not deploy these operands.
40
-
17.[PLANNED: OLS-3236]Agentic operand images default to `:main` tags until Konflux onboarding provides SHA-pinned productized images. CLI flags (`--alerts-adapter-image`, `--agentic-console-image`) on the lightspeed-operator deployment override the defaults.
39
+
16. The lightspeed-operator reconciles the agentic alerts adapter as a fully managed operand (OLS-3348): Phase 1/2 reconciliation, `AlertsAdapterReady`status condition, health monitoring, and finalizer cleanup for cross-namespace RBAC. The agentic console plugin remains [PLANNED: OLS-3236].
40
+
17. Agentic operand images default to `:main` tags until Konflux onboarding provides SHA-pinned productized images. The `--alerts-adapter-image` flag is implemented on the lightspeed-operator binary; wiring it into the CSV deployment spec is [PLANNED: OLS-3236]. The `--agentic-console-image` flag is [PLANNED: OLS-3236].
41
41
42
42
## Configuration Surface
43
43
@@ -48,7 +48,7 @@ The lightspeed-operator OLM bundle installs both the lightspeed-operator control
48
48
| Agentic controller startup flags | CSV deployment spec args | Operand image overrides for the agentic controller |
@@ -61,4 +61,4 @@ The lightspeed-operator OLM bundle installs both the lightspeed-operator control
61
61
62
62
| Ticket | Summary |
63
63
|---|---|
64
-
| OLS-3236 | Migrate agentic console deployment from agentic-operator to lightspeed-operator. Add alerts-adapter as new operand. Add `--alerts-adapter-image` and `--agentic-console-image`flags to lightspeed-operator CSV deployment. Remove `--agentic-console-image` from agentic-operator CSV deployment. |
64
+
| OLS-3236 | Migrate agentic console deployment from agentic-operator to lightspeed-operator. Wire `--alerts-adapter-image` and `--agentic-console-image`into lightspeed-operator CSV deployment. Remove `--agentic-console-image` from agentic-operator CSV deployment. |
20. Replicas are only user-configurable for the API container (`spec.ols.deployment.api.replicas`). For console, database, alerts adapter, and agentic console, the operator always overrides replicas to 1 regardless of spec value.
@@ -280,7 +280,7 @@ Condition types used by the operator:
280
280
-`ApiReady` -- API server deployment health
281
281
-`CacheReady` -- PostgreSQL cache deployment health
282
282
-`ConsolePluginReady` -- Console UI plugin deployment health
283
-
-`AlertsAdapterReady` -- [PLANNED: OLS-3236]Agentic alerts adapter deployment health
283
+
-`AlertsAdapterReady` -- Agentic alerts adapter deployment health
284
284
-`AgenticConsolePluginReady` -- [PLANNED: OLS-3236] Agentic console plugin deployment health
285
285
-`ResourceReconciliation` -- Overall resource reconciliation status (set directly, not deployment-based)
Copy file name to clipboardExpand all lines: .ai/spec/what/reconciliation.md
+9-9Lines changed: 9 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,16 +17,16 @@ The operator reconciles the OLSConfig CR into Kubernetes resources through a two
17
17
8. Step 6 (Phase 2): Reconcile deployments and dependent resources -- Deployments, Services, TLS certificates, ServiceMonitors, PrometheusRules. After reconciliation, check deployment health and update CR status.
18
18
19
19
### Phase 1: Independent Resources
20
-
9.Five component groups are reconciled in Phase 1: Console UI, PostgreSQL, the application server, the agentic alerts adapter, and the agentic console plugin.
20
+
9.Four component groups are reconciled in Phase 1: Console UI, PostgreSQL, the application server, and the agentic alerts adapter. The agentic console plugin is [PLANNED: OLS-3236].
21
21
10. All Phase 1 resource groups are independent and can be reconciled in any order.
22
22
11. If any Phase 1 resource fails, the operator continues reconciling the remaining resources, then reports all failures in the CR status with ResourceReconciliation conditions.
23
-
11a. Alerts adapter Phase 1 resources: ServiceAccount, ClusterRole (`agentic.openshift.io/proposals`: create, list, get), ClusterRoleBinding, RoleBinding in `openshift-monitoring` (binds SA to `monitoring-alertmanager-view`), NetworkPolicy.
12.Five deployments are reconciled in Phase 2: Console UI (condition: ConsolePluginReady), PostgreSQL (condition: CacheReady), the active backend (condition: ApiReady), the agentic alerts adapter (condition: AlertsAdapterReady), and the agentic console plugin (condition: AgenticConsolePluginReady).
12b. Agentic console Phase 2: Deployment (1 replica, nginx with TLS via service-ca cert), Service (port 9443, serving-cert annotation), ConsolePlugin CR, Console CR activation.
27
+
12.Four deployments are reconciled in Phase 2: Console UI (condition: `ConsolePluginReady`), PostgreSQL (condition: `CacheReady`), the active backend (condition: `ApiReady`), and the agentic alerts adapter (condition: `AlertsAdapterReady`). The agentic console plugin (condition: `AgenticConsolePluginReady`) is [PLANNED: OLS-3236].
28
+
12a. Alerts adapter Phase 2 (OLS-3348): Deployment (1 replica, `ALERTMANAGER_URL` env hardcoded to `https://alertmanager-main.openshift-monitoring.svc:9094`, `POD_NAMESPACE` via downward API).
29
+
12b. Agentic console Phase 2[PLANNED: OLS-3236]: Deployment (1 replica, nginx with TLS via service-ca cert), Service (port 9443, serving-cert annotation), ConsolePlugin CR, Console CR activation.
30
30
13. After each deployment reconciliation, the operator checks the deployment's health status.
31
31
14. Deployment health has three states: Ready (Available condition true), Progressing (not yet available, no terminal failures), Failed (terminal pod failures detected).
32
32
15. Terminal pod failures include: CrashLoopBackOff, ImagePullBackOff, ErrImagePull, OOMKilled, and containers terminated with non-zero exit codes after CrashLoopBackOff.
@@ -37,12 +37,12 @@ The operator reconciles the OLSConfig CR into Kubernetes resources through a two
37
37
### Finalizer Lifecycle
38
38
19. On CR creation: add finalizer, return immediately (controller-runtime auto-requeues).
39
39
20. On CR deletion: run finalizer cleanup before removing finalizer.
40
-
21. Finalizer cleanup sequence: remove Console UI from Console CR, delete ConsolePlugin CR, remove agentic console plugin from Console CR, delete agentic ConsolePlugin CR, delete alerts-adapter RoleBinding in `openshift-monitoring`, delete alerts-adapter ClusterRoleBinding, delete alerts-adapter ClusterRole, list all owned resources by owner reference, explicitly delete them, wait for deletion (polling with timeout).
40
+
21. Finalizer cleanup sequence: remove Console UI from Console CR, delete ConsolePlugin CR, remove agentic console plugin from Console CR[PLANNED: OLS-3236], delete agentic ConsolePlugin CR[PLANNED: OLS-3236], delete alerts-adapter RoleBinding in `openshift-monitoring`, delete alerts-adapter ClusterRoleBinding, delete alerts-adapter ClusterRole, list all owned resources by owner reference, explicitly delete them, wait for deletion (polling with timeout).
41
41
22. If cleanup times out, the finalizer is removed anyway to prevent the CR from being stuck in Terminating state.
42
42
23. Console UI and agentic component removal errors during finalization are logged but do not block finalization.
43
43
44
44
### Status Conditions
45
-
24. The operator sets these condition types: ApiReady, CacheReady, ConsolePluginReady, AlertsAdapterReady, AgenticConsolePluginReady, ResourceReconciliation.
45
+
24. The operator sets these condition types: `ApiReady`, `CacheReady`, `ConsolePluginReady`, `AlertsAdapterReady`, `AgenticConsolePluginReady`[PLANNED: OLS-3236], `ResourceReconciliation`.
46
46
25. OverallStatus is Ready only when all deployment conditions are True.
47
47
26. OverallStatus is NotReady if any condition is False.
48
48
27. When deployments are not ready, diagnosticInfo is populated with per-pod failure details including container name, reason, message, exit code, and diagnostic type.
@@ -67,4 +67,4 @@ Reconciliation behavior is not directly user-configurable. It is driven by the O
67
67
68
68
| Ticket | Summary |
69
69
|---|---|
70
-
| OLS-3236 |[PLANNED] Add alerts-adapter and agentic-console as reconciled operands with Phase 1/2 steps, status conditions (AlertsAdapterReady, AgenticConsolePluginReady), and finalizer cleanup for cross-namespace resources|
70
+
| OLS-3236 |[PLANNED] Add agentic-console as a reconciled operand with Phase 1/2 steps, `AgenticConsolePluginReady`status condition, and finalizer cleanup for Console CR / ConsolePlugin CR|
0 commit comments