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
|`app-server.md`, `postgres.md`, `console-ui.md`|`how/deployment-generation.md` -- how deployments/services/configmaps are generated |
52
+
|`app-server.md`, `postgres.md`, `console-ui.md`, `agentic-console-ui.md`|`how/deployment-generation.md` -- how deployments/services/configmaps are generated |
52
53
|`crd-api.md`|`how/config-generation.md` -- how CRD fields map to generated configuration |
-> Set force-reload annotation with current timestamp
95
101
```
96
102
97
103
## Key Abstractions
98
104
99
105
### Image Management
100
-
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`).
106
+
Default images are stored in a `defaultImages` map in `cmd/main.go` keyed by logical name (e.g., `"lightspeed-service"`, `"postgres-image"`, `"console-plugin"`, `"agentic-console-plugin"`). Default values come from `internal/relatedimages/` which reads `related_images.json` at build time. Command-line flags override individual images (`--console-image`, `--agentic-console-image`, etc.). The map is passed to the reconciler via `OLSConfigReconcilerOptions` as individual named fields (e.g., `LightspeedServiceImage`, `ConsoleUIImage`, `AgenticConsoleUIImage`).
101
107
102
108
### WatcherConfig
103
-
Declarative configuration for external resource watching. Contains:
104
-
-`Secrets.SystemResources`: Fixed list of system secrets with affected deployment names (telemetry pull secret, console TLS cert, postgres TLS cert)
109
+
Declarative configuration for external resource watching. Built in `cmd/main.go` and passed via `OLSConfigReconcilerOptions.WatcherConfig`. Contains:
110
+
-`Secrets.SystemResources`: Fixed list of system secrets with affected deployment names:
111
+
- Telemetry pull secret → app server (`ACTIVE_BACKEND`)
-`ConfigMaps.SystemResources`: Fixed list of system configmaps (kube-root-ca.crt, service-ca bundle)
106
116
-`AnnotatedSecretMapping`: Dynamic map populated from CR spec at runtime (maps secret name to deployment names)
107
117
-`AnnotatedConfigMapMapping`: Dynamic map populated from CR spec at runtime (maps configmap name to deployment names)
108
118
The special deployment name `"ACTIVE_BACKEND"` resolves to the AppServer deployment name (`lightspeed-app-server`).
109
119
120
+
When the service-ca operator rotates or populates a watched TLS secret, `SecretUpdateHandler` restarts the mapped deployment via `RestartConsoleUI()` or `RestartAgenticConsoleUI()` (registered in `watchers/watchers.go`).
121
+
110
122
### Component Package Pattern
111
-
Each component (appserver, postgres, console) follows the same package structure:
123
+
Each component (appserver, postgres, console, agenticconsole) follows the same package structure:
112
124
-`reconciler.go`: Phase 1 (resources) and Phase 2 (deployment) entry points
113
125
-`deployment.go`: Deployment spec generation and update detection
114
126
-`assets.go` and/or `config.go`: Resource and config generation
@@ -117,17 +129,20 @@ The packages receive `reconciler.Reconciler` interface, never import the control
`OLSConfigReconciler` implements the interface in `olsconfig_helpers.go`. Component packages call `r.GetAgenticConsoleImage()` when generating the agentic console deployment; the value comes from `OLSConfigReconcilerOptions.AgenticConsoleUIImage`, set in `cmd/main.go` from `--agentic-console-image` (with default from `defaultImages["agentic-console-plugin"]`).
137
+
124
138
### Finalizer Pattern
125
139
The OLSConfig CR uses finalizer `ols.openshift.io/finalizer` (defined in `utils.OLSConfigFinalizer`). On deletion:
5. Wait up to 3 minutes for deletion (poll every 5 seconds)
145
+
6. Remove finalizer (proceeds even if cleanup times out)
131
146
132
147
## Integration Points
133
148
@@ -210,6 +225,20 @@ E2E tests live in `test/e2e/` and run against a real OpenShift cluster with the
210
225
|`CONDITION_TIMEOUT`| No | Custom timeout in seconds for condition checks |
211
226
|`ARTIFACT_DIR`| No | Directory for must-gather diagnostics output |
212
227
228
+
## Local Development
229
+
230
+
`make run` sets `LOCAL_DEV_MODE=true` and runs the operator on the host against the cluster kubeconfig.
231
+
232
+
| Behavior | When `LOCAL_DEV_MODE=true`|
233
+
|---|---|
234
+
| Operator ServiceMonitor | Skipped in `reconcileOperatorResources()`|
235
+
| App-server metrics reader secret | Skipped in `appserver.reconcileMetricsReaderSecret()`|
236
+
| App-server ServiceMonitor / PrometheusRule | Still reconciled if Prometheus Operator CRDs exist |
237
+
238
+
Skipping metrics reader secret reconciliation avoids a local reconcile loop: creating the token secret triggers `Owns(Secret)` and immediate requeue.
239
+
240
+
`make run` also runs `dev-setup` (namespace, metrics RBAC, user-access). Image overrides: `--console-image`, `--agentic-console-image`, and other flags in `cmd/main.go`.
241
+
213
242
## Implementation Notes
214
243
215
244
- The operator uses kubebuilder v3 markers for CRD generation and RBAC.
@@ -218,4 +247,3 @@ E2E tests live in `test/e2e/` and run against a real OpenShift cluster with the
218
247
- The OLSConfig CRD is cluster-scoped and validated to require `.metadata.name == "cluster"`.
|-- checkDeploymentStatus() for each # Collect diagnostics
@@ -33,7 +35,7 @@ Reconcile(ctx, req)
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, agenticconsole) 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.
@@ -77,5 +79,5 @@ The `finalizeOLSConfig()` method uses `listOwnedResources()` which queries every
77
79
-`SetupWithManager()` registers Owns() for 12 resource types and Watches() for Secrets and ConfigMaps with custom predicates.
78
80
- Secret watch predicates: Create events allowed for all secrets in operator namespace (handles recreated secrets); Update events filtered by watcher annotation; Delete events ignored.
79
81
- ConfigMap watch predicates: Same pattern as secrets.
80
-
- The `LOCAL_DEV_MODE` environment variable skips ServiceMonitor creation when running locally.
82
+
- The `LOCAL_DEV_MODE` environment variable skips operator ServiceMonitor creation and app-server metrics reader secret reconciliation when running locally (`make run`).
81
83
- Phase 1 failures update status with `ResourceReconciliation` condition type (not the component-specific types used in Phase 2).
0 commit comments