{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kube-state-metrics/issues/613","repository_url":"https://api.github.com/repos/kubernetes/kube-state-metrics","labels_url":"https://api.github.com/repos/kubernetes/kube-state-metrics/issues/613/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kube-state-metrics/issues/613/comments","events_url":"https://api.github.com/repos/kubernetes/kube-state-metrics/issues/613/events","html_url":"https://github.com/kubernetes/kube-state-metrics/pull/613","id":388968844,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM3MDk3MTg5","number":613,"title":"Introduce sharding (and experimental auto-sharding)","user":{"login":"brancz","id":4546722,"node_id":"MDQ6VXNlcjQ1NDY3MjI=","avatar_url":"https://avatars3.githubusercontent.com/u/4546722?v=4","gravatar_id":"","url":"https://api.github.com/users/brancz","html_url":"https://github.com/brancz","followers_url":"https://api.github.com/users/brancz/followers","following_url":"https://api.github.com/users/brancz/following{/other_user}","gists_url":"https://api.github.com/users/brancz/gists{/gist_id}","starred_url":"https://api.github.com/users/brancz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brancz/subscriptions","organizations_url":"https://api.github.com/users/brancz/orgs","repos_url":"https://api.github.com/users/brancz/repos","events_url":"https://api.github.com/users/brancz/events{/privacy}","received_events_url":"https://api.github.com/users/brancz/received_events","type":"User","site_admin":false},"labels":[{"id":764086825,"node_id":"MDU6TGFiZWw3NjQwODY4MjU=","url":"https://api.github.com/repos/kubernetes/kube-state-metrics/labels/approved","name":"approved","color":"0ffa16","default":false},{"id":485759093,"node_id":"MDU6TGFiZWw0ODU3NTkwOTM=","url":"https://api.github.com/repos/kubernetes/kube-state-metrics/labels/cncf-cla:%20yes","name":"cncf-cla: yes","color":"bfe5bf","default":false},{"id":715193328,"node_id":"MDU6TGFiZWw3MTUxOTMzMjg=","url":"https://api.github.com/repos/kubernetes/kube-state-metrics/labels/size/XL","name":"size/XL","color":"ee5500","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2018-12-08T23:17:28Z","updated_at":"2019-08-30T20:47:41Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/kubernetes/kube-state-metrics/pulls/613","html_url":"https://github.com/kubernetes/kube-state-metrics/pull/613","diff_url":"https://github.com/kubernetes/kube-state-metrics/pull/613.diff","patch_url":"https://github.com/kubernetes/kube-state-metrics/pull/613.patch"},"body":"**What this PR does / why we need it**:\r\n\r\nThis PR introduces sharding capabilities for kube-state-metrics, as well as the experimental feature to have kube-state-metrics automatically detect sharding, by discovering its nominal position within a StatefulSet and using the number of replicas in the StatefulSet as the total number of shards. I added a further description of the mechanism to the documentation.\r\n\r\nThese features will allow kube-state-metrics to be easily auto-scaled with the horizontal-pod-autoscaler by using its latency of `/metrics` requests to be lower than a certain threshold, otherwise scaling it up, as the latency is directly related to the amount of objects a shard needs to handle and the more replicas in a setup, the lower the number of objects, therefore a lower latency, as each shard handles 1/nth of objects in the cluster.\r\n\r\nkube-state-metrics is well optimized, but in order to scale it infinitely and on commodity hardware it is necessary to shard the work it needs to do.\r\n\r\nNote, I do not intend to ship these features in the already started release series of 1.5.x of kube-state-metrics, but rather release following it.\r\n\r\n@andyxning @zouyee @mxinden @s-urbaniak @squat @metalmatze "},"comment":{"url":"https://api.github.com/repos/kubernetes/kube-state-metrics/issues/comments/526744567","html_url":"https://github.com/kubernetes/kube-state-metrics/pull/613#issuecomment-526744567","issue_url":"https://api.github.com/repos/kubernetes/kube-state-metrics/issues/613","id":526744567,"node_id":"MDEyOklzc3VlQ29tbWVudDUyNjc0NDU2Nw==","user":{"login":"tariq1890","id":2658224,"node_id":"MDQ6VXNlcjI2NTgyMjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/2658224?v=4","gravatar_id":"","url":"https://api.github.com/users/tariq1890","html_url":"https://github.com/tariq1890","followers_url":"https://api.github.com/users/tariq1890/followers","following_url":"https://api.github.com/users/tariq1890/following{/other_user}","gists_url":"https://api.github.com/users/tariq1890/gists{/gist_id}","starred_url":"https://api.github.com/users/tariq1890/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tariq1890/subscriptions","organizations_url":"https://api.github.com/users/tariq1890/orgs","repos_url":"https://api.github.com/users/tariq1890/repos","events_url":"https://api.github.com/users/tariq1890/events{/privacy}","received_events_url":"https://api.github.com/users/tariq1890/received_events","type":"User","site_admin":false},"created_at":"2019-08-30T20:47:41Z","updated_at":"2019-08-30T20:47:41Z","author_association":"MEMBER","body":"/lgtm\r\n\r\nThanks @brancz! Great to have this merged :)."}}
{"actor":{"display_login":"tariq1890"}}