Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

play kube: container resources (cpu, memory) do not have defaults #13115

Closed
ydayagi opened this issue Feb 2, 2022 · 3 comments · Fixed by #13157
Closed

play kube: container resources (cpu, memory) do not have defaults #13115

ydayagi opened this issue Feb 2, 2022 · 3 comments · Fixed by #13157
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@ydayagi
Copy link
Contributor

ydayagi commented Feb 2, 2022

/kind bug

Description
k8s container resources seem to have defaults. For memory, it is entire appliance memory. For CPU it is all CPUs. Executing 'play kube' with kind Pod shows that our defaults are '0'. I think we should set defaults as k8s does so 'play kube' will be consistent with k8s. Features such as setting env vars from resource values will not function properly.

Output of podman version:
using latest podman code

Client:       Podman Engine
Version:      4.0.0-dev
API Version:  4.0.0-dev
Go Version:   go1.16.8
Git Commit:   2ceab119478502fd06703036bc79953ed6f37f74-dirty
Built:        Wed Feb  2 16:59:29 2022
OS/Arch:      linux/amd64
@openshift-ci openshift-ci bot added the kind/bug Categorizes issue or PR as related to a bug. label Feb 2, 2022
@baude
Copy link
Member

baude commented Feb 5, 2022

care to submit a pr ?

@ydayagi
Copy link
Contributor Author

ydayagi commented Feb 6, 2022

care to submit a pr ?

gladly :-) already on it

ydayagi added a commit to ydayagi/podman that referenced this issue Feb 23, 2022
this fixes containers#13115

the change tries to immitate k8s behavior.
when limits are not set the container's limits are all CPU and all RAM
when requests are missing then they are equal to limits

Signed-off-by: Yaron Dayagi <ydayagi@redhat.com>
@ydayagi
Copy link
Contributor Author

ydayagi commented Feb 23, 2022

The actual CPU and memory assigned to the pod seem to be OK. The only problem that needed to be fixed was the field values in the Container object in code.

@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants