Repository navigation
📝 Consolidated compositional agent platform design proposal - #770
Conversation
a0b031b to
81b92dc
Compare
|
|
||
| - The CR is the single authoritative declaration of "this is an agent" or "this is a tool" | ||
| - The label becomes a derived artifact managed by the controller (useful for selectors, UI queries, AgentCard discovery) | ||
| - If Argo CD's self-heal removes the label, the operator re-applies it on next reconcile -- no conflict because the operator is the owner |
There was a problem hiding this comment.
Is there any way to avoid reconciliation loops completely?
I thought I heard that if the label is on the Pod instead of the Deployment, for example?
(NB: I'm not an expert in this. But I do know that infinite reconcile loops are a problem. Otherwise Argo will never show the agent as fully "deployed".)
|
|
||
| ### 4. Make `kagenti.io/type` Label Operator-Managed | ||
|
|
||
| **Current design**: Developer must set `kagenti.io/type: agent|tool` on the workload. |
There was a problem hiding this comment.
Eventually, if we want to have multiple A2A agents within a single pod, would it really be the Route that we need to key off of for the AgentCard creation?
There was a problem hiding this comment.
Those agents would end up with one SPIFFE identity too...
You can resolve this comment, just something to think about.
|
Thanks for the consolidation, this is a solid piece of work. I'm supportive of the overall direction and don't want to block the PR. Two CRs (AgentRuntime + AgentCard), composition over inheritance, layered defaults, all good. A few things that I would still address though: Label-based injection: acknowledged, one remaining concernI've shared my perspective on label-triggered vs. CR-triggered injection previously. We've agreed to move forward with labels, so I won't rehash the full argument. One thing worth noting for the record: the label approach does require developers to modify their Deployment for what is fundamentally a platform concern (identity injection). That's the ownership inversion we originally wanted to avoid. Not a blocker, but something to keep in mind as the design evolves. Namespace gating deserves a second lookThe original proposal and @pdettori consolidated summary both included a namespace label ( That's a non-trivial compute cost on busy clusters. With a namespace label, the webhook configuration can use Beyond performance, there's an access control angle: without namespace gating, any developer in any namespace can trigger SPIFFE identity provisioning and IdP registration by adding a label. A namespace opt-in gives platform engineers explicit control over where agent infrastructure is available. I'd suggest reconsidering the namespace label, at least as an optional optimization that the webhook respects when present. CRD spec: what ships in v1alpha1?The full AgentRuntime spec covers a lot of ground (SPIFFE, Keycloak-specific client registration, destination rules, GenAI capture, MLflow integration). Can we mark which sections are "Phase 1" vs. aspirational? A lean v1alpha1 reduces the validation surface and keeps the CRD well within etcd limits. Webhook should target Pods, not workload objectsTargeting Deployments/StatefulSets causes GitOps drift (Argo CD sees injected sidecars as configuration changes). Istio, Linkerd, and Vault Agent Injector all target Pods at CREATE time for this reason. The document lists this as "long-term" but for Summit demos with GitOps users, this will cause friction. Worth prioritizing. I really would recommend to reconsider this from the very beginning as this is a crucial aspect to ensure that the original workload is not modified. AgentRuntime deletion should revert to defaultsFor Open Question #3: deleting the CR should mean "revert to platform defaults," not "remove identity infrastructure." The sidecars are already injected. Removing identity should require removing the type label and restarting the workload. Future enhancements belong in a separate documentThe long-term section (mandatory AgentRuntime CR, CR-triggered injection, operator-managed labels, pod-level targeting) is substantial enough to warrant its own design doc. Bundling it here blurs what's being proposed now vs. what's planned later. A separate document would also be the right place to spell out concrete migration paths, since each of those changes affects every deployed agent. One question on the future plans: if the direction is to make AgentRuntime mandatory and switch the injection trigger to CR existence, what's the reasoning for not starting there now? The CR-aware webhook approach preserves admission-time guarantees while avoiding the migration. If we're confident that's where we're heading, building the intermediate label-based system adds a migration step we could skip. Minor points
|
|
Thanks @rhuss for the thorough review, and @amfred for the questions on reconciliation loops, multi-agent pods, and SPIFFE identity sharing. All valid points. I'd like to propose scoping an MVP (Minimum Viable Product) — implementation complete by early April. The goal is to get sign-off on what we build now vs. what we defer to a separate design doc. MVP scope (early April)
CR-triggered injection — how it worksThe design uses both the controller and the admission webhook together: The sequence
Config hash — one mechanism for create, update, and deleteThe controller maintains a
On deletion, the AgentRuntime CR carries a finalizer ( Kubernetes admission mechanicsAdding a label to a PodTemplateSpec within a Deployment triggers admission control at two levels:
GitOps compatibility (Argo CD)The controller modifies the Deployment's PodTemplateSpec (adding labels and config-hash annotation). Argo CD will detect this as drift from the Git-stored manifest and may attempt to revert it. This is a known pattern — any operator that manages labels on workloads it doesn't own faces the same issue (Istio, KEDA, etc.). Mitigation: Server-Side Diff (Argo CD v2.5+) Argo CD's server-side diff feature uses structured merge patch (SSA) semantics to distinguish between fields owned by different managers. When enabled, Argo CD recognizes that the Configuration: apiVersion: argoproj.io/v1alpha1
kind: Application
spec:
ignoreDifferences:
- group: apps
kind: Deployment
jqPathExpressions:
- .spec.template.metadata.labels."kagenti.io/type"
- .spec.template.metadata.annotations."kagenti.io/config-hash"Or cluster-wide via data:
resource.customizations.ignoreDifferences.apps_Deployment: |
jqPathExpressions:
- .spec.template.metadata.labels."kagenti.io/type"
- .spec.template.metadata.annotations."kagenti.io/config-hash"This is the same approach used for Istio sidecar injection labels and Vault Agent annotations. Documentation for this Argo CD configuration will be included in the install guide. What this gives us
Deferred to separate design docPer @rhuss's suggestion, the long-term enhancements are substantial enough to warrant their own document. This includes:
Note: mandatory AgentRuntime CR and operator-managed labels are now in the MVP scope (see #2 above), not deferred. Doc fixes (will update in this PR)
@rhuss @amfred — does this MVP scope look right to you? Any features missing or items that should move between MVP and deferred? |
pdettori
left a comment
There was a problem hiding this comment.
Review: Document vs Comments Alignment Check
The latest commit (6db115d, March 10) substantially addresses the review feedback from @rhuss and @amfred. The document has been rewritten to reflect the MVP scope proposed in the March 6 comment.
Feedback Incorporation Summary
| # | Reviewer | Feedback | Status |
|---|---|---|---|
| 1 | @rhuss | reinvocationPolicy inconsistency |
✅ Fixed — both YAML and Risks now say IfNeeded |
| 2 | @rhuss | Namespace gating | ✅ Fixed — optional kagenti-enabled: "true" namespaceSelector |
| 3 | @rhuss | Webhook should target Pods | ✅ Fixed — moved to short-term, Pod CREATE targeting throughout |
| 4 | @rhuss | Lean v1alpha1 CRD | ✅ Fixed — scoped to targetRef, identity, trace |
| 5 | @rhuss | AgentRuntime deletion reverts to defaults | ✅ Fixed — finalizer-based, reverts to platform defaults |
| 6 | @rhuss | Future enhancements in separate doc | |
| 7 | @rhuss | Sidecar count tracking | ✅ Fixed — new "Sidecar Consolidation Plan" section |
| 8 | @rhuss | Config propagation for non-Envoy sidecars | ✅ Fixed — explicitly flagged as open gap |
| 9 | @amfred | Reconciliation loops | ✅ Fixed — Pod-level targeting eliminates the concern |
| 10 | @amfred | Multiple A2A agents in single pod / Route-based AgentCard | |
| 11 | @amfred | Shared SPIFFE identity for multi-agent pods |
Overall the document is in good shape. See inline comments for remaining suggestions.
Signed-off-by: cwiklik <[email protected]>
Signed-off-by: cwiklik <[email protected]>
…nership - Change short-term injection model: agents injected by default via kagenti.io/type: agent label; tools require feature gate; opt-out via kagenti.io/inject: disabled; no namespace label needed - Rewrite Long-Term section with 5 numbered directions from design review: mandatory AgentRuntime CR, CR-trigger injection, drop layered CRD hierarchy, operator-managed type label, pod-level webhook targeting - Clarify AgentRuntime is developer-owned (not platform engineer) - Separate webhook pod from operator pod in Controller Architecture - Add Two Distinct Configuration Concerns section (admission-time vs reconfiguration of running workloads) - Add Open Question rossoctl#5: label vs CR injection trigger with YAML examples - Add Risk 5: multiple webhook ordering conflicts - Qualify pod-restart claims throughout document - Update ConfigMap defaults with actual kagenti-webhook-feature-gates and kagenti-webhook-defaults content Co-authored-by: Claude <[email protected]> Signed-off-by: cwiklik <[email protected]>
Replace all references to kagenti.io/inject: enabled as the injection trigger with the current model: kagenti.io/type: agent triggers injection by default; kagenti.io/inject: disabled to opt out. Changes across the document: - Summary/Abstract, Architecture at a Glance, Two-Layer diagram - Background (Prior Proposals, Key Disagreements table) - User Stories, Goals, Non-Goals - Labels table and section (single label model, opt-out pattern, updated YAML example, rewritten ownership rationale) - Cardinality scenarios table (added opt-out row) - Webhook objectSelector YAML (type:agent + inject:disabled exclusion) - Webhook decision logic tree, behavior steps, note - Migration YAML example - Pattern comparison table - Pros/Cons (rossoctl#1 in each updated) - Open Question rossoctl#4 (type-label-trigger vs CR-trigger) - Long-Term section item 2 and migration table Co-authored-by: Claude <[email protected]> Signed-off-by: cwiklik <[email protected]>
The platform engineer story referenced kagenti.io/type: agent label which is set by developers, not platform engineers. Reworded to express the policy outcome: any workload classified as an agent should be automatically secured, without developers needing to understand the injection mechanism. Co-authored-by: Claude <[email protected]> Signed-off-by: cwiklik <[email protected]>
- Fix reinvocationPolicy inconsistency (Never → IfNeeded in webhook YAML) - Move pod-level webhook targeting from long-term to short-term/MVP - Add optional namespace gating (kagenti-enabled: "true" namespaceSelector) - Trim AgentRuntime CRD spec to v1alpha1 scope (targetRef, identity, trace) - Rewrite injection model: CR-triggered via controller-managed labels - Document admission mechanics (PodTemplateSpec label → rolling update → webhook) - Flag non-Envoy config propagation as open gap - Add explicit sidecar consolidation plan - Update checklist with completed implementation items - Update examples, diagrams, and tables throughout Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: cwiklik <[email protected]>
- Add future consideration note for multi-agent-per-pod scenario and Route-based AgentCard keying (raised by @amfred) - Note that long-term items may move to a separate design doc per @rhuss suggestion Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: cwiklik <[email protected]>
9dc35f4 to
832f777
Compare
|
To me, if the creation of the CR triggers injection, I would expect the deletion of the CR to undo that. Having deletion of the CR revert to default configuration makes sense to me only if the CR itself is merely configuring and not triggering injection. |
A possible solution that would be more intuitive in my view would be to not have the CR trigger rollout. The webhook would inject based on whether a CR exists that covers the pod being created. Existing pods would not be affected either by creation or deletion of the CR. Rather, an explicit rollout would be required after any CR change in order for it to take effect. |
This would also avoid any conflict with gitops controllers over the original workload. |
The default is to inject AuthBridge with default configuration. The override is AgentRuntime. If that gets deleted, the pod reverts to defaults. |
The second item in the MVP is described as 'CR-triggered injection via controller-managed labels' and the notes state 'AgentRuntime CR is mandatory', then describe how the creation of the CR causes a chain of events that results in the injection of additional containers by the webhook. |
Here is the End-to-End Flow
when an AgentRuntime CR is deleted:
The net effect: the workload keeps its sidecars but falls back to platform-default configuration. |
|
Right, so creating the CR triggers injection, but deleting it does not undo that. My point was that to me this is not intuitive. |
@rhuss suggested this flow: "AgentRuntime deletion should revert to defaults For Open Question #3: deleting the CR should mean "revert to platform defaults," not "remove identity infrastructure." The sidecars are already injected. Removing identity should require removing the type label and restarting the workload." |
Yes, and I think that flow made sense when the injection was triggered by labels on the workload or namespace, as in that case the CR merely changed the configuration but did not itself cause injection. However if the CR does cause injection, then reverting to defaults on deletion of that CR is not in my view what the user would expect. I do think that having injection controlled by the presence of the CR is better. It is clear and explicit and the status of the CR can be used to indicate the status of injection. If the finalizer for the CR is triggering a rollout (though update of the PodTemplateSpec), then why not have the webhook ignore the new pods since the CR that triggered injection is no longer there? That seems more intuitive. (It would be ideal if the controller could trigger pod recreation without changing the workload at all, e.g. by just deleting pods that are affected by the creation or deletion of a CR.) @grs I think what you suggest makes sense. With CR-driven injection, the semantics should be:
This is more intuitive than reverting to defaults — if the user explicitly created a CR to trigger injection, removing it should undo that decision. I'll let this simmer for a bit (perhaps other people have a different opinion (@rhuss) and then update the design to reflect this direction. |
|
On a somewhat separate point, how is the case handled where more than on AgentRuntime CR targets the same workload, with conflicting settings in each? @grs Good question. Some options:
These aren't mutually exclusive — for example, option 3 as the primary guard with option 1 as a defensive fallback in the webhook would give both good UX and safety. |
|
Just adding my 10 cents late in the game. Overall I think the design changes are good. This should avoid infinite reconciliation loops. The objectselector on the webhook - to avoid a cluster-wide performance cost - is good. We may find some details that need to change once we actually get more hands-on experience with this, but I think it's close to correct and good enough for an MVP. I have to defer to the people who are more hands-on with the code with respect to the implementation decisions that @grs and @cwiklik are discussing. I can't rule any of them out as a bad idea myself. |
…gent CRs Per PR #770 consolidated design: AgentRuntime CR targetRef points to standard Deployments, not Agent CRs. Fixed all references and diagrams. Added deployed structure diagram showing controller-managed namespace layout (agent pod with AuthBridge sidecars, optional egress proxy, per-namespace infra). Added database access model diagram showing which component writes/reads which tables across the sessions and llm_budget databases. Refs: #820, #862 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
…gent CRs Per PR #770 consolidated design: AgentRuntime CR targetRef points to standard Deployments, not Agent CRs. Fixed all references and diagrams. Added deployed structure diagram showing controller-managed namespace layout (agent pod with AuthBridge sidecars, optional egress proxy, per-namespace infra). Added database access model diagram showing which component writes/reads which tables across the sessions and llm_budget databases. Refs: #820, #862 Assisted-By: Claude (Anthropic AI) <[email protected]> Signed-off-by: Ladislav Smola <[email protected]>
|
merging so we can update it to sync up with MVP implementation in a follow up PR. |
Summary
docs/design-proposals/consolidated-compositional-agent-platform-design.md)AgentRuntime+AgentCard) atop a label-and-webhook foundation with layered defaultskagenti.io/inject: enabled) replacing namespace-level injectionAgentRuntimeandAgentCardCRskagenti-webhook-system) and Kagenti Operator PodKey Design Decisions
kagenti.io/inject: enabled(current); CR-trigger alternative is an open question requiring further discussionkagenti-webhook-feature-gatesandkagenti-webhook-defaultsConfigMaps (short-term);AgentRuntimeClusterConfig/AgentRuntimeConfigCRDs planned for long-termTest plan