{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/70980","repository_url":"https://api.github.com/repos/kubernetes/kubernetes","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/70980/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/70980/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/70980/events","html_url":"https://github.com/kubernetes/kubernetes/pull/70980","id":380104030,"node_id":"MDExOlB1bGxSZXF1ZXN0MjMwMzgxNDY5","number":70980,"title":"Limit iops per container","user":{"login":"Avanpourm","id":6522051,"node_id":"MDQ6VXNlcjY1MjIwNTE=","avatar_url":"https://avatars0.githubusercontent.com/u/6522051?v=4","gravatar_id":"","url":"https://api.github.com/users/Avanpourm","html_url":"https://github.com/Avanpourm","followers_url":"https://api.github.com/users/Avanpourm/followers","following_url":"https://api.github.com/users/Avanpourm/following{/other_user}","gists_url":"https://api.github.com/users/Avanpourm/gists{/gist_id}","starred_url":"https://api.github.com/users/Avanpourm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Avanpourm/subscriptions","organizations_url":"https://api.github.com/users/Avanpourm/orgs","repos_url":"https://api.github.com/users/Avanpourm/repos","events_url":"https://api.github.com/users/Avanpourm/events{/privacy}","received_events_url":"https://api.github.com/users/Avanpourm/received_events","type":"User","site_admin":false},"labels":[{"id":116719829,"node_id":"MDU6TGFiZWwxMTY3MTk4Mjk=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/area/kubelet","name":"area/kubelet","color":"0052cc","default":false},{"id":477397086,"node_id":"MDU6TGFiZWw0NzczOTcwODY=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":680154135,"node_id":"MDU6TGFiZWw2ODAxNTQxMzU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/do-not-merge/cherry-pick-not-approved","name":"do-not-merge/cherry-pick-not-approved","color":"e11d21","default":false},{"id":267761362,"node_id":"MDU6TGFiZWwyNjc3NjEzNjI=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/kind/feature","name":"kind/feature","color":"c7def8","default":false},{"id":573014062,"node_id":"MDU6TGFiZWw1NzMwMTQwNjI=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/needs-ok-to-test","name":"needs-ok-to-test","color":"b60205","default":false},{"id":1111992057,"node_id":"MDU6TGFiZWwxMTExOTkyMDU3","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/needs-priority","name":"needs-priority","color":"ededed","default":false},{"id":200149833,"node_id":"MDU6TGFiZWwyMDAxNDk4MzM=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/release-note","name":"release-note","color":"c2e0c6","default":false},{"id":173493665,"node_id":"MDU6TGFiZWwxNzM0OTM2NjU=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/sig/node","name":"sig/node","color":"d2b48c","default":false},{"id":253451057,"node_id":"MDU6TGFiZWwyNTM0NTEwNTc=","url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XL","name":"size/XL","color":"ee5500","default":false}],"state":"open","locked":false,"assignee":{"login":"derekwaynecarr","id":6233452,"node_id":"MDQ6VXNlcjYyMzM0NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/6233452?v=4","gravatar_id":"","url":"https://api.github.com/users/derekwaynecarr","html_url":"https://github.com/derekwaynecarr","followers_url":"https://api.github.com/users/derekwaynecarr/followers","following_url":"https://api.github.com/users/derekwaynecarr/following{/other_user}","gists_url":"https://api.github.com/users/derekwaynecarr/gists{/gist_id}","starred_url":"https://api.github.com/users/derekwaynecarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekwaynecarr/subscriptions","organizations_url":"https://api.github.com/users/derekwaynecarr/orgs","repos_url":"https://api.github.com/users/derekwaynecarr/repos","events_url":"https://api.github.com/users/derekwaynecarr/events{/privacy}","received_events_url":"https://api.github.com/users/derekwaynecarr/received_events","type":"User","site_admin":false},"assignees":[{"login":"derekwaynecarr","id":6233452,"node_id":"MDQ6VXNlcjYyMzM0NTI=","avatar_url":"https://avatars3.githubusercontent.com/u/6233452?v=4","gravatar_id":"","url":"https://api.github.com/users/derekwaynecarr","html_url":"https://github.com/derekwaynecarr","followers_url":"https://api.github.com/users/derekwaynecarr/followers","following_url":"https://api.github.com/users/derekwaynecarr/following{/other_user}","gists_url":"https://api.github.com/users/derekwaynecarr/gists{/gist_id}","starred_url":"https://api.github.com/users/derekwaynecarr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/derekwaynecarr/subscriptions","organizations_url":"https://api.github.com/users/derekwaynecarr/orgs","repos_url":"https://api.github.com/users/derekwaynecarr/repos","events_url":"https://api.github.com/users/derekwaynecarr/events{/privacy}","received_events_url":"https://api.github.com/users/derekwaynecarr/received_events","type":"User","site_admin":false}],"milestone":null,"comments":8,"created_at":"2018-11-13T08:07:46Z","updated_at":"2019-01-04T04:41:14Z","closed_at":null,"author_association":"NONE","pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/70980","html_url":"https://github.com/kubernetes/kubernetes/pull/70980","diff_url":"https://github.com/kubernetes/kubernetes/pull/70980.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/70980.patch"},"body":"<!--  Thanks for sending a pull request!  Here are some tips for you:\r\n1. If this is your first time, read our contributor guidelines https://git.k8s.io/community/contributors/guide#your-first-contribution and developer guide https://git.k8s.io/community/contributors/devel/development.md#development-guide\r\n2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request. For reference on required PR/issue labels, read here:\r\nhttps://git.k8s.io/community/contributors/devel/release.md#issue-kind-label\r\n3. Ensure you have added or ran the appropriate tests for your PR: https://git.k8s.io/community/contributors/devel/testing.md\r\n4. If you want *faster* PR reviews, read how: https://git.k8s.io/community/contributors/guide/pull-requests.md#best-practices-for-faster-reviews\r\n5. Follow the instructions for writing a release note: https://git.k8s.io/community/contributors/guide/release-notes.md\r\n6. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests\r\n-->\r\n\r\n**What type of PR is this?**\r\n/kind feature\r\n\r\n**What this PR does / why we need it**:\r\nI need to limit the read and write iops of rootfs\r\n**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:\r\nFixes #70364\r\n\r\n**Special notes for your reviewer**:\r\nThankyou !!！\r\n\r\n**Does this PR introduce a user-facing change?**:\r\n<!--  \r\nIf no, just write \"NONE\".\r\nIf yes, a release note is required:\r\nEnter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string \"action required\".\r\n2. \r\n-->\r\n```release-note\r\nUse the annotation of kubernetes to pass the parameters of the cgroup to control the container blkio\r\nSpecifying the device path as \"rootfs\" indicates that you specify limiting rootfs\r\nFor example:\r\nio.kubernetes.container.blkio: '{\"weight\":200,\"weight_device\":[{\"device\":\"rootfs\",\"value\":\"200k\"}],\"device_read_bps\":[{\"device\":\"/dev/sda1\",\"value\":\"20m\"}],\"device_write_bps\":[{\"device\":\"rootfs\",\"value\":\"20m\"}],\"device_read_iops\":[{\"device\":\"rootfs\",\"value\":\"200\"}]\"device_write_iops\":[{\"device\":\"rootfs\",\"value\":\"300\"}]}'\r\n\r\n```\r\n### Parameter\r\n| parameter | type | default value | means | parameter range | example | corresponds to Cgoup |\r\n| --- | --- | --- | --- | --- | --- | --- |\r\n| weight | Uint16 | 0 | Weight value for all devices | 10-1000 | 1 |   |\r\n| weight_device | Array | nil | Weight value for all devices | - |  |  |\r\n| weight_device.[*].device | String |  | The absolute path of the device |  | /dev/sda1 |  |\r\n| weight_device.[*].value | String |  | Weight value of the device|10-1000  |  |  |\r\n| device_read_bps | Array | nil | A device reads the maximum number of bytes per second |  |  |  |\r\n| device_read_bps.[*].device | String |  | The absolute path of the device. You can use \"rootfs\" for the specified root directory|  |  |  |\r\n| device_read_bps.[*].value | String |  |Value ,like: 1[ K M G ]. Limit the minimum to prevent the process from entering a D state | >1k | 1M |  |\r\n| device_write_bps | Array | nil | Maximum number of bytes per second allowed to write to the device |  |  |  |\r\n| device_write_bps.[*].device | String |  | The absolute path of the device. You can use \"rootfs\" for the specified root directory |  |  |  |\r\n| device_write_bps.[*].value | String |  |Value ,like: 1[ K M G ]. Limit the minimum to prevent the process from entering a D state | >1k |  |  |\r\n| device_read_iops | Array | nil | Max IOPS |  |  |  |\r\n| device_read_iops.[*].device | String |  | The absolute path of the device. You can use \"rootfs\" for the specified root directory |  |  |  |\r\n| device_read_iops.[*].value | String |  | Value ,like: 1[ K M G ]. Limit the minimum to prevent the process from entering a D state | >5 |  |  |\r\n| device_write_iops | Array | nil | Max IOPS |  |  |  |\r\n| device_write_iops.[*].device | String |  | The absolute path of the device. You can use \"rootfs\" for the specified root directory|  |  |  |\r\n| device_write_iops.[*].value | String |  | Value ,like: 1[ K M G ]. Limit the minimum to prevent the process from entering a D state | >5 |  | |\r\n\r\n### Deployment Example\r\n\r\n```\r\napiVersion: apps/v1\r\nkind: Deployment\r\nmetadata:\r\n  labels:\r\n    app: iops-app\r\n  name: iops-app\r\nspec:\r\n  replicas: 1\r\n  selector:\r\n    matchLabels:\r\n      app: iops-app\r\n  template:\r\n    metadata:\r\n      labels:\r\n        app: iops-app\r\n      annotations:\r\n        io.kubernetes.container.blkio: '{\"weight\":200,\"weight_device\":[{\"device\":\"rootfs\",\"value\":\"200k\"}],\"device_read_bps\":[{\"device\":\"/dev/sad1\",\"value\":\"20m\"}],\"device_write_bps\":[{\"device\":\"rootfs\",\"value\":\"20m\"}],\"device_read_iops\":[{\"device\":\"rootfs\",\"value\":\"200\"}],\"device_write_iops\":[{\"device\":\"rootfs\",\"value\":\"300\"}]}'\r\n    spec:\r\n      nodeSelector:\r\n        kubernetes.io/hostname: szdc-k8sm-2-2.meitu-inc.com\r\n      containers:\r\n      - image: docker.io/centos:7\r\n        command: [\"/bin/sh\",\"-c\"]\r\n        args: [\"while(true);do /bin/sleep 10;done\"]\r\n        name: iops-app\r\n        resources:\r\n          requests:\r\n            memory: \"200Mi\"\r\n            cpu: 1\r\n          limits:\r\n            memory: \"200Mi\"\r\n            cpu: 1\r\n        volumeMounts:\r\n        - name: host-time\r\n          mountPath: /etc/localtime\r\n      volumes:\r\n      - name: host-time\r\n        hostPath:\r\n          path: /etc/localtime\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/451352289","html_url":"https://github.com/kubernetes/kubernetes/pull/70980#issuecomment-451352289","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/70980","id":451352289,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MTM1MjI4OQ==","user":{"login":"feiskyer","id":676637,"node_id":"MDQ6VXNlcjY3NjYzNw==","avatar_url":"https://avatars2.githubusercontent.com/u/676637?v=4","gravatar_id":"","url":"https://api.github.com/users/feiskyer","html_url":"https://github.com/feiskyer","followers_url":"https://api.github.com/users/feiskyer/followers","following_url":"https://api.github.com/users/feiskyer/following{/other_user}","gists_url":"https://api.github.com/users/feiskyer/gists{/gist_id}","starred_url":"https://api.github.com/users/feiskyer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/feiskyer/subscriptions","organizations_url":"https://api.github.com/users/feiskyer/orgs","repos_url":"https://api.github.com/users/feiskyer/repos","events_url":"https://api.github.com/users/feiskyer/events{/privacy}","received_events_url":"https://api.github.com/users/feiskyer/received_events","type":"User","site_admin":false},"created_at":"2019-01-04T04:41:14Z","updated_at":"2019-01-04T04:41:14Z","author_association":"MEMBER","body":"@Avanpourm  Thanks for contributing. For new features, please send PRs to master branch instead."}}
{"actor":{"display_login":"feiskyer"}}