← Back to issue list

Kubernetes Resource Requests in charmcraft.yaml

View original Github issue

Metadata

Project
charmcraft
Number
#2211
Type
issue
State
open
Author
alexdlukens
Labels
Created
Updated
Closed

Current evaluation

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.

Suggested action: keep open

Reason: Maintainers actively triaged this on 2025-03-06: @lengau noted Charmcraft cannot do this without Juju providing a way to read hints from metadata.yaml, and @hpidcock asked the reporter to raise a feature request on juju/juju to track it there. The request is valid and cross-project, so it should stay open pending the Juju-side design, though it is blocked on external work.

Impact: 50 Quick Win: 15.0 Staleness: 65 Complexity: 70 Confidence: 75 Support Request: 10

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
qwen/qwen3.8-27b
Impact: 50
Quick Win: 15.0
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.
qwen3.6-35b-a3b-mtp-q6
Staleness: 85
Complexity: 60
Confidence: 85
Support Request: 10
close stale Proposes adding default Kubernetes resource requests to charmcraft.yaml for pod scheduling. Requires Juju-side implementation and metadata standardization. Currently awaiting design; author redirected to file a feature request on juju/juju.

Update history

No update history recorded yet.

Related issues

No related issues found above the similarity threshold.