aws-samples / aws-samples/appmod-blueprints
feat(kro): add container resources (requests/limits) to AppmodService RGD schema
- Dominant language
- Shell
- Stars
- 105
- Forks
- 62
- Avg merge
- 11h 17m
- Merged PRs (30d)
- 76
Description
## Problem
The `AppmodService` ResourceGraphDefinition does not support container resource requests/limits in its schema. Users cannot specify CPU/memory for their application containers.
The `applications/next-js/deployment/dev/application.yaml` had a `spec.resources` field that was ignored by KRO because it is not in the schema.
## Current Schema Fields
```
accountId, apiBaseUrl, clusterName, components, env, functionalGate,
image, image_name, ingress, metrics, performanceGate, port, replicas,
serviceAccount, targetPort
```
## Proposed Change
Add `resources` to the schema:
```yaml
resources:
requests:
cpu: string | default="100m"
memory: string | default="256Mi"
limits:
cpu: string | default=""
memory: string | default="512Mi"
```
And propagate it in the Rollout container spec:
```yaml
containers:
- name: ${schema.spec.image_name}
image: ${schema.spec.image}
resources:
requests:
cpu: ${schema.spec.resources.requests.cpu}
memory: ${schema.spec.resources.requests.memory}
limits:
memory: ${schema.spec.resources.limits.memory}
```
## Files to Modify
- `gitops/addons/charts/kro/resource-groups/manifests/appmod-service.yaml`
## References
- Related to PR #709
Contributor guide
Research direction
Start with gitops/addons/charts/kro/resource-groups/manifests/appmod-service.yaml and inspect the existing AppmodService schema and Rollout container definition. Add the specified resources fields and propagate requests and limits there. Done means users can set CPU and memory resources in spec.resources and the resulting container specification receives them with the stated defaults.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kubernetes
- Domain
- infrastructure
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Clearly specified
- Newbie friendliness
- 78/100