Commit 9ad67f7
feat: MPP-aware pod-status-syncer and kubernetes MCP sidecar (#1632)
## Summary
- **pod-status-syncer**: On MPP clusters (`PLATFORM_MODE=mpp`), lists
`TenantNamespace` resources (`tenant.paas.redhat.com/v1alpha1`) from the
config namespace instead of `v1/Namespace` (which is forbidden). Derives
actual namespace names with the `ambient-code--` prefix.
- **kubeclient**: Adds `ListTenantNamespaces()` method for the
TenantNamespace CRD.
- **kube_reconciler**: Propagates `PLATFORM_MODE` and
`MPP_CONFIG_NAMESPACE` env vars to credential sidecar containers so they
can detect MPP mode at runtime.
- **credential-entrypoint**: When `PLATFORM_MODE=mpp` and
`provider=kubeconfig`, writes a TOML config with `denied_resources`
blocking `v1/Namespace` and injects `--config` into the
`kubernetes-mcp-server` subprocess args.
No regression on vanilla Kubernetes — MPP code paths only activate when
`PLATFORM_MODE=mpp` (set by `mpp-openshift` overlay).
## Files Changed
< /dev/null | File | Change |
|------|--------|
| `components/ambient-control-plane/internal/reconciler/pod_sync.go` |
MPP namespace listing via TenantNamespace |
| `components/ambient-control-plane/internal/kubeclient/kubeclient.go` |
`ListTenantNamespaces()` method |
| `components/ambient-control-plane/cmd/ambient-control-plane/main.go` |
Pass platform config to syncer + reconciler |
|
`components/ambient-control-plane/internal/reconciler/kube_reconciler.go`
| Propagate PLATFORM_MODE to sidecar env |
| `components/credential-sidecars/entrypoint/main.go` |
`injectMPPConfig()` for k8s MCP sidecar |
## Test plan
- [x] `go vet ./...` passes for ambient-control-plane
- [x] `go build ./...` passes for ambient-control-plane and
credential-sidecars/entrypoint
- [x] `go test ./...` passes for ambient-control-plane
- [x] All kustomize overlays build (base, production, mpp-openshift)
- [ ] Deploy to MPP cluster and verify pod-status-syncer lists
namespaces via TenantNamespace
- [ ] Verify kubernetes-mcp-server sidecar starts with `--config` and
`denied_resources` on MPP
- [ ] Verify no regression on vanilla Kubernetes cluster
🤖 Generated with [Claude Code](https://claude.ai/code)
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added multi-platform/multi-tenant (MPP) mode: control plane discovers
and syncs tenant namespaces and supports MPP-aware behavior.
* Credential sidecars receive MPP-aware environment/configuration to
restrict cluster-scoped namespace access.
* **Tests**
* E2E tests updated to improve workspace secret, API key, and
environment-variable input flows.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Co-authored-by: user <u@example.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>1 parent 992f98f commit 9ad67f7
6 files changed
Lines changed: 79 additions & 20 deletions
File tree
- components
- ambient-control-plane
- cmd/ambient-control-plane
- internal
- kubeclient
- reconciler
- credential-sidecars/entrypoint
- e2e/cypress/e2e
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| 159 | + | |
| 160 | + | |
159 | 161 | | |
160 | 162 | | |
161 | 163 | | |
| |||
196 | 198 | | |
197 | 199 | | |
198 | 200 | | |
199 | | - | |
| 201 | + | |
200 | 202 | | |
201 | 203 | | |
202 | 204 | | |
| |||
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
314 | 314 | | |
315 | 315 | | |
316 | 316 | | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
317 | 330 | | |
318 | 331 | | |
319 | 332 | | |
| |||
Lines changed: 8 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
| 76 | + | |
75 | 77 | | |
76 | 78 | | |
77 | 79 | | |
| |||
1008 | 1010 | | |
1009 | 1011 | | |
1010 | 1012 | | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
1011 | 1019 | | |
1012 | 1020 | | |
1013 | 1021 | | |
| |||
Lines changed: 27 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
24 | 26 | | |
25 | 27 | | |
26 | | - | |
| 28 | + | |
27 | 29 | | |
28 | | - | |
29 | | - | |
30 | | - | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
31 | 35 | | |
32 | 36 | | |
33 | 37 | | |
| |||
60 | 64 | | |
61 | 65 | | |
62 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
63 | 70 | | |
64 | 71 | | |
65 | 72 | | |
| |||
72 | 79 | | |
73 | 80 | | |
74 | 81 | | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
75 | 95 | | |
76 | 96 | | |
77 | 97 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
195 | 199 | | |
196 | 200 | | |
197 | 201 | | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
198 | 218 | | |
199 | 219 | | |
200 | 220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1243 | 1243 | | |
1244 | 1244 | | |
1245 | 1245 | | |
1246 | | - | |
1247 | 1246 | | |
1248 | | - | |
1249 | | - | |
1250 | | - | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
1251 | 1250 | | |
1252 | 1251 | | |
1253 | 1252 | | |
| |||
1268 | 1267 | | |
1269 | 1268 | | |
1270 | 1269 | | |
1271 | | - | |
1272 | 1270 | | |
1273 | | - | |
1274 | | - | |
1275 | | - | |
| 1271 | + | |
| 1272 | + | |
1276 | 1273 | | |
1277 | | - | |
1278 | | - | |
1279 | | - | |
| 1274 | + | |
| 1275 | + | |
1280 | 1276 | | |
1281 | 1277 | | |
1282 | 1278 | | |
| |||
0 commit comments