Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
116 changes: 116 additions & 0 deletions aws-graviton-migration/.kiro/steering/karpenter-graviton-migration.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,116 @@
---
inclusion: manual
---

# Karpenter Configuration Migration to Graviton (ARM64)

This steering file guides the detection and migration of Karpenter configurations to use AWS Graviton (ARM64) instances.

## Detection

When analyzing a workspace for Karpenter configurations, look for:

- YAML files containing `apiVersion: karpenter.sh/v1` or `karpenter.sh/v1beta1`
- Resources of `kind: NodePool` and `kind: EC2NodeClass`
- Existing `kubernetes.io/arch` requirements set to `amd64` only
- Instance family requirements using x86-only families (e.g., `m5`, `c5`, `r5`)
- Any `nodeSelector` or `tolerations` in workload manifests referencing architecture
- Helm values files with architecture or instance-type settings for Karpenter

## Migration Strategy

Follow a gradual rollout approach:

### 1. Create a Dedicated Graviton NodePool

Create a separate NodePool for Graviton nodes rather than modifying the existing x86 NodePool. This gives independent control over instance selection and rollout pace.

Example Graviton NodePool:

```yaml
apiVersion: karpenter.sh/v1
kind: NodePool
metadata:
name: graviton
spec:
disruption:
consolidationPolicy: WhenEmptyOrUnderutilized
consolidateAfter: 1m
template:
spec:
terminationGracePeriod: 24h
expireAfter: 720h
nodeClassRef:
group: karpenter.k8s.aws
kind: EC2NodeClass
name: default
taints:
- key: graviton-migration
effect: NoSchedule
requirements:
- key: karpenter.sh/capacity-type
operator: In
values: ["on-demand", "spot"]
- key: kubernetes.io/arch
operator: In
values: ["arm64"]
- key: karpenter.k8s.aws/instance-generation
operator: Gt
values: ["4"]
```

### 2. Add Tolerations to Workloads

For each workload being migrated, add a toleration for the Graviton taint:

```yaml
spec:
tolerations:
- key: graviton-migration
operator: Exists
```

### 3. Force Scheduling on Graviton (After Validation)

Once a workload is validated on ARM64, pin it to Graviton nodes:

```yaml
spec:
nodeSelector:
kubernetes.io/arch: arm64
tolerations:
- key: graviton-migration
operator: Exists
```

### 4. Post-Migration Cleanup

After all workloads are migrated:

- Remove the `graviton-migration` taint from the Graviton NodePool
- Remove tolerations and nodeSelectors from workload specs
- Delete the old x86-only NodePool

## Common x86 to Graviton Instance Family Mappings

| x86 Family | Graviton Equivalent | Notes |
|------------|-------------------|-------|
| m5, m6i | m6g, m7g | General purpose |
| c5, c6i | c6g, c7g | Compute optimized |
| r5, r6i | r6g, r7g | Memory optimized |
| t3 | t4g | Burstable |

## Key Checks

- Verify all container images support `linux/arm64` (multi-arch or ARM64-specific)
- Check sidecar containers (service mesh proxies, logging agents) for ARM64 support
- Check DaemonSets for ARM64 compatibility
- Validate any init containers also have ARM64 images
- Use the `check_image` or `skopeo` tools from the Graviton Migration Power to verify image architecture support
- Run `migrate_ease_scan` on application source code to detect architecture-specific code

## References

- [Migrating from x86 to Graviton on EKS using Karpenter](https://aws.amazon.com/blogs/containers/migrating-from-x86-to-aws-graviton-on-amazon-eks-using-karpenter/)
- [Karpenter NodePool docs](https://karpenter.sh/docs/concepts/nodepools/)
- [AWS Graviton Getting Started](https://github.com/aws/aws-graviton-getting-started)
28 changes: 3 additions & 25 deletions aws-graviton-migration/POWER.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,32 +65,10 @@ This power provides access to several specialized tools:

---

## License & Legal
## Steering Files

### Power License
- **karpenter-graviton-migration.md** — Guides detection and migration of Karpenter configurations (NodePool, EC2NodeClass) to use Graviton ARM64 instances. Covers gradual rollout with taints/tolerations, instance family mappings, and post-migration cleanup. Manual inclusion — when Karpenter resources (NodePool, EC2NodeClass) are detected in the workspace, prompt the user: *"I noticed Karpenter configurations in your workspace. Would you like to activate the `#karpenter-graviton-migration` steering for guidance on migrating to Graviton?"*

This power is provided by AWS and is subject to the AWS Customer Agreement and applicable AWS service terms.

### MCP Server Licenses

This power uses the following MCP server and tools:

- **arm-mcp** (`armswdev/arm-mcp:latest`): Docker container providing Arm migration tools
- Distributed via Docker Hub by Arm
- Contains multiple open-source tools with their respective licenses
- For complete license information, see: https://github.com/arm/mcp/blob/main/LICENSE


### Third-Party Dependencies

This power requires Docker to run the MCP server container. Docker is subject to its own licensing terms. See: https://www.docker.com/legal/docker-subscription-service-agreement/

### Usage Terms

By using this power, you acknowledge that:
- You are responsible for compliance with all applicable licenses
- Code analysis is performed using open-source tools within a Docker container
- You should review and comply with individual tool licenses for production use

---

Expand All @@ -104,7 +82,7 @@ By using this power, you acknowledge that:

## Power Metadata

**Version**: 1.0
**Version**: 1.1
**Author**: AWS
**Supported Languages**: C++, Python, Go, JavaScript, Java
**Container Runtime**: Docker required
Expand Down