kubernetes: Giving the wrong unit under resource limits is not erroring, instead the pod creation fails.
Is this a BUG REPORT or FEATURE REQUEST?: /kind bug
What happened: I specified resource limits with wrong unit. Like below
resources:
requests:
memory: "64m"
cpu: "250m"
limits:
memory: "128m"
cpu: "500m"
Instead of Mi I gave m under memory limits in the pod definition. It didn’t show any error while trying to create the deployment. But the container never came up. It was continuously in the ContainerCreating mode.
Checking the pod description didn’t give anything that is useful.
Events:
FirstSeen LastSeen Count From SubObjectPath Type Reason Message
--------- -------- ----- ---- ------------- -------- ------ -------
22s 22s 1 default-scheduler Normal Scheduled Successfully assigned xxxxxx-56b4864dd9-9x5gs to gke-xxxxxxx-default-pool-53b7e787-580g
22s 22s 1 kubelet, gke-xxxxxxx-default-pool-53b7e787-580g Normal SuccessfulMountVolume MountVolume.SetUp succeeded for volume "default-token-cwtq0"
21s 1s 21 kubelet, gke-xxxxxxx-default-pool-53b7e787-580g Warning FailedSync Error syncing
pod
20s 0s 21 kubelet, gke-xxxxxxx-default-pool-53b7e787-580g Normal SandboxChanged Pod sandbox changed, it will be killed and re-created.
What you expected to happen: The kubectl should check for the syntax error and should display the error while trying to create the deployment.
How to reproduce it (as minimally and precisely as possible):
Create a yml file with resource limits unit m for memory. Example 200m. Try to create the deployment using kubectl create -f file.yml
Anything else we need to know?:
Environment:
- Kubernetes version (use
kubectl version): v1.8.1-gke.0 - Cloud provider or hardware configuration**: GKE
- OS (e.g. from /etc/os-release): Mac OS, High Sierra
- Kernel (e.g.
uname -a): Darwin MacBookPro 17.0.0 Darwin Kernel Version 17.0.0: Thu Aug 24 21:48:19 PDT 2017; root:xnu-4570.1.46~2/RELEASE_X86_64 x86_64 i386 MacBookPro11,4 Darwin - Install tools:
- Others:
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Comments: 17 (3 by maintainers)
Hi, we’re operating a multi-tenant cluster and I suspect one of our users has done the same as @MansoorMajeed . I noticed because
kubectl describeshows me an overall memory request for the node of31268536322048m (15%), which is odd , since it uses “m” as the unit. Here’s the full output:Running K8s 1.10.1 here.
Not sure if this is really related, but it seems that when I specify memory requests like so:
the
kubectl describecommand outputs the requests withmas unit also.Running Kubernetes v1.10.2.