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
Copy file name to clipboardExpand all lines: AGENTS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -68,6 +68,7 @@ There are 3 main types of documentation targeting different audiences:
68
68
## E2E Testing
69
69
70
70
- use make targets for running e2e tests (e.g., `make test-e2e`) and document the process in `docs/developer-guide/testing.md`
71
+
- use `make test` for unit tests
71
72
-**Never use images from docker.io in e2e tests.** All container images must use fully-qualified registry paths (e.g., `registry.k8s.io/`, `quay.io/`, or a private registry). Do not rely on Docker Hub as a default registry.
WVA uses a unified configuration system that consolidates all settings into a single `Config` structure. This provides clear precedence rules, type safety, and separation between static (immutable) and dynamic (runtime-updatable) configuration.
4
+
5
+
### Configuration Structure
6
+
7
+
The unified `Config` consists of two parts:
8
+
9
+
1.**StaticConfig**: Immutable settings loaded at startup (require controller restart to change)
Copy file name to clipboardExpand all lines: docs/user-guide/configuration.md
+54-68Lines changed: 54 additions & 68 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -126,79 +126,34 @@ See [Saturation Analyzer Documentation](../../docs/saturation-analyzer.md) for c
126
126
127
127
WVA uses ConfigMaps for cluster-wide configuration.
128
128
129
-
### Service Class ConfigMap
130
-
131
-
Defines SLO requirements for different service tiers:
132
-
133
-
```yaml
134
-
apiVersion: v1
135
-
kind: ConfigMap
136
-
metadata:
137
-
name: serviceclass
138
-
namespace: workload-variant-autoscaler-system
139
-
data:
140
-
serviceClasses: |
141
-
- name: Premium
142
-
model: meta/llama-3.1-8b
143
-
priority: 1
144
-
slo-itl: 24 # Time per output token (ms)
145
-
slo-ttw: 500 # Time to first token (ms)
146
-
147
-
- name: Standard
148
-
model: meta/llama-3.1-8b
149
-
priority: 5
150
-
slo-itl: 50
151
-
slo-ttw: 1000
152
-
153
-
- name: Freemium
154
-
model: meta/llama-3.1-8b
155
-
priority: 10
156
-
slo-itl: 100
157
-
slo-ttw: 2000
158
-
```
159
-
160
-
## Unified Configuration System
161
-
162
-
WVA uses a unified configuration system that consolidates all settings into a single `Config` structure. This provides clear precedence rules, type safety, and separation between static (immutable) and dynamic (runtime-updatable) configuration.
163
-
164
-
### Configuration Structure
165
-
166
-
The unified `Config` consists of two parts:
167
-
168
-
1. **StaticConfig**: Immutable settings loaded at startup (require controller restart to change)
2. **DynamicConfig**: Runtime-updatable settings (can be changed via ConfigMap updates)
174
-
- Optimization interval
175
-
- Saturation scaling thresholds
176
-
- Scale-to-zero configuration
177
-
- Prometheus cache settings
178
-
179
129
### Configuration Precedence
180
130
181
-
Configuration values are loaded with the following precedence (highest to lowest):
131
+
Configuration values are resolved with following precedence (highest to lowest):
182
132
183
-
1. **CLI Flags** (highest priority)
133
+
1. **CLI Flags** — only when explicitly set on the command line (highest priority)
184
134
2. **Environment Variables**
185
135
3. **ConfigMap** (in `workload-variant-autoscaler-system` namespace)
186
136
4. **Defaults** (lowest priority)
187
137
138
+
> **Note:** CLI flag defaults do **not** override environment variables or ConfigMap values.
139
+
> Only flags that are explicitly passed on the command line take precedence.
140
+
> For example, if `--leader-elect` is not passed but `LEADER_ELECT=true` is set in
141
+
> the environment, the environment value (`true`) is used.
142
+
188
143
**Example:**
189
144
```bash
190
-
# CLI flag (highest priority)
191
-
--metrics-addr=":8443"
145
+
# CLI flag explicitly set (highest priority)
146
+
--metrics-bind-address=":8443"
192
147
193
-
# Environment variable (overridden by flags)
148
+
# Environment variable (used when flag is not explicitly set)
194
149
export METRICS_BIND_ADDRESS=":8080"
195
150
196
-
# ConfigMap (overridden by env/flags)
151
+
# ConfigMap (used when neither flag nor env is set)
197
152
# wva-variantautoscaling-config
198
153
data:
199
154
METRICS_BIND_ADDRESS: ":9090"
200
155
201
-
# Default (used if none of above are set)
156
+
# Default (used if none of the above are set)
202
157
# Default: "0" (disabled)
203
158
```
204
159
@@ -457,10 +412,10 @@ metadata:
457
412
data:
458
413
# Mutable: Optimization interval (can be changed at runtime)
459
414
GLOBAL_OPT_INTERVAL: "60s"
460
-
415
+
461
416
# Immutable: Prometheus connection (requires restart if changed)
462
417
PROMETHEUS_BASE_URL: "https://prometheus:9090"
463
-
418
+
464
419
# Immutable: Feature flags (require restart if changed)
465
420
WVA_SCALE_TO_ZERO: "true"
466
421
WVA_LIMITED_MODE: "false"
@@ -478,11 +433,11 @@ env:
478
433
# Prometheus connection (immutable - requires restart to change)
479
434
- name: PROMETHEUS_BASE_URL
480
435
value: "https://prometheus:9090"
481
-
436
+
482
437
# Optional: Override ConfigMap name
483
438
- name: CONFIG_MAP_NAME
484
439
value: "my-custom-config"
485
-
440
+
486
441
# Optional: Override namespace
487
442
- name: POD_NAMESPACE
488
443
value: "workload-variant-autoscaler-system"
@@ -492,19 +447,51 @@ env:
492
447
493
448
### Configuration via CLI Flags
494
449
495
-
Infrastructure settings can be configured via CLI flags (highest precedence):
450
+
Infrastructure settings can be configured via CLI flags. Only flags explicitly passed on the command line take highest precedence; unset flags fall through to environment variables, ConfigMap, and then defaults.
496
451
497
452
```bash
498
453
# Start controller with custom settings
499
454
./manager \
500
-
--metrics-addr=":8443" \
501
-
--probe-addr=":8081" \
502
-
--enable-leader-election \
503
-
--leader-election-id="my-election-id"
455
+
--metrics-bind-address=":8443" \
456
+
--health-probe-bind-address=":8081" \
457
+
--leader-elect \
458
+
--leader-election-lease-duration=60s \
459
+
--leader-election-renew-deadline=50s \
460
+
--leader-election-retry-period=10s \
461
+
--rest-client-timeout=60s
504
462
```
505
463
464
+
### Configuration Parameter Reference
465
+
466
+
The following table lists all static configuration parameters with their CLI flag, environment variable, ConfigMap key, type, and default value. All three sources share the same key name (except CLI flags which use kebab-case).
467
+
506
468
**Note:** CLI flags are typically set in the Helm chart or deployment manifest, not directly.
507
469
470
+
| Parameter | CLI Flag | Env Var / ConfigMap Key | Type | Default | Description |
0 commit comments