| name | eks-to-agentcore |
| description | Guide for migrating AI agents from Amazon EKS to Amazon Bedrock AgentCore. Use when assessing EKS agent workloads for migration, scaffolding AgentCore projects, generating entrypoint code, configuring CI/CD pipelines, or understanding the EKS-to-AgentCore feature mapping. Works with the eks-to-agentcore MCP server for live cluster scanning and automated assessment. |
| license | MIT-0 — see LICENSE in the repository root |
| compatibility | Requires eks-to-agentcore MCP server for cluster scanning. Python 3.10+, Node.js 20+ for AgentCore CLI. |
EKS to AgentCore Migration Guide
Overview
Migrate AI agents from Amazon EKS (containerized Kubernetes workloads) to Amazon Bedrock AgentCore (serverless, purpose-built agent runtime). This skill provides the domain knowledge to guide the migration end-to-end, from assessment through cutover.
AgentCore eliminates Kubernetes infrastructure management by providing a fully managed runtime with built-in session isolation (microVMs), memory, identity, observability, and consumption-based pricing.
Process
Phase 1: Assess
- Identify agent workloads on EKS — use
scan_eks_cluster MCP tool or kubectl get deployments
- For each agent, evaluate:
- Python version (must be 3.10+)
- Framework (Strands, LangChain, LangGraph, CrewAI, Google ADK, OpenAI Agents, or custom)
- External dependencies (databases, APIs, caches)
- Kubernetes-specific dependencies (PVCs, Secrets, ConfigMaps, HPA, service mesh)
- Entrypoint file (AgentCore expects
main.py)
- Use
assess_agent or assess_cluster MCP tools for automated assessment
- Prioritize: start with low-complexity agents (supported framework, no PVCs, no custom networking)
Phase 2: Scaffold
- Install AgentCore CLI:
npm install -g @aws/agentcore
- Create project:
agentcore create --name <AgentName> --defaults
- Use
generate_agentcore_project MCP tool for customized scaffold commands
- Choose build type:
- CodeZip (default, recommended) — no Dockerfile needed
- Container — only if agent has heavy system-level dependencies (CUDA, custom native libs)
Phase 3: Migrate Code
- Copy agent source to
app/<AgentName>/
- Create
main.py with AgentCore Runtime wrapper — use generate_main_py MCP tool
- The wrapper pattern for Strands agents:
from strands import Agent
from bedrock_agentcore.runtime import BedrockAgentCoreApp
agent = Agent(model="...", system_prompt="...", tools=[...])
app = BedrockAgentCoreApp()
@app.entrypoint
def invoke(payload):
response = agent(payload.get("prompt", ""))
return response.message["content"][0]["text"]
if __name__ == "__main__":
app.run()
- Update
pyproject.toml — remove K8s-specific deps (gunicorn, uvicorn, kubernetes client)
- Remove web framework serving code (Flask/FastAPI) — AgentCore handles HTTP natively
Phase 4: Migrate Configuration
- Secrets →
agentcore add credential --name <svc> --api-key <key> or --type oauth
- ConfigMaps/env vars →
agentcore.json configuration
- Networking:
- Internet-only APIs →
"networkMode": "PUBLIC" (default)
- Private resources (RDS, ElastiCache) →
"networkMode": "VPC"
- Memory/state (Redis, DynamoDB) →
agentcore add memory --strategies SEMANTIC,SUMMARIZATION
- IRSA → AgentCore Identity (CDK creates execution roles automatically)
Phase 5: Test & Deploy
- Test locally:
agentcore dev then agentcore dev "test prompt"
- Preview:
agentcore deploy --plan
- Deploy:
agentcore deploy
- Verify:
agentcore status and agentcore invoke --runtime <AgentName> "test"
- Set up CI/CD — use
generate_cicd_pipeline MCP tool
Phase 6: Cutover
- Run both EKS and AgentCore agents in parallel
- Route traffic gradually using weighted routing
- Monitor via
agentcore logs and agentcore traces list
- After validation, scale down EKS:
kubectl scale deployment <name> --replicas=0
- Clean up K8s resources (Deployment, Service, Ingress, HPA, Secrets, ConfigMaps)
Key Decisions
| Decision | Recommendation |
|---|
| Build type | CodeZip unless you need CUDA/GPU or custom native libraries |
| Network mode | PUBLIC for internet APIs, VPC for private resources (RDS, ElastiCache) |
| Framework | Strands has the smoothest migration path; LangChain/LangGraph supported; custom needs service contract |
| Memory | Use AgentCore Memory to replace Redis/DynamoDB session state |
| CI/CD | agentcore deploy replaces Docker build + ECR push + kubectl apply |
Common Pitfalls
- AgentCore Memory is NOT available during local dev (
agentcore dev). Deploy first to test memory.
- Entrypoint must be
main.py (or configured in agentcore.json)
- Remove Flask/FastAPI/uvicorn — AgentCore Runtime handles HTTP serving
- Extended execution supports up to 8 hours. Decompose longer workloads.
- First deployment takes a few minutes while CDK bootstraps your account
- EKS tokens expire every ~15 minutes. Refresh with
aws eks update-kubeconfig
MCP Tools Reference
This skill works with the eks-to-agentcore MCP server. Available tools:
| Tool | Purpose |
|---|
scan_eks_cluster | Discover AI agent deployments on EKS (specify namespace for least privilege) |
assess_agent | Assess a single agent for migration compatibility |
assess_cluster | Full cluster scan + assessment report |
generate_agentcore_project | Generate agentcore CLI scaffold commands |
generate_cicd_pipeline | Generate CodeBuild or GitHub Actions pipeline config |
generate_main_py | Generate ready-to-use main.py with AgentCore Runtime wrapper |
get_eks_agentcore_feature_map | EKS-to-AgentCore feature mapping and cleanup checklist |
Guidelines
- Always specify a namespace when scanning (
scan_eks_cluster(namespace="agents")) to follow least-privilege principles
- Env var values are never captured — only names are used for heuristic analysis
- Start with the simplest agent (low complexity) as a pilot migration
- Use CodeZip build type unless you have a specific reason for Container
- Keep the EKS agent running in standby for 1-2 weeks after cutover as a rollback option
- Use
agentcore deploy --plan before every deployment to preview changes