Skip to content

Conversation

@Ronit-Raj9
Copy link
Contributor

Summary

This PR adds comprehensive resource configuration support for all MCP tools and agents deployed by Kagent, addressing production environment requirements and security compliance needs.

Changes Made

Core Infrastructure

  • Agent CRD Enhancement: Added Resources field to SharedDeploymentSpec in agent_types.go
  • Translator Updates: Modified adk_api_translator.go to use configurable resources with sensible defaults
  • CRD Regeneration: Updated generated CRDs to include the new Resources field

MCP Tools Configuration

  • grafana-mcp: Added resource config (100m/128Mi requests, 500m/512Mi limits)
  • querydoc: Added resource config (100m/128Mi requests, 500m/512Mi limits)
  • kagent-tools: Added resource config (100m/256Mi requests, 1000m/1Gi limits)

Agent Configuration

Added resource configurations for all 10 agents:

  • k8s-agent: 100m/256Mi requests, 1000m/1Gi limits
  • kgateway-agent: 100m/256Mi requests, 1000m/1Gi limits
  • istio-agent: 100m/256Mi requests, 1000m/1Gi limits
  • promql-agent: 100m/256Mi requests, 1000m/1Gi limits
  • observability-agent: 100m/256Mi requests, 1000m/1Gi limits
  • argo-rollouts-agent: 100m/256Mi requests, 1000m/1Gi limits
  • helm-agent: 100m/256Mi requests, 1000m/1Gi limits
  • cilium-policy-agent: 100m/256Mi requests, 1000m/1Gi limits
  • cilium-manager-agent: 100m/256Mi requests, 1000m/1Gi limits
  • cilium-debug-agent: 100m/256Mi requests, 1000m/1Gi limits

Benefits

  • ✅ Production-ready resource management
  • ✅ Security compliance for resource scanning tools
  • ✅ Configurable via Helm values for different environments
  • ✅ Backward compatible with sensible defaults
  • ✅ Consistent resource allocation across all components

Testing

  • Verified Helm template rendering with new resource configurations

Fixes #897

@Ronit-Raj9 Ronit-Raj9 requested a review from EItanya as a code owner September 16, 2025 22:26
Copilot AI review requested due to automatic review settings September 16, 2025 22:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds comprehensive resource configuration support for all MCP tools and agents deployed by Kagent, addressing production environment requirements and security compliance needs.

  • Enhances Agent CRD with optional Resources field in SharedDeploymentSpec
  • Adds resource configurations to all MCP tools (grafana-mcp, querydoc, kagent-tools) and 10 agents
  • Updates translator logic to use configurable resources with fallback defaults

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
go/api/v1alpha2/agent_types.go Adds Resources field to SharedDeploymentSpec
go/internal/controller/translator/adk_api_translator.go Updates resource assignment logic with configurable support
helm/kagent/values.yaml Adds resource configs for kagent-tools and all 10 agents
helm/tools/grafana-mcp/values.yaml Adds resource configuration for grafana-mcp tool
helm/agents/*/values.yaml Adds resource configurations to individual agent charts
helm/agents/*/templates/agent.yaml Updates agent templates to include resource specs
go/config/crd/bases/*.yaml Updates CRD definitions with Resources field
helm/kagent-crds/templates/*.yaml Updates Helm-templated CRDs
Comments suppressed due to low confidence (1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

memory: 512Mi

querydoc:
replicas: 1
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing resource configuration for the querydoc tool. Based on the PR description mentioning querydoc should have 100m/128Mi requests and 500m/512Mi limits, this configuration appears incomplete.

Copilot uses AI. Check for mistakes.
Comment on lines 10 to 13
names:
categories:
- kagent
kind: ModelConfig
Copy link

Copilot AI Sep 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removal of the 'categories' field appears unrelated to the resource configuration feature. This change should be documented or moved to a separate commit as it affects the CRD categorization without clear justification in this PR.

Copilot uses AI. Check for mistakes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added back this part of code.

Copy link
Contributor

@EItanya EItanya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for the changes :). Just a few comments

Comment on lines 10 to 13
names:
categories:
- kagent
kind: ModelConfig
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed

agentRef := types.NamespacedName{
Namespace: agent.Namespace,
Name: tool.Agent.Name,
// Parse the agent reference (supports both "name" and "namespace/name")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah fixed this one too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know if there is any thing more to modify. With this latest amended commit I feel all the issues has been fixed.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Copilot reviewed 13 out of 13 changed files in this pull request and generated no new comments.

Comments suppressed due to low confidence (1)

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@EItanya
Copy link
Contributor

EItanya commented Sep 18, 2025

Why have you added helm chart support to only some of the agent charts? If we are going to add it to the charts we should add it to all of them

@Ronit-Raj9
Copy link
Contributor Author

Why have you added helm chart support to only some of the agent charts? If we are going to add it to the charts we should add it to all of them

Thanks for the feedback! You're right - I should be consistent and add helm chart support to all agent charts, not just some of them. This was more of a proof-of-concept to validate the approach and get your input on whether I'm heading in the right direction.

I'll definitely add the resource configurations to all remaining agent charts to ensure consistency across the entire project.

- Add Resources field to Agent CRD SharedDeploymentSpec
- Update translator to use configurable resources with fallback defaults
- Add resource configurations to all MCP tools (grafana-mcp, querydoc, kagent-tools)
- Add resource configurations to all agents (k8s, istio, helm, etc.)
- Regenerate CRDs with new Resources field
- Enable production-ready resource management and security compliance
- Refactor inline function to helper function to avoid code duplication

Fixes kagent-dev#897

Signed-off-by: Ronit <ronitk964@gmail.com>
@Ronit-Raj9
Copy link
Contributor Author

Ronit-Raj9 commented Sep 18, 2025

Now, I have added helm chart support to all the agents and tool. Do let me if there is any thing more to update. If there are no further updates needed, we can proceed with merging this PR. All feedback has been addressed and the feature is ready for production use.

Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
@EItanya EItanya merged commit 79381db into kagent-dev:main Sep 19, 2025
15 of 16 checks passed
krisztianfekete pushed a commit to krisztianfekete/kagent that referenced this pull request Sep 23, 2025
…gent-dev#902)

## Summary
This PR adds comprehensive resource configuration support for all MCP
tools and agents deployed by Kagent, addressing production environment
requirements and security compliance needs.

## Changes Made

### Core Infrastructure
- **Agent CRD Enhancement**: Added `Resources` field to
`SharedDeploymentSpec` in `agent_types.go`
- **Translator Updates**: Modified `adk_api_translator.go` to use
configurable resources with sensible defaults
- **CRD Regeneration**: Updated generated CRDs to include the new
Resources field

### MCP Tools Configuration
- **grafana-mcp**: Added resource config (100m/128Mi requests,
500m/512Mi limits)
- **querydoc**: Added resource config (100m/128Mi requests, 500m/512Mi
limits)
- **kagent-tools**: Added resource config (100m/256Mi requests,
1000m/1Gi limits)

### Agent Configuration
Added resource configurations for all 10 agents:
- **k8s-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **kgateway-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **istio-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **promql-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **observability-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **argo-rollouts-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **helm-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **cilium-policy-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **cilium-manager-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **cilium-debug-agent**: 100m/256Mi requests, 1000m/1Gi limits

## Benefits
- ✅ Production-ready resource management
- ✅ Security compliance for resource scanning tools
- ✅ Configurable via Helm values for different environments
- ✅ Backward compatible with sensible defaults
- ✅ Consistent resource allocation across all components

## Testing
- Verified Helm template rendering with new resource configurations

Fixes kagent-dev#897

---------

Signed-off-by: Ronit <ronitk964@gmail.com>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Co-authored-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: krisztianfekete <git@krisztianfekete.org>
krisztianfekete pushed a commit to krisztianfekete/kagent that referenced this pull request Sep 23, 2025
…gent-dev#902)

## Summary
This PR adds comprehensive resource configuration support for all MCP
tools and agents deployed by Kagent, addressing production environment
requirements and security compliance needs.

## Changes Made

### Core Infrastructure
- **Agent CRD Enhancement**: Added `Resources` field to
`SharedDeploymentSpec` in `agent_types.go`
- **Translator Updates**: Modified `adk_api_translator.go` to use
configurable resources with sensible defaults
- **CRD Regeneration**: Updated generated CRDs to include the new
Resources field

### MCP Tools Configuration
- **grafana-mcp**: Added resource config (100m/128Mi requests,
500m/512Mi limits)
- **querydoc**: Added resource config (100m/128Mi requests, 500m/512Mi
limits)
- **kagent-tools**: Added resource config (100m/256Mi requests,
1000m/1Gi limits)

### Agent Configuration
Added resource configurations for all 10 agents:
- **k8s-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **kgateway-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **istio-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **promql-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **observability-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **argo-rollouts-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **helm-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **cilium-policy-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **cilium-manager-agent**: 100m/256Mi requests, 1000m/1Gi limits
- **cilium-debug-agent**: 100m/256Mi requests, 1000m/1Gi limits

## Benefits
- ✅ Production-ready resource management
- ✅ Security compliance for resource scanning tools
- ✅ Configurable via Helm values for different environments
- ✅ Backward compatible with sensible defaults
- ✅ Consistent resource allocation across all components

## Testing
- Verified Helm template rendering with new resource configurations

Fixes kagent-dev#897

---------

Signed-off-by: Ronit <ronitk964@gmail.com>
Signed-off-by: Eitan Yarmush <eitan.yarmush@solo.io>
Co-authored-by: Eitan Yarmush <eitan.yarmush@solo.io>
Signed-off-by: krisztianfekete <git@krisztianfekete.org>
@artberger artberger mentioned this pull request Oct 29, 2025
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Support resources settings for MCP tools installed by default by Kagent in Helm chart

3 participants