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

Why automatic setting for spec.containers[].resources.requests.cpu? #83688

Open
stevebail opened this issue Oct 9, 2019 · 4 comments

Comments

@stevebail
Copy link

commented Oct 9, 2019

What happened:

I installed a Pod spec (manifest) with the following CPU resource information:
spec.containers[].resources.requests.cpu: unspecified
spec.containers[].resources.limits.cpu: 500m

k8s created a Pod (or a number of replicas) with the following setting:
spec.containers[].resources.requests.cpu: 500m
spec.containers[].resources.limits.cpu: 500m

What you expected to happen:

When a limit or request is unspecified, I think it is best for k8s to always treat it as "0".
It is important for k8s to respect the original request and limit. Furthermore, one cannot even track the override vs original values by querying the YAML resource info.

In the above example, I expected the following behavior:
spec.containers[].resources.requests.cpu: 0m
spec.containers[].resources.limits.cpu: 500m

How to reproduce it (as minimally and precisely as possible):

Anything else we need to know?:

Environment:

  • k8s 1.14.0
@stevebail

This comment has been minimized.

Copy link
Author

commented Oct 10, 2019

@kubernetes/sig-api-machinery
/sig api-machinery

@liggitt

This comment has been minimized.

Copy link
Member

commented Oct 10, 2019

/remove-sig api-machinery
/sig node
/remove-kind bug
/kind support

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Oct 10, 2019

@liggitt: The label(s) kind/support cannot be applied. These labels are supported: api-review, community/discussion, community/maintenance, community/question, cuj/build-train-deploy, cuj/multi-user, platform/aws, platform/azure, platform/gcp, platform/minikube, platform/other

In response to this:

/remove-sig api-machinery
/sig node
/remove-kind bug
/kind support

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@stevebail

This comment has been minimized.

Copy link
Author

commented Oct 11, 2019

I found the following sentence in the API reference documentation:
If Requests is omitted for a container, it defaults to Limits if that is explictly specified.

IMO, such statement or implementation decision does not make sense, at least for CPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.