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
Externalize all hardcoded sidecar configuration (images, ports, resource limits, UID) into a hot-reloadable PlatformConfig backed by Kubernetes ConfigMaps, add cluster-wide FeatureGates as a kill switch, and implement a 6-layer precedence chain that gives operators fine-grained per-sidecar injection control at the global, namespace, workload, and platform-default levels.
Replace all hardcoded container images, ports, resource limits, and UIDs with config-driven values from PlatformConfig
Add FeatureGates as the highest-priority injection kill switch (global + per-sidecar)
Implement a PrecedenceEvaluator with 6 layers: Global gate → Per-sidecar gate → Namespace label → Workload label → TokenExchange CR → Platform defaults
Hot-reload both configs via fsnotify (ConfigMap volume watch)
Add Helm chart support (ConfigMap templates, volume mounts, values.yaml defaults)
Preserve backward compatibility for deprecated Agent/MCPServer webhook paths
Out of Scope
TokenExchange CR integration (stub only — tokenExchangeOverrides parameter is nil)
CLI tooling for config management
Migration tooling from hardcoded to config-driven values
Implementation Phases (Stacked PRs)
PRs should be reviewed and merged in order. Each builds on the previous.
Phase 1: Configuration Foundation (feat/config-types)
Add PlatformConfig and FeatureGates types, compiled defaults, YAML loaders with validation, and fsnotify-based file watchers for hot-reload. Purely additive — no existing code modified. ~575 lines.
Phase 2: Precedence Evaluator (feat/precedence-evaluator)
Add the 6-layer precedence chain evaluator, per-sidecar injection decision types, and 27 table-driven tests. New files plus additive label constants. ~650 lines.
Phase 3: ContainerBuilder Refactor (feat/container-builder-refactor)
Refactor Build*Container() from package-level functions to methods on a ContainerBuilder struct reading from *config.PlatformConfig. Temporary backward-compatible wrappers keep existing callers compiling. ~150 lines.
Phase 4: PodMutator Wiring & Main Integration (feat/pod-mutator-wiring)
Rewrite InjectAuthBridge to use the precedence evaluator. Change NewPodMutator signature for config getter functions. Wire loaders in cmd/main.go. Remove temporary wrappers from Phase 3. ~300 lines.
Overview
Externalize all hardcoded sidecar configuration (images, ports, resource limits, UID) into a hot-reloadable
PlatformConfigbacked by Kubernetes ConfigMaps, add cluster-wideFeatureGatesas a kill switch, and implement a 6-layer precedence chain that gives operators fine-grained per-sidecar injection control at the global, namespace, workload, and platform-default levels.Related Issue #97
Goals
PlatformConfigFeatureGatesas the highest-priority injection kill switch (global + per-sidecar)PrecedenceEvaluatorwith 6 layers: Global gate → Per-sidecar gate → Namespace label → Workload label → TokenExchange CR → Platform defaultsOut of Scope
tokenExchangeOverridesparameter is nil)Implementation Phases (Stacked PRs)
PRs should be reviewed and merged in order. Each builds on the previous.
Phase 1: Configuration Foundation (
feat/config-types)Add
PlatformConfigandFeatureGatestypes, compiled defaults, YAML loaders with validation, and fsnotify-based file watchers for hot-reload. Purely additive — no existing code modified. ~575 lines.Phase 2: Precedence Evaluator (
feat/precedence-evaluator)Add the 6-layer precedence chain evaluator, per-sidecar injection decision types, and 27 table-driven tests. New files plus additive label constants. ~650 lines.
Phase 3: ContainerBuilder Refactor (
feat/container-builder-refactor)Refactor
Build*Container()from package-level functions to methods on aContainerBuilderstruct reading from*config.PlatformConfig. Temporary backward-compatible wrappers keep existing callers compiling. ~150 lines.Phase 4: PodMutator Wiring & Main Integration (
feat/pod-mutator-wiring)Rewrite
InjectAuthBridgeto use the precedence evaluator. ChangeNewPodMutatorsignature for config getter functions. Wire loaders incmd/main.go. Remove temporary wrappers from Phase 3. ~300 lines.Phase 5: Helm Chart, Scripts & Documentation (
feat/helm-config-support)Add ConfigMap templates, deployment volume mounts, values.yaml defaults, rollout script updates, E2E test script, and README documentation. ~900 lines.
Precedence Chain Design
Special rules:
proxy-initalways followsenvoy-proxy— never injected independentlyspiffe-helperrequires both precedence chain ANDkagenti.io/spire=enabledlabel