Repository navigation
🌱 Refactor Kagenti UI to use standard Kubernetes workloads instead of Agent CRD - #545
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request refactors the Kagenti UI to use standard Kubernetes workloads (Deployments, StatefulSets, Jobs) instead of the custom Agent CRD, removing the dependency on kagenti-operator for agent deployment. This is a significant architectural change that aims to improve portability and leverage standard Kubernetes primitives.
Changes:
- Added comprehensive backend support for managing Deployments, StatefulSets, Jobs, and Services directly through Kubernetes APIs
- Implemented migration tooling (CLI script and API endpoints) to convert existing Agent CRDs to Deployments
- Updated frontend to display workload type information and handle multiple workload types with appropriate status indicators
- Added RBAC permissions for workload management and updated CI/CD workflows to use the new deployment approach
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 28 comments.
Show a summary per file
| File | Description |
|---|---|
kagenti/backend/app/services/kubernetes.py |
Added AppsV1Api and BatchV1Api clients with CRUD methods for Deployments, Services, StatefulSets, and Jobs |
kagenti/backend/app/routers/agents.py |
Refactored agent endpoints to create/manage workloads directly; added migration endpoints for Agent CRD to Deployment conversion |
kagenti/backend/app/core/constants.py |
Added workload type constants and migration-related annotations |
kagenti/backend/app/core/config.py |
Added enable_legacy_agent_crd setting for backward compatibility during migration period |
kagenti/backend/app/models/responses.py |
Added workloadType field to AgentSummary response model |
kagenti/tools/migrate_agents.py |
New CLI tool for migrating Agent CRDs to Deployments with dry-run support |
kagenti/backend/tests/test_migration.py |
Unit tests for migration manifest builders |
kagenti/ui-v2/src/types/index.ts |
Added WorkloadType, DeploymentStatus, ServiceInfo, and ContainerSpec interfaces |
kagenti/ui-v2/src/services/api.ts |
Added workloadType field to agent creation request |
kagenti/ui-v2/src/pages/AgentCatalogPage.tsx |
Added workload type column and updated status badge rendering |
kagenti/ui-v2/src/pages/AgentDetailPage.tsx |
Enhanced detail view with workload type, replica info, and service information |
kagenti/ui-v2/src/pages/ImportAgentPage.tsx |
Added workload type selector with helper text |
charts/kagenti/templates/ui.yaml |
Added RBAC permissions for Deployments, StatefulSets, Jobs, and Services |
.github/workflows/e2e-kind.yaml |
Updated comments to reflect new deployment approach |
.github/scripts/kagenti-operator/74-deploy-weather-agent.sh |
Modified to deploy using Deployment + Service instead of Agent CRD |
.github/scripts/kagenti-operator/41-wait-crds.sh |
Removed Agent CRD from required CRDs list |
docs/plans/migrate-agent-crd-to-workloads.md |
Comprehensive migration plan documentation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@pdettori Is there anyone on the team you'd like to take a look at (maybe a subset?) of the 5000+ changes? I'd be willing to kick the tires as usual if given instructions 😃 |
|
How to test:
|
|
@rubambiza ^^^ some instructions if you wan to try |
|
@pdettori I can deploy weather agent and tool both from source and image. When I delete (agent or tool), echo the name and confirm delete, I still see the agent (or tool) listed. I have to refresh to see it gone. |
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
…d forms Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]> Co-authored-by: Copilot <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]> Co-authored-by: Copilot <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]> Co-authored-by: Copilot <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]> Co-authored-by: Copilot <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]> Co-authored-by: Copilot <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]> Co-authored-by: Copilot <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]> Co-authored-by: Copilot <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
…Sets, Jobs, and Services Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
Signed-off-by: Paolo Dettori <[email protected]>
…API) Signed-off-by: Paolo Dettori <[email protected]>
|
@pdettori A couple of things I noticed:
|
|
@rubambiza thanks for your feedback. Re kind cluster - this is unrelated to this PR, there is an open issue in #491 which we should address independently. As for the helm command - the installation instructions ask to create that file from the template. |
cwiklik
left a comment
There was a problem hiding this comment.
Installed from the PR
Was able to deploy a weather agent and MCP tool, and use a prompt to ask for weather which worked.
lgtm
rubambiza
left a comment
There was a problem hiding this comment.
Tested the installation with the refactored code. LGTM.



Summary
This pull request refactors the Kagenti UI to use standard Kubernetes workloads (Deployments, StatefulSets, Jobs) instead of the custom Agent CRD, removing the dependency on kagenti-operator for agent deployment. This is a significant architectural change that aims to improve portability and leverage standard Kubernetes primitives.
##Changes:
Target Architecture
Benefits
3. Label Standards
Required Labels (All Workloads)
All agent workloads (Deployment, StatefulSet, Job) and their managed Pods MUST have:
kagenti.io/typeagentapp.kubernetes.io/name<agent-name>kagenti.io/protocola2aRecommended Labels
app.kubernetes.io/managed-bykagenti-uiapp.kubernetes.io/componentagentkagenti.io/framework<framework>kagenti.io/workload-typedeploymentPhases
Related issue(s)
Fixes #544