Repository navigation
Conversation
Signed-off-by: cwiklik <[email protected]>
Signed-off-by: cwiklik <[email protected]>
| 5. **Migration overhead** - Users must convert existing Deployments to new CRD format | ||
| 6. **Missing integration** - Standard K8s tools/controllers may not recognize the new CRD | ||
|
|
||
| Red Hat's existing portfolio already addresses many needs of agentic workloads: service meshes handle inter-service communication, secret managers protect credentials, and observability stacks capture metrics and traces. Introducing a monolithic agent framework would duplicate this existing functionality, increase coupling between components, and add conceptual overhead. |
There was a problem hiding this comment.
I would generalize this - e.g. "CNCF existing ecosystem already addresses ..."
| 3. **Keep surface area small** - Focus on integration points, not comprehensive workload management | ||
| 4. **Provide non-intrusive injection** - Automatic identity infrastructure via opt-in webhook | ||
| 5. **Enable independent pillar adoption** - Each CR can be used separately | ||
| 6. **Support dynamic reconfiguration** - Configuration changes without pod restarts |
There was a problem hiding this comment.
I am not sure we can remove/update containers without a pod restart - that was one of the key issues that motivated the introduction of Istio Ambient, where the biggest advantage is that it can be added or removed or upgraded without any workload restart. The current design with sidecars cannot claim this goal.
There was a problem hiding this comment.
I was thinking to use fsnotify in identity sidecars to watch ConfigMap and reconfigure but granted not sure about complexity involved. Perhaps pod restart will be required.
There was a problem hiding this comment.
Reconfiguration only might be accomplished without restart - this is what envoy + xDS do today. What cannot be accomplished without restart is 1) adding or removing the sidecars 2) upgrading the image version of the sidecars
There was a problem hiding this comment.
From the language I was wondering how broadly this can be applied as well, since some changes for receivers I thought would require OpenTelemetry collector restart?
| 1. **Building another workload orchestrator** - Users keep their existing orchestration tools | ||
| 2. **Introducing mandatory cross-dependencies between pillars** - Optional integration is acceptable, but no pillar requires another | ||
| 3. **Replacing established deployment tools** - Helm, GitOps, OLM, and Terraform remain valid choices | ||
| 4. **Duplicating existing Red Hat portfolio functionality** - Secret managers, service meshes, and observability stacks continue to be used |
There was a problem hiding this comment.
Again, I would make this more general "Estabilshed CNCF ecosystem projects functionality..."
| │ • AgentTrace: Configure agent telemetry │ | ||
| │ • AgentCard: Discover agent capabilities │ | ||
| │ • Controllers create ConfigMaps or cache data │ | ||
| │ • No pod restarts needed │ |
There was a problem hiding this comment.
See previous point regarding pod restarts
| - `AgentTrace`: Configure agent telemetry | ||
| - `AgentCard`: Discover agent capabilities | ||
| - Controllers create ConfigMaps or cache data | ||
| - No pod restarts needed for configuration changes |
There was a problem hiding this comment.
This may require exploring a design based on or along the lines of envoy + XDS for dynamic config
| 1. **Adoption Rate**: Percentage of agent workloads using composition pattern vs. legacy Agent CR | ||
| 2. **Time to First Agent**: Time from deployment to working agent with identity infrastructure | ||
| 3. **Configuration Change Latency**: Time from CR update to sidecar reconfiguration (target: <10s) | ||
| 4. **Removal Impact**: Zero workload disruption when Kagenti is removed |
There was a problem hiding this comment.
- may be problematic to achieve with a sidecar-based architecture.
| All identity infrastructure components start with sensible defaults: | ||
|
|
||
| **SPIFFE Helper Defaults**: | ||
| - Trust domain: `cluster.local` |
There was a problem hiding this comment.
this depends on the particular cluster configuration and should be configurable - for example on OCP we use
export DOMAIN=apps.$(kubectl get dns cluster -o jsonpath='{ .spec.baseDomain }')
| - Token exchange enabled: `true` | ||
|
|
||
| **Auth Proxy Defaults**: | ||
| - Inbound port: `8080` |
There was a problem hiding this comment.
This will also depend on the agent config... should be configurable, initially at platform level then at agent level
| name: weather-agent-auth | ||
| namespace: default | ||
| spec: | ||
| targetRef: |
There was a problem hiding this comment.
Can we apply the same config to more than one agent ? targetRef assumes 1:1 mapping, but we could re-use this config on multiple agents, thus a label selector may be a better choice here - e.g.:
selector:
matchLabels:
app: my-appThere was a problem hiding this comment.
Worth considering, although I understood Roland Huss suggested 1:1 targeting with Duck-Typing Pattern:
targetRef:
apiVersion: apps/v1
kind: Deployment # or StatefulSet, Job, CronJob, etc.
name: my-agent
| 2. Resolves targetRef to find workload | ||
| 3. Creates ConfigMap: `{workload-name}-token-exchange` | ||
| 4. ConfigMap contains configuration for all identity sidecars | ||
| 5. Identity sidecars watch ConfigMap via fsnotify |
There was a problem hiding this comment.
I see - this is a different approach than envoy + XDS - consider also that as design option as it is well established in this space.
| app.kubernetes.io/component: discovery | ||
| spec: | ||
| syncPeriod: "30s" | ||
| selector: |
There was a problem hiding this comment.
If AgentCard maps 1:1 with an agent this is a case where we want to use a targetRef instead.
| scopes: | ||
| - "weather:premium" | ||
| - "weather:historical" | ||
|
|
There was a problem hiding this comment.
Scopes and audiences make a lot of sense here - but I am wondering if low level infrastructure details (which hopefully are the same for all agents) should really be here - e.g. tokenUrl, keycloakUrl etc.
There was a problem hiding this comment.
@maia-iyer @mrsabath I am waiting for domain experts to chime in on what makes sense in this API. Which fields are fixed and which can be modified.
| name: weather-agent-trace | ||
| namespace: default | ||
| spec: | ||
| targetRef: |
There was a problem hiding this comment.
Maybe a label selector here too ? I suppose these configs can be shared across multiple workloads
|
|
||
| ```yaml | ||
| spec: | ||
| targetRef: |
There was a problem hiding this comment.
where needed, we should be able to use Duck-Typing together with a label selector
|
|
||
| #### Telemetry Instrumentation | ||
|
|
||
| Agent code must instrument itself with OpenTelemetry SDK. |
There was a problem hiding this comment.
Not sure how this can be accomplished - normally a developer would instrument the telemetry in the agent code, but in any case the agent cannot instrument itself - it's either injected somehow by the platform or by the agent developer.
There was a problem hiding this comment.
Yeah, poor use of words. What was meant is exactly as you say. It's developers job to instrument telemetry in an agent's code. Perhaps: A developer must instrument the telemetry in an agent's code usig OpenTelemetry SDK.
There was a problem hiding this comment.
Perhaps it may be helpful to distinguish the couple main parts like (1) span generation and (2) span export [to collector] and (3) span collection [actual collector maintenance], between agent developer and platform responsibility.
I assume most of the first two will both be expected of the agent developers with (2) "using OpenTelemetry SDK", and (1) ideally with GenAI semantic conventions directly
The platform can eventually help with various parts presumably such as collector transforms to aid with (1), and flexible configuration endpoints for (2). And based on current capabilities and the detailed AgentTrace proposal the platform will take care of (3) it seems?
| ### Open Questions | ||
|
|
||
| 1. **Namespace-scoped vs. Cluster-scoped CRs**: Should TokenExchange be namespace-scoped (current proposal) or cluster-scoped for multi-tenant scenarios? | ||
| 2. **Default identity provider**: Should we assume Keycloak or support pluggable providers from day one? |
There was a problem hiding this comment.
it would be great to abstract Keycloak as a IAM provider that implements OpenID Connect (OIDC) and OAuth 2.0 provider
| **Mitigation**: | ||
| - Deploy webhook with multiple replicas | ||
| - Use PodDisruptionBudgets | ||
| - Fail-closed is intentional (security-first approach) |
There was a problem hiding this comment.
Mentioned before, but does it mean that if the webhook is configured but it's down the deployment would fail?
There was a problem hiding this comment.
What happens in this scenario depends on the MutatingWebhookConfiguration configuration for the webhook in question. The failurePolicy field in the webhook configuration determines what happens when the webhook is unavailable
| **Risk**: ConfigMap changes may not propagate to all sidecar instances. | ||
|
|
||
| **Mitigation**: | ||
| - Sidecars use fsnotify for real-time ConfigMap watching |
There was a problem hiding this comment.
Should compare this to XDS for Envoy-based sidecars
| ### Update/Rollback Compatibility | ||
|
|
||
| **Forward Compatibility**: | ||
| - New pillar CRs are additive; existing workloads with `kagenti.io/inject` continue working |
There was a problem hiding this comment.
see previous comments for sidecar-based approaches
| - Validate works with Deployment, StatefulSet, Job | ||
| - Write migration documentation | ||
|
|
||
| **Phase 2: Adapt AgentCard** (Q1 2026) |
There was a problem hiding this comment.
we can always do the injection with platform wide config as per rossoctl/cortex#75
There was a problem hiding this comment.
Hello, I did a light once-over. I'm mostly curious if the webhook can be used to implement platform-wide defaults for all of the pillars. I find that the webhook being specifically for identity infra injection, and then there's also a TokenExchange thing to alter that injection a bit odd if it doesn't apply to other pillars. Would other pillars also want some definable default behavior?
| • Agent code exposes capabilities | ||
| ↓ | ||
| Optional: User Creates Pillar CRs | ||
| • TokenExchange → customize identity/auth |
There was a problem hiding this comment.
So the webhook-injected identity infrastructure has to do with token exchange as well. I am wondering if there's a reason to need both or should we be able to consolidate here?
There was a problem hiding this comment.
@maia-iyer, I agree that we should strive for symmetry and consistence by appling platform-wide defaults to all pillars. Perhaps a webhook can inject defaults via a configMap, Annotations, and Labels.
The latest webhook implementation in the kagenti-extensions is meant to inject both identity and token exchange sidecars.
|
|
||
| ### Motivation and Problem Space | ||
|
|
||
| An AI Agents PLatform needs to define a coherent set of capabilities for users operating fleets of AI agents. When exploring existing AgentOps frameworks, a key insight emerged: framing the problem as a single, general-purpose "Kubernetes AgentOps framework" is likely the wrong abstraction. |
There was a problem hiding this comment.
| An AI Agents PLatform needs to define a coherent set of capabilities for users operating fleets of AI agents. When exploring existing AgentOps frameworks, a key insight emerged: framing the problem as a single, general-purpose "Kubernetes AgentOps framework" is likely the wrong abstraction. | |
| An AI Agents Platform needs to define a coherent set of capabilities for users operating fleets of AI agents. When exploring existing AgentOps frameworks, a key insight emerged: framing the problem as a single, general-purpose "Kubernetes AgentOps framework" is likely the wrong abstraction. |
| │ • No pod restarts needed │ | ||
| └─────────────────────────────────────────────────────────┘ | ||
| ``` | ||
|
|
There was a problem hiding this comment.
I wonder if layer 1 can be generalized into "default platform-wide behavior"? if pod restarts are unavoidable as @pdettori says, this may be desired?
This will also fix the earlier comment I had where I think the functionality of webhook-injected identity and the TokenExchange CRD have too much overlap that we should combine them
rubambiza
left a comment
There was a problem hiding this comment.
I did a pass over all the sections, and I:
- Made suggestions for links where appropriate
- Made suggestions to content with links as appropriate
- Asked clarifying questions
Overall, I think the proposal is in good shape, and it will only improve with the existing comments. Please ignore any note to self comments.
|
|
||
| ## Summary/Abstract | ||
|
|
||
| This design proposal describes the refactoring of Kagenti from an inheritance-based architecture to a composition-based architecture for managing AI agent workloads on Kubernetes. The current monolithic `Agent` Custom Resource (CR) will be replaced with a two-layer system consisting of automatic identity infrastructure injection via mutating webhook and optional configuration through three independent pillar CRs: `TokenExchange`, `AgentTrace`, and `AgentCard`. |
There was a problem hiding this comment.
A link to the current definition of the Agent Custom Resource might be helpful context for noobs like me.
|
|
||
| 1. **Tight coupling to upstream Kubernetes changes** - Requires constant rebasing on K8s releases without substantial benefits | ||
| 2. **Responsibility for pass-through definitions** - Even when passing through PodSpec, Kagenti becomes responsible when something goes wrong in those definitions | ||
| 3. **Limited workload type support** - Only works with Deployments; cannot handle StatefulSets (essential for stateful agents with long-term memory), Jobs (ideal for one-shot agent runs), or CronJobs (scheduled agent executions) |
There was a problem hiding this comment.
Would the event-driven agents being pursued by Alek count as another example of CronJobs?
| **Key Design Decisions**: | ||
|
|
||
| - **Workload-level targeting**: Webhook watches Deployment/StatefulSet/Job, not Pods, enabling deterministic ConfigMap naming based on workload name | ||
| - **Explicit opt-in**: Each workload must have `kagenti.io/inject: enabled` and `kagenti.io/spiffe: enabled` labels to prevent accidental injection |
There was a problem hiding this comment.
kagenti.io/spiffe: enabled is missing in the above matchExpressions.
| configMapName: "weather-agent-trace" | ||
| ``` | ||
|
|
||
| **Note on Maturity**: This is a nascent area with limited prior work. The specification will evolve as observability standards for AI agents mature. |
There was a problem hiding this comment.
Agreed that it is nascent area. I would like to suggest linking to the Observability/auditing proposal in the upstream k8s community as a good place to track the evolution of.
| configMapName: "weather-agent-trace" | ||
| ``` | ||
|
|
||
| **Note on Maturity**: This is a nascent area with limited prior work. The specification will evolve as observability standards for AI agents mature. |
There was a problem hiding this comment.
| **Note on Maturity**: This is a nascent area with limited prior work. The specification will evolve as observability standards for AI agents mature. | |
| **Note on Maturity**: This is a nascent area with limited prior work. The specification will evolve as observability standards for AI agents mature. See [observability proposal](https://github.com/kubernetes-sigs/kube-agentic-networking/pull/33) in the k8s/CNCF community for example. |
There was a problem hiding this comment.
The particular linked PR is deliberately not about CRs/APIs for configuring telemetry i.e. the "APIs such as Kubernetes CRDs to allow users to configure traces and other observability data such as metrics and logs will be addressed in subsequent proposals."
Referencing standards to be discussed in the upstream community (https://github.com/kubernetes-sigs/kube-agentic-networking) I think would be appropriate but based on progress here vs. upstream, it is possible that parts of the AgentTrace CR are brought to the table there for discussion - we would ultimately want to make sure Kagenti aligns with decisions/standards made upstream.
|
|
||
| ``` | ||
| ┌────────────────────────────────────────────────────────┐ | ||
| │ Kagenti Operator Pod │ |
There was a problem hiding this comment.
Is this pod going to be namespace scoped? I am trying to understand if there won't be any issues creating things like ConfigMaps in other namespaces (e.g., kagenti-system).
| **Minimal Example**: | ||
|
|
||
| ```python | ||
| from opentelemetry import trace |
There was a problem hiding this comment.
I am trying to understand the mechanics here. Will this be running in a loop until the config map/path is populated? Is there an exit criteria when the agent is terminated?
| ## References | ||
|
|
||
| ### Failed Kubernetes Abstraction Projects | ||
| - kubernetes-sigs/application - Dormant Application CRD |
There was a problem hiding this comment.
Perhaps add some links for reference to better understand the architecture/goals and why/how they failed?
evaline-ju
left a comment
There was a problem hiding this comment.
Couple suggestions/comments mostly focused on the observability aspects
| 2. **Enable incremental adoption** - Each pillar can be adopted independently | ||
| 3. **Improve tool compatibility** - kubectl, dashboards, and GitOps continue working normally | ||
| 4. **Support multiple workload types** - StatefulSets for stateful agents, Jobs for one-shot runs, CronJobs for scheduled executions | ||
| 5. **Simplify removal** - If disabled/uninstalled, core workloads continue running |
There was a problem hiding this comment.
I think a word or phrase is missing for my understanding of this line. What is being disabled/uninstalled here? And what is "core" here?
| configMapName: "weather-agent-trace" | ||
| ``` | ||
|
|
||
| **Note on Maturity**: This is a nascent area with limited prior work. The specification will evolve as observability standards for AI agents mature. |
There was a problem hiding this comment.
The particular linked PR is deliberately not about CRs/APIs for configuring telemetry i.e. the "APIs such as Kubernetes CRDs to allow users to configure traces and other observability data such as metrics and logs will be addressed in subsequent proposals."
Referencing standards to be discussed in the upstream community (https://github.com/kubernetes-sigs/kube-agentic-networking) I think would be appropriate but based on progress here vs. upstream, it is possible that parts of the AgentTrace CR are brought to the table there for discussion - we would ultimately want to make sure Kagenti aligns with decisions/standards made upstream.
| 3. **Keep surface area small** - Focus on integration points, not comprehensive workload management | ||
| 4. **Provide non-intrusive injection** - Automatic identity infrastructure via opt-in webhook | ||
| 5. **Enable independent pillar adoption** - Each CR can be used separately | ||
| 6. **Support dynamic reconfiguration** - Configuration changes without pod restarts |
There was a problem hiding this comment.
From the language I was wondering how broadly this can be applied as well, since some changes for receivers I thought would require OpenTelemetry collector restart?
|
|
||
| #### Telemetry Instrumentation | ||
|
|
||
| Agent code must instrument itself with OpenTelemetry SDK. |
There was a problem hiding this comment.
Perhaps it may be helpful to distinguish the couple main parts like (1) span generation and (2) span export [to collector] and (3) span collection [actual collector maintenance], between agent developer and platform responsibility.
I assume most of the first two will both be expected of the agent developers with (2) "using OpenTelemetry SDK", and (1) ideally with GenAI semantic conventions directly
The platform can eventually help with various parts presumably such as collector transforms to aid with (1), and flexible configuration endpoints for (2). And based on current capabilities and the detailed AgentTrace proposal the platform will take care of (3) it seems?
|
@cwiklik what is the status on this work? |
|
Sorry, I only briefly touched the proposal (so I could completely missed some things) but is it true that three different ways for selecting workloads to instrument/enhance are proposed:
If this is the case, it is really puts quite some cognitive load on the platform engineers to manage this. A platform engineer who wants to attach all three concerns to a workload has to use all three mechanisms. Wouldn't it be easier to settle on one mechanism ? |
Ladas
left a comment
There was a problem hiding this comment.
The approach looks reasonable for me. I suppose my main interest will be the AgentTrace and figuring out the right setup. (which i am learning through mergeable POCs :-) )
|
Status: to be discussed with Red Hat partners on Tuesday, February 24th. |
|
Closing in favor of #770 |
Summary
This PR introduces the design proposal for refactoring Kagenti from an inheritance-based architecture to a composition-based architecture. The proposal replaces the monolithic Agent Custom Resource with a two-layer system consisting of automatic identity infrastructure injection via mutating webhook and optional configuration through three independent pillar CRs.
Motivation
The current Kagenti architecture uses the inheritance pattern (embedding PodSpec in a custom Agent CR), which has proven problematic:
Historical analysis shows that higher-level Kubernetes abstractions that replace standard workload types consistently fail (Knative, OAM, Appsody, DeploymentConfig), while composition-based approaches succeed (KEDA, Flagger, Prometheus Operator, cert-manager).
Proposed Changes
Two-Layer Architecture:
Layer 1: Automatic Identity Infrastructure (Webhook)
Layer 2: Optional Configuration & Discovery (Pillar CRs)
Key Benefits:
Related issue(s):
rossoctl/cortex#97
Fixes #560