Kubernetes Resource Requests in charmcraft.yaml
Metadata
Current evaluation
Valid feature request for charm-declared default container CPU and memory requests; maintainers acknowledge it but say Juju-side support and a cross-project design are required.
Suggested action: keep open
Reason: Maintainer @lengau called the proposal "perfectly reasonable," while @hpidcock explained that it requires Juju-side work and an agreed design and requested a juju/juju feature request. The request remains valid, but it is blocked on metadata handling and deployment semantics rather than ready for implementation in Charmcraft alone.
Evaluated by: mr-cal-bot
Impact:
57
Quick Win:
4
Complexity:
82
Confidence:
94
Actionability:
43
Issue body
### What needs to get done
Propose to enable defining default [kubernetes resource requests](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/) in charmcraft.yaml such that charm developers may define their own reasonable default values. E.g. have a `default-requests` field inside `containers` [field in charmcraft.yaml](https://canonical-charmcraft.readthedocs-hosted.com/en/stable/reference/files/charmcraft-yaml-file/#containers)
Extending the existing example:
```yaml
containers:
super-app:
resource: super-app-image
mounts:
- storage: logs
location: /logs
default-requests:
cpu: "500m"
memory: "1024Mi"
```
This would define the resource requests used by the charm unless overridden during `juju deploy` by constraints.
### Why it needs to get done
Kubernetes assigns pods to nodes based on resource availability. Currently, the resource requests are only set by Juju when performing `juju deploy` with constraints. E.g. `juju deploy charm-1 --constraints="cores=1 mem=2G"`
per the [mentioned Kubernetes documentation](https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/):
> When you specify the resource request for containers in a Pod, the [kube-scheduler](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-scheduler/) uses this information to decide which node to place the Pod on.
Note that limits could also be configured, although I see this as less useful to define by the charm developer
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha |
Impact:
57
Quick Win:
4
Complexity:
82
Confidence:
94
Actionability:
43
|
keep open | Valid feature request for charm-declared default container CPU and memory requests; maintainers acknowledge it but say Juju-side support and a cross-project design are required. | |
| qwen/qwen3.6-35b-a3b |
Impact:
30
Quick Win:
5
Complexity:
60
Confidence:
85
Actionability:
40
|
close not a bug | Feature request to add default-requests field in charmcraft.yaml for Kubernetes resource requests. Maintainers indicated this requires Juju-side changes and asked reporter to file on juju/juju instead. | |
| qwen/qwen3.8-27b |
Impact:
50
Quick Win:
15
Staleness:
65
Complexity:
70
Confidence:
75
Support Request:
10
|
keep open | Feature request to add a default-requests field to containers in charmcraft.yaml so charm authors can set Kubernetes CPU/memory resource requests. Maintainers confirmed it requires Juju-side support and asked the reporter to file a tracking request in juju/juju; no implementation exists in charmcraft. | |
| qwen/qwen3.6-35b-a3b |
Staleness:
85
Complexity:
10
Confidence:
95
Support Request:
10
|
close not a bug | Feature request to define default Kubernetes resource requests in charmcraft.yaml. Maintainers declined, noting it requires Juju-side changes and redirected the author to the juju/juju repository. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
85
Complexity:
20
Confidence:
90
Support Request:
10
|
close not a bug | Feature request to add default Kubernetes resource requests to charmcraft.yaml. Maintainers acknowledged the request but noted it requires Juju-side changes and directed the author to file a feature request in the juju/juju repository instead. | |
| qwen3.6-35b-a3b-mtp-q6 |
Staleness:
75
Complexity:
20
Confidence:
90
Support Request:
10
|
close not a bug | Feature request to add default Kubernetes resource requests to charmcraft.yaml. Maintainers confirmed this requires upstream Juju changes and redirected it to juju/juju. The issue has been inactive for over 10 months. |
Update history
No update history recorded yet.
Related issues
No related issues found above the similarity threshold.