{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/23113","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/23113/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/23113/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/23113/events","html_url":"https://github.com/kubernetes/kubernetes/issues/23113","id":141560999,"number":23113,"title":"Cgroup 'cpu.cfs_quota_us' error on container creation when CPU limit is low","user":{"login":"antoineco","id":3299086,"avatar_url":"https://avatars.githubusercontent.com/u/3299086?v=3","gravatar_id":"","url":"https://api.github.com/users/antoineco","html_url":"https://github.com/antoineco","followers_url":"https://api.github.com/users/antoineco/followers","following_url":"https://api.github.com/users/antoineco/following{/other_user}","gists_url":"https://api.github.com/users/antoineco/gists{/gist_id}","starred_url":"https://api.github.com/users/antoineco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoineco/subscriptions","organizations_url":"https://api.github.com/users/antoineco/orgs","repos_url":"https://api.github.com/users/antoineco/repos","events_url":"https://api.github.com/users/antoineco/events{/privacy}","received_events_url":"https://api.github.com/users/antoineco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2016-03-17T11:52:18Z","updated_at":"2016-03-17T15:54:29Z","closed_at":null,"body":"After upgrading my environment from Kubernetes 1.1.8 to Kubernetes 1.2.0, I see pods creation failing with the following resource limits set:\r\n\r\n```\r\n        resources:\r\n          limits:\r\n            cpu: 5m\r\n            memory: 25Mi\r\n```\r\n\r\nTranslated to Docker container info:\r\n\r\n| 1.1.8 | 1.2.0 |\r\n| --- | --- |\r\n| \"Memory\": 26214400, | \"Memory\": 26214400, |\r\n| \"MemoryReservation\": 0, | \"MemoryReservation\": 0, |\r\n| \"CpuShares\": 5, | \"CpuShares\": 5, |\r\n| \"CpuPeriod\": 0, | \"CpuPeriod\": 100000, |\r\n| \"CpuQuota\": 0, | \"CpuQuota\": 500, |\r\n\r\n\r\nThe error message is:\r\n\r\n```\r\nCannot start container <sha>: [9] System error: write /sys/fs/cgroup/cpu,cpuacct/system.slice/docker-<sha>.scope/cpu.cfs_quota_us: invalid argument\r\n```\r\n\r\nI can reproduce this by creating containers manually:\r\n\r\n```\r\n$ docker run --rm --cpu-shares=5 --cpu-quota=0 --cpu-period=0 tianon/true\r\n[exit code 0]\r\n$ docker run --rm --cpu-shares=5 --cpu-quota=500 --cpu-period=100000 tianon/true\r\ndocker: Error response from daemon: Cannot start container <sha>: [9] System error: write /sys/fs/cgroup/cpu,cpuacct/docker/<sha>/cpu.cfs_quota_us: invalid argument.\r\n[exit code 125]\r\n```\r\n\r\nKubernetes should check that the defined CPU restrictions are valid before attempting to create containers."},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/197944845","html_url":"https://github.com/kubernetes/kubernetes/issues/23113#issuecomment-197944845","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/23113","id":197944845,"user":{"login":"antoineco","id":3299086,"avatar_url":"https://avatars.githubusercontent.com/u/3299086?v=3","gravatar_id":"","url":"https://api.github.com/users/antoineco","html_url":"https://github.com/antoineco","followers_url":"https://api.github.com/users/antoineco/followers","following_url":"https://api.github.com/users/antoineco/following{/other_user}","gists_url":"https://api.github.com/users/antoineco/gists{/gist_id}","starred_url":"https://api.github.com/users/antoineco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/antoineco/subscriptions","organizations_url":"https://api.github.com/users/antoineco/orgs","repos_url":"https://api.github.com/users/antoineco/repos","events_url":"https://api.github.com/users/antoineco/events{/privacy}","received_events_url":"https://api.github.com/users/antoineco/received_events","type":"User","site_admin":false},"created_at":"2016-03-17T15:54:29Z","updated_at":"2016-03-17T15:54:29Z","body":"@AdoHe did you `docker inspect` the container `c2cb6c436155`? It could be that the values of the `Cpu*` settings have already been adjusted but not cherry picked in the release 1.2 branch (?)"}}