{
    "componentChunkName": "component---src-templates-issues-tsx",
    "path": "/issues/334",
    "result": {"data":{"issuesJson":{"id":"e6cd72bc-f37b-5456-9afe-fff44a6348a1","title":"kubernetes/kube-state-metrics: k8s官方推出的用于监控k8s集群状态的指标收集器，提供了大量的k8s集群状态指标，如节点状态、pod状态、deployment状态等","number":334,"bodyHTML":"<div align=\"center\" dir=\"auto\">\n<p dir=\"auto\"><a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a><br><br></p>\n<markdown-accessiblity-table><table role=\"table\">\n<thead>\n<tr>\n<th align=\"right\">Repos</th>\n<th align=\"left\"><a href=\"https://github.com/kubernetes/kube-state-metrics\">kubernetes/kube-state-metrics</a></th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td align=\"right\"><strong>Views</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/0fae3f8165fb98a38904f3f92346d3762fdc51470e9ce9acf58adc847868d392/68747470733a2f2f76696577732e77686174696c656172656e65642e746f6461792f76696577732f6769746875622f6b756265726e657465732f6b7562652d73746174652d6d6574726963732e737667\" alt=\"views\" data-canonical-src=\"https://views.whatilearened.today/views/github/kubernetes/kube-state-metrics.svg\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Stars</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/4d88e37b4501efbf0847ae9a24fa6c30beb1ed5e901a159fb67db32bf8104fc7/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f73746172732f6b756265726e657465732f6b7562652d73746174652d6d6574726963733f636f6c6f723d663266303864266c6f676f3d556e64657274616c65266c6f676f436f6c6f723d656234363330\" alt=\"stars\" data-canonical-src=\"https://img.shields.io/github/stars/kubernetes/kube-state-metrics?color=f2f08d&amp;logo=Undertale&amp;logoColor=eb4630\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>Forks</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/2868476ce5b8ca6dad5b94491668e86d4c830caf8bf2d62093a53ef31ac682bb/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f666f726b732f6b756265726e657465732f6b7562652d73746174652d6d6574726963733f636f6c6f723d626138366562266c6f676f3d48616e647368616b65266c6f676f436f6c6f723d656136616136\" alt=\"forks\" data-canonical-src=\"https://img.shields.io/github/forks/kubernetes/kube-state-metrics?color=ba86eb&amp;logo=Handshake&amp;logoColor=ea6aa6\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>License</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/016e40acfa363128c16ecf8f4b6627585eab976348e92cb2da50c9cf745ebeb2/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6b756265726e657465732f6b7562652d73746174652d6d6574726963733f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e53556845556741414144414141414177434159414141425841766d48414141414358424957584d41414173544141414c457745416d70775941414144336b6c45515652346e4f335953557a5555426748384a726f57567255474a66456d3773584e63534446784d544c327069347348456778654e526f77586770455742445552522532424e414e4f4b4f4b36366f6f4b4a4742586545475263574163455646475152484677516d483525324630774861655748493944554455354c356b6e6568644f62377a66652532423139636e434a47495243516945596c514237594a4979474c38616f73756c565a36695246516a69474b6b7564576735614c6c704f70704e586e665071773555304459524a6d56786a4367464633424c755a476d416f5655694b4541726d583744375553677351706f72674761336748664b34483663754262435644334771683141352532424c6745253242467749656e514d306a6f446f66714c6f48564e7742796d384370546e416d327a51713073676478624964515a556c416b7150415a3664676a303541446f59526f6f66792532466f5869726f376b3551586a4c6f70677a4b69514e6c4c4461716f4967754577426a7a7150355066446a45394479495879493633464d547751464d43567271774e61763451666f52673538514625324266724d485172454b3844546f434d714e4179574e4866786d54526f4c4f726d5352566747744466714345715a4f4851727a6f34706243557341333431365169364551394b476a6345465267484f724f4b6e5536574162396247455459656b4b7843766a546167394534706a653534446b3551503862624d4859762532464333756541654a6b50304f4778422532424a70426e4172595238455951516e6f4e31414e4661426e5050356c385372736559514c303641646b30464a5938484f5761424d6c6541486a683068506f73497a6c6f3876304125324633345a694f6548726130714b52504d5653493774762532423932747725324676687855654252713456454c674d376642714b354770526d6f514c584e7075625475367a6f4e52706754386e5051627138347764253246494375767978694b4871694e41664933774d367549684271476b4c696977414f734b44714f68743749747239567938536a52424557667941627225324668523142667056514664484a42253246423268683778376a36517077435665655951326b72554235436c636a3641326d3067576a25324244306d4c34397a573563517943484c4e37726a6c6d6d6174457958582532464372547a412532466f51785a6b576c39474a5443566f25324279546a3837253242346769504b6376307149486f344156344430565a727251493334706e70524d36357875652532467a417265453425324654253246536f676c664542794d7369517441546c4c3352414a355948725378365a44665337307337754d486842705225324659423573305057366f455270316236253246667252684b3353444c35546965364f515548516c5133735644752532427a50636b397657453973747225324236496a533967486d5750616861444a25324277434b364e494242587348423948796b587378774470686c436d416476706c6162554a4e6e5a504239342532464e7436784f6538587a4562503257684d335741673147756236744825324233513150673337365239713475716c6e6f36676448476a444f5139306562303141484d3672596975554a314f713472344656756a35765239427a4d3957674e764f7977446869495951467667626366774166774d764863615067425041253246447948476a50624e394138616d6562636477416444354e6633373574787165774e5552656f797677424958594c645170576c6877465771745061435044334173467541535636717171496c62304a766b564331464c39576b4c55556c55574b337a585a4c46432532423125324642726f46746f364f7358497545594a5034447a7a5732594656316f4a614141414141456c46546b5375516d4343\" alt=\"license\" data-canonical-src=\"https://img.shields.io/github/license/kubernetes/kube-state-metrics?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAD3klEQVR4nO3YSUzUUBgH8JroWVrUGJfEm7sXNcSDFxMTL2pi4sHEgxeNRowXgpEWBDURR%2BNANOKOK66ooKJGBXeEGRcWAcEVFGQRHFwQmH5%2F0wHaeWHI9DUDU5L5knehdOb7zfe%2B19cnCJGIRCQiEYlQB7YJIyGL8aosulVZ6iRFQjiGKkudWg5aLlpOppNXnfPqw5U0DYRJmVxjCgFF3BLuZGmAoVUiKEArmX7D7USgsQporgGa3gHfK4H6cuBbCVD3Gqh1A5%2BLgE%2BFwIenQM0joDofqLoHVNwBym8CpTnAm2zQq0sgdxbIdQZUlAkqPAZ6dgj05ADoYRoofy%2FoXiro7k5QXjLopgzKiQNlLDaqoIguEwBjzqP5PfDjE9DyIXyI63FMTwQFMCVrqwNav4QfoRg58QF%2BfrMHQrEK8DToCMqNAyWNHfxmTRoLOrmSRVgGtDfqCEqZOHQrzo4pbCUsA3416Qi6EQ9KGjcEFRgHOrOKnU6WAb9bGETYekKxCvjTag9E4pje54Dk5QP8bbMHYv%2FC3ueAeJkP0OGxB%2BJpBnArYR8EYQQnoN1ANFaBnPP5l8SrseYQL06Adk0FJY8HOWaBMleAHjh0hPosIzlo8v0A%2F34ZiOeHra0qKRPMVSI7tv%2B92tw%2FvhxUeBRq4VELgM7fBqK5GpRmoQLXNpubTu6zoNRpgT8nPQbq84wd%2FICuvyxiKHqiNAfI3wM6uIhBqGkLiiwAOsKDqOht7Itr9Vy8SjRBEWfyAbr%2FhR1BfpVQFdHJB%2FB2hh7x7j6QpwCVeeYQ2krUB5Clcj6A2m0gWj%2BD0mL49zW5cQyCHLN7rjlmmatEyXX%2FCrTzA%2FoQxZkWl9GJTCVo%2ByTj87%2B4giPKcv0qIHo4AV4D0VZrrQI34pnpRM65xue%2FzAreE4%2FT%2FSoglfEByMsiQtATlL3RAJ5YHrSx6ZDfS70s7uMHhBpR%2FYB5s0PW6oERp1b6%2FfrRhK3SDL5Tie6OQUHQlQ3sVDu%2BzPck9vWE9str%2B6IjS9gHmWPahaDJ%2BwCK6NIBBXsHB9HykXsxwDphlCmAdvplabUJNnZPB94%2FNt6xOe8XzEbP2WhM3WAg1Gub6tH%2B3Q1Pg376R9q4uqlno6gdHGjDOQ90eb01AHM6rYiuUJ1Oq4r4FVuj5vR9BzM9WgNvOywDhiIYQFvgbcfwAfwMvHcaPgBPA%2FDyHGjPbN9A8amebcdwAdD5Nf375txqewNUReoyvwBIXYLdQpWlhwFWqtPaCPD3AsFuASV6qqqIlb0JvkVC1FL9WkLUUlUWK3zXZLFC%2B1%2FBroFto6OsXIuEYJP4DzzW2YFV1oJaAAAAAElFTkSuQmCC\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>UpdatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/f63b37b5fc7153d71b63af141d1b53736ddd93b7fa7c0e0a9959c1e51407425a/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f6b756265726e657465732f6b7562652d73746174652d6d6574726963733f646973706c61795f74696d657374616d703d636f6d6d6974746572266c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d557064617465644174\" alt=\"last-commit\" data-canonical-src=\"https://img.shields.io/github/last-commit/kubernetes/kube-state-metrics?display_timestamp=committer&amp;logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=UpdatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n<tr>\n<td align=\"right\"><strong>CreatedAt</strong></td>\n<td align=\"left\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/3ba8a8f91ed459f3ff4da5411b75d916aa3ef577b2a2858617d4f95ceb58b32f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f637265617465642d61742f6b756265726e657465732f6b7562652d73746174652d6d6574726963733f6c6f676f3d64617461253341696d616765253246706e672533426261736536342532436956424f5277304b47676f414141414e5355684555674141414234414141416543415941414141374d4b3669414141414358424957584d41414173544141414c457745416d7077594141414648556c45515652346e4c5658375539615678776d3236646c582532466468627825324232253246516e626b7655627264554151674a4a496655444e574454546d4f76314651554661504a346b7573725630314a7431734e70637453327533626f745a746d786439744a5346536f714b71494635625944464c436f76436c656673747a4a387758524c445a4c7a6e6b634f343535376e3364332532466e655a3472454f515a74315771462532423858467234253242664f4c4565326a6f59307a776638546f795a50766a45676b4c592532426b306d6d72584f36644b696e787a476b30666a5430782532425279723055716e6359637a4d317263347451253242497270324c4758646f344e4334567657715453373277716c632532427231334f527269364b6458646e624f484c6c776c7a4a70524b6e3657342532424b36706f4f434e6e494166486a253246253242776168495a4234764b6e715a6630714a704e49716c2532467638545530634e6c3572627963337730516e54703379324c54614a374d314e617844723266526e315370504736476961323174664533345463614f617931694d55564f5146624659714957536f31573854694156616e43306576584f4542375770313448466232327a453566714c4f433545524c515769644e614e49347545636339693768634a6c644868324e57725135674464624f6c7061756d49754c62326174415144506e7a3062384e6257636d785656524a33486d7870536377777a4f4a6d4b44524765384c6c435a444c4739673754496e5631516c376462586256316533675430574b697243466f6d6b5079767758466c5a474a4f6a563625324253743634757564445a4f55354555636f782532464d455144567674364d62634e3237593341797a687633737061557242365a3971724a534f3139657a6a387032704c426b4a792532426343484a7857493567573574636652527a31645531394766476b6f7539505a4f34736d52396a4746777065783444793362766e6d4b79706f74625531335669646a71595a68726a343972764d457425324625324659714c7a396430304e6a57253246637a67796f394f35317a7336614e6c6f354644747530445a675146686c47584a30644241446f4e6864367576703657686f617967374e394c564748386d443462253246486e667455516f4e4734764c51306769784d716c5725324234714f6a744e48446733723166365969525347785279375576714c62395534716b716e78504f4e7661356c447048723125324279794b524e4b57425a793565644d554842326d3572792532422532424551772532427a6766347a6f39253246306f634e3357527a4c4277344a2532424a7950574372716d4967475974554f735744346f785a46516f50556a4770564871493425324661666b51504336665a5165654d31253242764c7549516e6a754257514444437363726d485039656f4e5041744271664f6e5875614b25324268364a45624772732532427076764d6d78654962683836336162565065597953456f39464a48704e4d464a59253242503563575a6b6667374f3174537759436553514c54593345385130392532464256504a556c78516a7368543142736343593032723955445542667643484236367063665041336c794165336e6772332532463437584467614a7a736c7937787741364e5a746c555550437541487161536a5549502532427375653842525741432532464e6651374a5a505a35397330476a3756747049537a34685125324243706658474d4b685a63764c70554b7866574d386f68766637702532464f446a4842666356463849736b383267314648796b63564645253242555a414158343761452532464d6c34504f3530506e75683025324678346e6d637957507364774468427836436d6b4c562532466746446a594b784f4a4f4674623077517949684c39527943774b33414f664947703159464542686e4d4a634c525745624b644b516f55366e63545a6b494544696341792532463831645675454d3552775066657934784f7830496b25324649324e6e466b692532425761664f6f464959466367595a43797864376543556a626334416d46363566742532466b4d686b336f25324235686337734d4a79716a4a45477659466151464972375930775077384246415925324236253242766d6b3377367a7a5275444d6d5a5652736668385274413075455453443775434254364459514e36697665553066706b594c6a453671725672744f78654e4b553954484c5a4a396b4255324a427342685635416976422532466f4b61514e4b675043427744596149665a4334616454684f71463457454e56694c4a77566f586f62664c424b56773637414f6154734c6336355461564b32317651344c613939654b6359673576627873624f627a5451394e37554b4467554f3177446a6944494942736868357a746733396e514d4c535a4248344f7a424f55444551586d323036643366634c67737762585141345068634b336e6873775531427a3877765130395248472532466f597933656a6677424e6d746f59714c4130586741414141424a52553545726b4a676767253344253344266c6162656c3d437265617465644174\" alt=\"create-at\" data-canonical-src=\"https://img.shields.io/github/created-at/kubernetes/kube-state-metrics?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAFHUlEQVR4nLVX7U9aVxwm26dlX%2Fdhbx%2B2%2FQnbkvUbrdUAQgJJIfUDNWDTTmOv1FQUFaPJ4kusrV01Jt1sNpctS2u3botZtmxd9tJSFSoqKqIF5bYDFLCovClefstzJ8wXRLDZLznkcO4557n3d3%2FneZ4rEOQZt1WqF%2B8XFr4%2BfOLEe2joY0zwf8ToyZPvjEgkLY%2Bk0mmrXO6dKinxzGk0fjT0x%2BRyr0UqncYczM1rc4tQ%2BIrp2LGXdo4NC4VvWqTS72wqlc%2Br13ORri6KdXdnbOHLlwlzJpRKn6W4%2BK6poOCNnIAfHj%2F%2BwahIZB4vKnqZf0qJpNIql%2Fv8TU0cNl5rbyc3w0QnTp3y2LTaJ7M1NaxDr2fRn1SpPG6Gia21tfE34TcaOay1iMUVOQFbFYqIWSo1W8TiAVanC0evXOEB7Wp14HFb22zE5fqLOC5ERLQWidNaNI4uEcc9i7hcJldHh2NWrQ5gDdbOlpaumIuLb2atAQDPnz0b8NbWcmxVVRJ3HmxpScwwzOJmKDRGe8LlCZDLG9g7TInV1Ql7dbXbV1e3gT0WKirCFomkPyvwXFlZGJOjV6%2BSt64uudDZOU5EUcox%2FMEQDVvt6MbcN27Y3Ayzhv3spaUrB6Z9qrJSO19ezj8p2pLBkJy%2BcCHJxWI5gW5tcfRRz1dU19GfGkou9PZO4smR9jGFwpex4Dy3bvnmKypotbU13VidjqYZhrj49rvMEt%2F%2FYqLz9d00NjW%2Fczgyo9O51zs6aNlo5FDtu0DZgQFhlGXJ0dBADoNhd6uvp6Whoayg7N9LVGH8mD4b%2FHnftUQoNG4vLQ0gixMqlW%2B4qOjtNHDg3r1f6YiRSGxRy7UvqLb9U4qkqnxPONva5lDpHr1%2ByyKRNKWBZy5edMUHB2m5ry%2B%2BEQw%2Bzgf4zo9%2F0ocN3WRzLBw4J%2BJyPWCrqmIgGYtUOsWD4oxZFQoPUjGpVHqI4%2FafkQPC6fZQeeM1%2BvLuIQnjuBWQDDCscrmHP9eoNPAtBqfOnXuaK%2Bh6JEbGrs%2BpvvMmxeIbh863abVPeYySEo9FJHpNMFJY%2BP5cWZkfg7O1tSwYCeSQLTY3E8Q09%2FBVPJUlxQjshT1BscCY02r9UDUBfvCHB66pcfPA3lyAe3ngr3%2F47XDgaJzsly7xwA6NZtlUUPCuAHqaSjUIP%2Bsue8BRWAC%2FNfQ7JZPZ59s0Gj7VtpISz4hQ%2BCpfXGMKhZcvLpUKxfWM8ohvf7p%2FODjHBfcVF8Isk82g1FHykcVFE%2BUZAAX47aE%2FMl4PO50Pnuh0%2Fx4nmcyWPsdwDhBx6CmkLV%2FgFDjYKxOJOFtb0wQyIhL9RyCwK3AOfIGp1YFEBhnMJcLRWEbKdKQoU6ncTZkIEDicAy%2F81dVuEM5RwPfey4xOx0Ik%2FI2NnFki%2BWafOoFIYFcgYZCyxd7eCUjbc4AmF65ft%2FkMhk3o%2B5hc7sMJyqjJEGvYFaQFIr7Y0wPw8BFAY%2B6%2Bvmk3w6zzRuDMmZVRsfh8RtA0uETSD7uCBT6DYQN6iveU0fpkYLjE6qrVrtOxeNKU9THLZJ9kBU2JBsBhV5AivB%2FoKaQNKgPCBwDYaIfZC4adThOqF4WENViLJwVoXobfLBKVw67AOaTsLc65TaVK21vQ4La99eKcYg5vbxsbObzTQ9N7UKDgUO1wDjiDIIBshh5ztg39nQMLSZBH4OzBOUDEQXm206d3fcLgswbXQA4PhcK3nhswU1Bz8wvQ09RHG%2FoYy3ejfwBNmtoYqLA0XgAAAABJRU5ErkJggg%3D%3D&amp;label=CreatedAt\" style=\"max-width: 100%;\"></a></td>\n</tr>\n</tbody>\n</table></markdown-accessiblity-table>\n<a href=\"https://github.com/opsre/awesome-ops\">\n</a><p dir=\"auto\"><a href=\"https://github.com/opsre/awesome-ops\"><img src=\"https://camo.githubusercontent.com/b964a36ea4078c39f603d46a29436371c7541a2f26e0228d7b21b9d9805b43d3/68747470733a2f2f736f6369616c6966792e6769742e63692f6f707372652f617765736f6d652d6f70732f696d6167653f6465736372697074696f6e3d3126666f6e743d42697474657226666f726b733d31266973737565733d31266c616e67756167653d31266c6f676f3d6874747073253341253246253246617661746172732e67697468756275736572636f6e74656e742e636f6d25324675253246313838353638303230266e616d653d31266f776e65723d31267061747465726e3d436972637569742b426f6172642670756c6c733d31267374617267617a6572733d31267468656d653d4c69676874\" alt=\"\" data-canonical-src=\"https://socialify.git.ci/opsre/awesome-ops/image?description=1&amp;font=Bitter&amp;forks=1&amp;issues=1&amp;language=1&amp;logo=https%3A%2F%2Favatars.githubusercontent.com%2Fu%2F188568020&amp;name=1&amp;owner=1&amp;pattern=Circuit+Board&amp;pulls=1&amp;stargazers=1&amp;theme=Light\" style=\"max-width: 100%;\"></a></p>\n<a target=\"_blank\" rel=\"noopener noreferrer nofollow\" href=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\"><img src=\"https://camo.githubusercontent.com/a15b413168923d02e21292705ceaf86b92675f98e250c5c896a02ba7504a6eae/68747470733a2f2f63646e2e6a7364656c6976722e6e65742f67682f657279616a662f7475406d61696e2f696d672f696d6167655f32303234303432305f3231343430382e676966\" width=\"100%\" height=\"3\" data-animated-image=\"\" data-canonical-src=\"https://cdn.jsdelivr.net/gh/eryajf/tu@main/img/image_20240420_214408.gif\" style=\"max-width: 100%; height: auto; max-height: 3px;\"></a>\n</div>\n<h1 dir=\"auto\">Overview</h1>\n<p dir=\"auto\"><a href=\"https://github.com/kubernetes/kube-state-metrics/actions\"><img src=\"https://github.com/kubernetes/kube-state-metrics/workflows/continuous-integration/badge.svg\" alt=\"Build Status\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/473f544a3f73b9ed51fb06ca6cd06068a2ca10adcf3d986aebef4ac53281e943/68747470733a2f2f676f7265706f7274636172642e636f6d2f62616467652f6769746875622e636f6d2f6b756265726e657465732f6b7562652d73746174652d6d657472696373\" alt=\"Go Report Card\" data-canonical-src=\"https://goreportcard.com/badge/github.com/kubernetes/kube-state-metrics\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://pkg.go.dev/github.com/kubernetes/kube-state-metrics\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/4dddab63ab4cfe2c5c3c35123dd54c4dfec06d1abaef6538808ff6ca92d578ae/68747470733a2f2f706b672e676f2e6465762f62616467652f6769746875622e636f6d2f6b756265726e657465732f6b7562652d73746174652d6d6574726963732e737667\" alt=\"Go Reference\" data-canonical-src=\"https://pkg.go.dev/badge/github.com/kubernetes/kube-state-metrics.svg\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://github.com/kubernetes/kube-state-metrics/actions/workflows/govulncheck.yml\"><img src=\"https://github.com/kubernetes/kube-state-metrics/actions/workflows/govulncheck.yml/badge.svg\" alt=\"govulncheck\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://www.bestpractices.dev/projects/8696\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/a2c591ce13c88896c1455ec864c28c7fe762174ba1a2781740f924688b795463/68747470733a2f2f7777772e626573747072616374696365732e6465762f70726f6a656374732f383639362f6261646765\" alt=\"OpenSSF Best Practices\" data-canonical-src=\"https://www.bestpractices.dev/projects/8696/badge\" style=\"max-width: 100%;\"></a><br>\n<a href=\"https://api.securityscorecards.dev/projects/github.com/kubernetes/kube-state-metrics\" rel=\"nofollow\"><img src=\"https://camo.githubusercontent.com/32d1a2155e900607a9ef67a3b69c563c50d42b830714d40f039827c91b20231f/68747470733a2f2f6170692e736563757269747973636f726563617264732e6465762f70726f6a656374732f6769746875622e636f6d2f6b756265726e657465732f6b7562652d73746174652d6d6574726963732f6261646765\" alt=\"OpenSSF Scorecard\" data-canonical-src=\"https://api.securityscorecards.dev/projects/github.com/kubernetes/kube-state-metrics/badge\" style=\"max-width: 100%;\"></a></p>\n<p dir=\"auto\">kube-state-metrics (KSM) is a simple service that listens to the Kubernetes API<br>\nserver and generates metrics about the state of the objects. (See examples in<br>\nthe Metrics section below.) It is not focused on the health of the individual<br>\nKubernetes components, but rather on the health of the various objects inside,<br>\nsuch as deployments, nodes and pods.</p>\n<p dir=\"auto\">kube-state-metrics is about generating metrics from Kubernetes API objects<br>\nwithout modification. This ensures that features provided by kube-state-metrics<br>\nhave the same grade of stability as the Kubernetes API objects themselves. In<br>\nturn, this means that kube-state-metrics in certain situations may not show the<br>\nexact same values as kubectl, as kubectl applies certain heuristics to display<br>\ncomprehensible messages. kube-state-metrics exposes raw data unmodified from the<br>\nKubernetes API, this way users have all the data they require and perform<br>\nheuristics as they see fit.</p>\n<p dir=\"auto\">The metrics are exported on the HTTP endpoint <code class=\"notranslate\">/metrics</code> on the listening port<br>\n(default 8080). They are served as plaintext. They are designed to be consumed<br>\neither by Prometheus itself or by a scraper that is compatible with scraping a<br>\nPrometheus client endpoint. You can also open <code class=\"notranslate\">/metrics</code> in a browser to see<br>\nthe raw metrics. Note that the metrics exposed on the <code class=\"notranslate\">/metrics</code> endpoint<br>\nreflect the current state of the Kubernetes cluster. When Kubernetes objects<br>\nare deleted they are no longer visible on the <code class=\"notranslate\">/metrics</code> endpoint.</p>\n<div class=\"markdown-alert markdown-alert-note\" dir=\"auto\"><p class=\"markdown-alert-title\" dir=\"auto\"><svg class=\"octicon octicon-info mr-2\" viewBox=\"0 0 16 16\" version=\"1.1\" width=\"16\" height=\"16\" aria-hidden=\"true\"><path d=\"M0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8Zm8-6.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13ZM6.5 7.75A.75.75 0 0 1 7.25 7h1a.75.75 0 0 1 .75.75v2.75h.25a.75.75 0 0 1 0 1.5h-2a.75.75 0 0 1 0-1.5h.25v-2h-.25a.75.75 0 0 1-.75-.75ZM8 6a1 1 0 1 1 0-2 1 1 0 0 1 0 2Z\"></path></svg>Note</p><p dir=\"auto\">This README is generated from a <a href=\"./README.md.tpl\">template</a>. Please make your changes there and run <code class=\"notranslate\">make generate-template</code>.</p>\n</div>\n<h2 dir=\"auto\">Table of Contents</h2>\n<ul dir=\"auto\">\n<li><a href=\"#versioning\">Versioning</a>\n<ul dir=\"auto\">\n<li><a href=\"#kubernetes-version\">Kubernetes Version</a></li>\n<li><a href=\"#compatibility-matrix\">Compatibility matrix</a></li>\n<li><a href=\"#resource-group-version-compatibility\">Resource group version compatibility</a></li>\n<li><a href=\"#container-image\">Container Image</a></li>\n</ul>\n</li>\n<li><a href=\"#metrics-documentation\">Metrics Documentation</a>\n<ul dir=\"auto\">\n<li><a href=\"#ecmascript-regular-expression-support-for-allow-and-deny-lists\">ECMAScript regular expression support for allow and deny lists</a></li>\n<li><a href=\"#conflict-resolution-in-label-names\">Conflict resolution in label names</a></li>\n</ul>\n</li>\n<li><a href=\"#kube-state-metrics-self-metrics\">Kube-state-metrics self metrics</a></li>\n<li><a href=\"#resource-recommendation\">Resource recommendation</a></li>\n<li><a href=\"#latency\">Latency</a></li>\n<li><a href=\"#a-note-on-costing\">A note on costing</a></li>\n<li><a href=\"#kube-state-metrics-vs-metrics-server\">kube-state-metrics vs. metrics-server</a></li>\n<li><a href=\"#scaling-kube-state-metrics\">Scaling kube-state-metrics</a>\n<ul dir=\"auto\">\n<li><a href=\"#resource-recommendation\">Resource recommendation</a></li>\n<li><a href=\"#horizontal-sharding\">Horizontal sharding</a>\n<ul dir=\"auto\">\n<li><a href=\"#automated-sharding\">Automated sharding</a></li>\n</ul>\n</li>\n<li><a href=\"#daemonset-sharding-for-pod-metrics\">Daemonset sharding for pod metrics</a></li>\n</ul>\n</li>\n<li><a href=\"#setup\">Setup</a>\n<ul dir=\"auto\">\n<li><a href=\"#building-the-docker-container\">Building the Docker container</a></li>\n</ul>\n</li>\n<li><a href=\"#usage\">Usage</a>\n<ul dir=\"auto\">\n<li><a href=\"#kubernetes-deployment\">Kubernetes Deployment</a></li>\n<li><a href=\"#limited-privileges-environment\">Limited privileges environment</a></li>\n<li><a href=\"#helm-chart\">Helm Chart</a></li>\n<li><a href=\"#development\">Development</a></li>\n<li><a href=\"#developer-contributions\">Developer Contributions</a></li>\n<li><a href=\"#community\">Community</a></li>\n</ul>\n</li>\n</ul>\n<h3 dir=\"auto\">Versioning</h3>\n<h4 dir=\"auto\">Kubernetes Version</h4>\n<p dir=\"auto\">kube-state-metrics uses <a href=\"https://github.com/kubernetes/client-go\"><code class=\"notranslate\">client-go</code></a> to talk with<br>\nKubernetes clusters. The supported Kubernetes cluster version is determined by <code class=\"notranslate\">client-go</code>.<br>\nThe compatibility matrix for client-go and Kubernetes cluster can be found<br>\n<a href=\"https://github.com/kubernetes/client-go#compatibility-matrix\">here</a>.<br>\nAll additional compatibility is only best effort, or happens to still/already be supported.</p>\n<h4 dir=\"auto\">Compatibility matrix</h4>\n<p dir=\"auto\">At most, 5 kube-state-metrics and 5 <a href=\"https://github.com/kubernetes/kubernetes/releases\">kubernetes releases</a> will be recorded below.<br>\nGenerally, it is recommended to use the latest release of kube-state-metrics. If you run a very recent version of Kubernetes, you might want to use an unreleased version to have the full range of supported resources. If you run an older version of Kubernetes, you might need to run an older version in order to have full support for all resources. Be aware, that the maintainers will only support the latest release. Older versions might be supported by interested users of the community.</p>\n<markdown-accessiblity-table><table role=\"table\">\n<thead>\n<tr>\n<th>kube-state-metrics</th>\n<th align=\"center\">Kubernetes client-go Version</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td><strong>v2.11.0</strong></td>\n<td align=\"center\">v1.28</td>\n</tr>\n<tr>\n<td><strong>v2.12.0</strong></td>\n<td align=\"center\">v1.29</td>\n</tr>\n<tr>\n<td><strong>v2.13.0</strong></td>\n<td align=\"center\">v1.30</td>\n</tr>\n<tr>\n<td><strong>v2.14.0</strong></td>\n<td align=\"center\">v1.31</td>\n</tr>\n<tr>\n<td><strong>v2.15.0</strong></td>\n<td align=\"center\">v1.32</td>\n</tr>\n<tr>\n<td><strong>main</strong></td>\n<td align=\"center\">v1.32</td>\n</tr>\n</tbody>\n</table></markdown-accessiblity-table>\n<h4 dir=\"auto\">Resource group version compatibility</h4>\n<p dir=\"auto\">Resources in Kubernetes can evolve, i.e., the group version for a resource may change from alpha to beta and finally GA<br>\nin different Kubernetes versions. For now, kube-state-metrics will only use the oldest API available in the latest<br>\nrelease.</p>\n<h4 dir=\"auto\">Container Image</h4>\n<p dir=\"auto\">The latest container image can be found at:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.15.0</code> (arch: <code class=\"notranslate\">amd64</code>, <code class=\"notranslate\">arm</code>, <code class=\"notranslate\">arm64</code>, <code class=\"notranslate\">ppc64le</code> and <code class=\"notranslate\">s390x</code>)</li>\n<li>View all multi-architecture images at <a href=\"https://explore.ggcr.dev/?image=registry.k8s.io%2Fkube-state-metrics%2Fkube-state-metrics:v2.15.0\" rel=\"nofollow\">here</a></li>\n</ul>\n<h3 dir=\"auto\">Metrics Documentation</h3>\n<p dir=\"auto\">Any resources and metrics based on alpha Kubernetes APIs are excluded from any stability guarantee,<br>\nwhich may be changed at any given release.</p>\n<p dir=\"auto\">See the <a href=\"docs\"><code class=\"notranslate\">docs</code></a> directory for more information on the exposed metrics.</p>\n<h4 dir=\"auto\">Conflict resolution in label names</h4>\n<p dir=\"auto\">The <code class=\"notranslate\">*_labels</code> family of metrics exposes Kubernetes labels as Prometheus labels.<br>\nAs <a href=\"https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set\" rel=\"nofollow\">Kubernetes</a><br>\nis more liberal than<br>\n<a href=\"https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels\" rel=\"nofollow\">Prometheus</a><br>\nin terms of allowed characters in label names,<br>\nwe automatically convert unsupported characters to underscores.<br>\nFor example, <code class=\"notranslate\">app.kubernetes.io/name</code> becomes <code class=\"notranslate\">label_app_kubernetes_io_name</code>.</p>\n<p dir=\"auto\">This conversion can create conflicts when multiple Kubernetes labels like<br>\n<code class=\"notranslate\">foo-bar</code> and <code class=\"notranslate\">foo_bar</code> would be converted to the same Prometheus label <code class=\"notranslate\">label_foo_bar</code>.</p>\n<p dir=\"auto\">Kube-state-metrics automatically adds a suffix <code class=\"notranslate\">_conflictN</code> to resolve this conflict,<br>\nso it converts the above labels to<br>\n<code class=\"notranslate\">label_foo_bar_conflict1</code> and <code class=\"notranslate\">label_foo_bar_conflict2</code>.</p>\n<p dir=\"auto\">If you'd like to have more control over how this conflict is resolved,<br>\nyou might want to consider addressing this issue on a different level of the stack,<br>\ne.g. by standardizing Kubernetes labels using an<br>\n<a href=\"https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/\" rel=\"nofollow\">Admission Webhook</a><br>\nthat ensures that there are no possible conflicts.</p>\n<h4 dir=\"auto\">ECMAScript regular expression support for allow and deny lists</h4>\n<p dir=\"auto\">Starting from <a href=\"https://github.com/kubernetes/kube-state-metrics/pull/2616/files\">#2616</a>, kube-state-metrics supports ECMAScript's <code class=\"notranslate\">regexp</code> for allow and deny lists. This was incorporated as a workaround for the limitations of the <code class=\"notranslate\">regexp</code> package in Go, which does not support lookarounds due to their non-linear time complexity. Please note that while lookarounds are now supported for allow and deny lists, regular expressions' evaluation time is capped at a minute to prevent performance issues.</p>\n<h3 dir=\"auto\">Kube-state-metrics self metrics</h3>\n<p dir=\"auto\">kube-state-metrics exposes its own general process metrics under <code class=\"notranslate\">--telemetry-host</code> and <code class=\"notranslate\">--telemetry-port</code> (default 8081).</p>\n<p dir=\"auto\">kube-state-metrics also exposes list and watch success and error metrics. These can be used to calculate the error rate of list or watch resources.<br>\nIf you encounter those errors in the metrics, it is most likely a configuration or permission issue, and the next thing to investigate would be looking<br>\nat the logs of kube-state-metrics.</p>\n<p dir=\"auto\">Example of the above mentioned metrics:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"kube_state_metrics_list_total{resource=&quot;*v1.Node&quot;,result=&quot;success&quot;} 1\nkube_state_metrics_list_total{resource=&quot;*v1.Node&quot;,result=&quot;error&quot;} 52\nkube_state_metrics_watch_total{resource=&quot;*v1beta1.Ingress&quot;,result=&quot;success&quot;} 1\"><pre class=\"notranslate\"><code class=\"notranslate\">kube_state_metrics_list_total{resource=\"*v1.Node\",result=\"success\"} 1\nkube_state_metrics_list_total{resource=\"*v1.Node\",result=\"error\"} 52\nkube_state_metrics_watch_total{resource=\"*v1beta1.Ingress\",result=\"success\"} 1\n</code></pre></div>\n<p dir=\"auto\">kube-state-metrics also exposes some http request metrics, examples of those are:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"http_request_duration_seconds_bucket{handler=&quot;metrics&quot;,method=&quot;get&quot;,le=&quot;2.5&quot;} 30\nhttp_request_duration_seconds_bucket{handler=&quot;metrics&quot;,method=&quot;get&quot;,le=&quot;5&quot;} 30\nhttp_request_duration_seconds_bucket{handler=&quot;metrics&quot;,method=&quot;get&quot;,le=&quot;10&quot;} 30\nhttp_request_duration_seconds_bucket{handler=&quot;metrics&quot;,method=&quot;get&quot;,le=&quot;+Inf&quot;} 30\nhttp_request_duration_seconds_sum{handler=&quot;metrics&quot;,method=&quot;get&quot;} 0.021113919999999998\nhttp_request_duration_seconds_count{handler=&quot;metrics&quot;,method=&quot;get&quot;} 30\"><pre class=\"notranslate\"><code class=\"notranslate\">http_request_duration_seconds_bucket{handler=\"metrics\",method=\"get\",le=\"2.5\"} 30\nhttp_request_duration_seconds_bucket{handler=\"metrics\",method=\"get\",le=\"5\"} 30\nhttp_request_duration_seconds_bucket{handler=\"metrics\",method=\"get\",le=\"10\"} 30\nhttp_request_duration_seconds_bucket{handler=\"metrics\",method=\"get\",le=\"+Inf\"} 30\nhttp_request_duration_seconds_sum{handler=\"metrics\",method=\"get\"} 0.021113919999999998\nhttp_request_duration_seconds_count{handler=\"metrics\",method=\"get\"} 30\n</code></pre></div>\n<p dir=\"auto\">kube-state-metrics also exposes build and configuration metrics:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"kube_state_metrics_build_info{branch=&quot;main&quot;,goversion=&quot;go1.15.3&quot;,revision=&quot;6c9d775d&quot;,version=&quot;v2.0.0-beta&quot;} 1\nkube_state_metrics_shard_ordinal{shard_ordinal=&quot;0&quot;} 0\nkube_state_metrics_total_shards 1\"><pre class=\"notranslate\"><code class=\"notranslate\">kube_state_metrics_build_info{branch=\"main\",goversion=\"go1.15.3\",revision=\"6c9d775d\",version=\"v2.0.0-beta\"} 1\nkube_state_metrics_shard_ordinal{shard_ordinal=\"0\"} 0\nkube_state_metrics_total_shards 1\n</code></pre></div>\n<p dir=\"auto\"><code class=\"notranslate\">kube_state_metrics_build_info</code> is used to expose version and other build information. For more usage about the info pattern,<br>\nplease check the blog post <a href=\"https://www.robustperception.io/exposing-the-software-version-to-prometheus\" rel=\"nofollow\">here</a>.<br>\nSharding metrics expose <code class=\"notranslate\">--shard</code> and <code class=\"notranslate\">--total-shards</code> flags and can be used to validate<br>\nrun-time configuration, see <a href=\"./examples/prometheus-alerting-rules\"><code class=\"notranslate\">/examples/prometheus-alerting-rules</code></a>.</p>\n<p dir=\"auto\">kube-state-metrics also exposes metrics about it config file and the Custom Resource State config file:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"kube_state_metrics_config_hash{filename=&quot;crs.yml&quot;,type=&quot;customresourceconfig&quot;} 2.38272279311849e+14\nkube_state_metrics_config_hash{filename=&quot;config.yml&quot;,type=&quot;config&quot;} 2.65285922340846e+14\nkube_state_metrics_last_config_reload_success_timestamp_seconds{filename=&quot;crs.yml&quot;,type=&quot;customresourceconfig&quot;} 1.6704882592037103e+09\nkube_state_metrics_last_config_reload_success_timestamp_seconds{filename=&quot;config.yml&quot;,type=&quot;config&quot;} 1.6704882592035313e+09\nkube_state_metrics_last_config_reload_successful{filename=&quot;crs.yml&quot;,type=&quot;customresourceconfig&quot;} 1\nkube_state_metrics_last_config_reload_successful{filename=&quot;config.yml&quot;,type=&quot;config&quot;} 1\"><pre class=\"notranslate\"><code class=\"notranslate\">kube_state_metrics_config_hash{filename=\"crs.yml\",type=\"customresourceconfig\"} 2.38272279311849e+14\nkube_state_metrics_config_hash{filename=\"config.yml\",type=\"config\"} 2.65285922340846e+14\nkube_state_metrics_last_config_reload_success_timestamp_seconds{filename=\"crs.yml\",type=\"customresourceconfig\"} 1.6704882592037103e+09\nkube_state_metrics_last_config_reload_success_timestamp_seconds{filename=\"config.yml\",type=\"config\"} 1.6704882592035313e+09\nkube_state_metrics_last_config_reload_successful{filename=\"crs.yml\",type=\"customresourceconfig\"} 1\nkube_state_metrics_last_config_reload_successful{filename=\"config.yml\",type=\"config\"} 1\n</code></pre></div>\n<h3 dir=\"auto\">Scaling kube-state-metrics</h3>\n<h4 dir=\"auto\">Resource recommendation</h4>\n<p dir=\"auto\">Resource usage for kube-state-metrics changes with the Kubernetes objects (Pods/Nodes/Deployments/Secrets etc.) size of the cluster.<br>\nTo some extent, the Kubernetes objects in a cluster are in direct proportion to the node number of the cluster.</p>\n<p dir=\"auto\">As a general rule, you should allocate:</p>\n<ul dir=\"auto\">\n<li>250MiB memory</li>\n<li>0.1 cores</li>\n</ul>\n<p dir=\"auto\">Note that if CPU limits are set too low, kube-state-metrics' internal queues will not be able to be worked off quickly enough, resulting in increased memory consumption as the queue length grows. If you experience problems resulting from high memory allocation or CPU throttling, try increasing the CPU limits.</p>\n<h3 dir=\"auto\">Latency</h3>\n<p dir=\"auto\">In a 100 node cluster scaling test the latency numbers were as follows:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"&quot;Perc50&quot;: 259615384 ns,\n&quot;Perc90&quot;: 475000000 ns,\n&quot;Perc99&quot;: 906666666 ns.\"><pre class=\"notranslate\"><code class=\"notranslate\">\"Perc50\": 259615384 ns,\n\"Perc90\": 475000000 ns,\n\"Perc99\": 906666666 ns.\n</code></pre></div>\n<h3 dir=\"auto\">A note on costing</h3>\n<p dir=\"auto\">By default, kube-state-metrics exposes several metrics for events across your cluster. If you have a large number of frequently-updating resources on your cluster, you may find that a lot of data is ingested into these metrics. This can incur high costs on some cloud providers. Please take a moment to <a href=\"docs/developer/cli-arguments.md\">configure what metrics you'd like to expose</a>, as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.</p>\n<h3 dir=\"auto\">kube-state-metrics vs. metrics-server</h3>\n<p dir=\"auto\">The <a href=\"https://github.com/kubernetes-incubator/metrics-server\">metrics-server</a><br>\nis a project that has been inspired by<br>\n<a href=\"https://github.com/kubernetes-retired/heapster\">Heapster</a> and is implemented<br>\nto serve the goals of core metrics pipelines in <a href=\"https://github.com/kubernetes/design-proposals-archive/blob/main/instrumentation/monitoring_architecture.md\">Kubernetes monitoring<br>\narchitecture</a>.<br>\nIt is a cluster level component which periodically scrapes metrics from all<br>\nKubernetes nodes served by Kubelet through Metrics API. The metrics are<br>\naggregated, stored in memory and served in <a href=\"https://git.k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go\" rel=\"nofollow\">Metrics API<br>\nformat</a>. The<br>\nmetrics-server stores the latest values only and is not responsible for<br>\nforwarding metrics to third-party destinations.</p>\n<p dir=\"auto\">kube-state-metrics is focused on generating completely new metrics from<br>\nKubernetes' object state (e.g. metrics based on deployments, replica sets,<br>\netc.). It holds an entire snapshot of Kubernetes state in memory and<br>\ncontinuously generates new metrics based off of it. And just like the<br>\nmetrics-server it too is not responsible for exporting its metrics anywhere.</p>\n<p dir=\"auto\">Having kube-state-metrics as a separate project also enables access to these<br>\nmetrics from monitoring systems such as Prometheus.</p>\n<h3 dir=\"auto\">Horizontal sharding</h3>\n<p dir=\"auto\">In order to shard kube-state-metrics horizontally, some automated sharding capabilities have been implemented. It is configured with the following flags:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">--shard</code> (zero indexed)</li>\n<li><code class=\"notranslate\">--total-shards</code></li>\n</ul>\n<p dir=\"auto\">Sharding is done by taking an md5 sum of the Kubernetes Object's UID and performing a modulo operation on it with the total number of shards. Each shard decides whether the object is handled by the respective instance of kube-state-metrics or not. Note that this means all instances of kube-state-metrics, even if sharded, will have the network traffic and the resource consumption for unmarshaling objects for all objects, not just the ones they are responsible for. To optimize this further, the Kubernetes API would need to support sharded list/watch capabilities. In the optimal case, memory consumption for each shard will be 1/n compared to an unsharded setup. Typically, kube-state-metrics needs to be memory and latency optimized in order for it to return its metrics rather quickly to Prometheus. One way to reduce the latency between kube-state-metrics and the kube-apiserver is to run KSM with the <code class=\"notranslate\">--use-apiserver-cache</code> flag. In addition to reducing the latency, this option will also lead to a reduction in the load on etcd.</p>\n<p dir=\"auto\">Sharding should be used carefully and additional monitoring should be set up in order to ensure that sharding is set up and functioning as expected (eg. instances for each shard out of the total shards are configured).</p>\n<h4 dir=\"auto\">Automated sharding</h4>\n<p dir=\"auto\">Automatic sharding allows each shard to discover its nominal position when deployed in a StatefulSet which is useful for automatically configuring sharding. This is an experimental feature and may be broken or removed without notice.</p>\n<p dir=\"auto\">To enable automated sharding, kube-state-metrics must be run by a <code class=\"notranslate\">StatefulSet</code> and the pod name and namespace must be handed to the kube-state-metrics process via the <code class=\"notranslate\">--pod</code> and <code class=\"notranslate\">--pod-namespace</code> flags. Example manifests demonstrating the autosharding functionality can be found in <a href=\"./examples/autosharding\"><code class=\"notranslate\">/examples/autosharding</code></a>.</p>\n<p dir=\"auto\">This way of deploying shards is useful when you want to manage KSM shards through a single Kubernetes resource (a single <code class=\"notranslate\">StatefulSet</code> in this case) instead of having one <code class=\"notranslate\">Deployment</code> per shard. The advantage can be especially significant when deploying a high number of shards.</p>\n<p dir=\"auto\">The downside of using an auto-sharded setup comes from the rollout strategy supported by <code class=\"notranslate\">StatefulSet</code>s. When managed by a <code class=\"notranslate\">StatefulSet</code>, pods are replaced one at a time with each pod first getting terminated and then recreated. Besides such rollouts being slower, they will also lead to short downtime for each shard. If a Prometheus scrape happens during a rollout, it can miss some of the metrics exported by kube-state-metrics.</p>\n<h3 dir=\"auto\">Daemonset sharding for pod metrics</h3>\n<p dir=\"auto\">For pod metrics, they can be sharded per node with the following flag:</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">--node=$(NODE_NAME)</code></li>\n</ul>\n<p dir=\"auto\">Each kube-state-metrics pod uses FieldSelector (spec.nodeName) to watch/list pod metrics only on the same node.</p>\n<p dir=\"auto\">A daemonset kube-state-metrics example:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"apiVersion: apps/v1\nkind: DaemonSet\nspec:\n  template:\n    spec:\n      containers:\n      - image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG\n        name: kube-state-metrics\n        args:\n        - --resource=pods\n        - --node=$(NODE_NAME)\n        env:\n        - name: NODE_NAME\n          valueFrom:\n            fieldRef:\n              apiVersion: v1\n              fieldPath: spec.nodeName\"><pre class=\"notranslate\"><code class=\"notranslate\">apiVersion: apps/v1\nkind: DaemonSet\nspec:\n  template:\n    spec:\n      containers:\n      - image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG\n        name: kube-state-metrics\n        args:\n        - --resource=pods\n        - --node=$(NODE_NAME)\n        env:\n        - name: NODE_NAME\n          valueFrom:\n            fieldRef:\n              apiVersion: v1\n              fieldPath: spec.nodeName\n</code></pre></div>\n<p dir=\"auto\">To track metrics for unassigned pods, you need to add an additional deployment and set <code class=\"notranslate\">--track-unscheduled-pods</code>, as shown in the following example:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"apiVersion: apps/v1\nkind: Deployment\nspec:\n  template:\n    spec:\n      containers:\n      - image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG\n        name: kube-state-metrics\n        args:\n        - --resources=pods\n        - --track-unscheduled-pods\"><pre class=\"notranslate\"><code class=\"notranslate\">apiVersion: apps/v1\nkind: Deployment\nspec:\n  template:\n    spec:\n      containers:\n      - image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG\n        name: kube-state-metrics\n        args:\n        - --resources=pods\n        - --track-unscheduled-pods\n</code></pre></div>\n<p dir=\"auto\">Other metrics can be sharded via <a href=\"#horizontal-sharding\">Horizontal sharding</a>.</p>\n<h3 dir=\"auto\">Setup</h3>\n<p dir=\"auto\">Install this project to your <code class=\"notranslate\">$GOPATH</code> using <code class=\"notranslate\">go get</code>:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"go get k8s.io/kube-state-metrics\"><pre class=\"notranslate\"><code class=\"notranslate\">go get k8s.io/kube-state-metrics\n</code></pre></div>\n<h4 dir=\"auto\">Building the Docker container</h4>\n<p dir=\"auto\">Simply run the following command in this root folder, which will create a<br>\nself-contained, statically-linked binary and build a Docker image:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"make container\"><pre class=\"notranslate\"><code class=\"notranslate\">make container\n</code></pre></div>\n<h3 dir=\"auto\">Usage</h3>\n<p dir=\"auto\">Simply build and run kube-state-metrics inside a Kubernetes pod which has a<br>\nservice account token that has read-only access to the Kubernetes cluster.</p>\n<h4 dir=\"auto\">For users of prometheus-operator/kube-prometheus stack</h4>\n<p dir=\"auto\">The (<a href=\"https://github.com/prometheus-operator/kube-prometheus/\"><code class=\"notranslate\">kube-prometheus</code></a>) stack installs kube-state-metrics as one of its <a href=\"https://github.com/prometheus-operator/kube-prometheus#kube-prometheus\">components</a>; you do not need to install kube-state-metrics if you're using the kube-prometheus stack.</p>\n<p dir=\"auto\">If you want to revise the default configuration for kube-prometheus, for example to enable non-default metrics, have a look at <a href=\"https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizing.md\">Customizing Kube-Prometheus</a>.</p>\n<h4 dir=\"auto\">Kubernetes Deployment</h4>\n<p dir=\"auto\">To deploy this project, you can simply run <code class=\"notranslate\">kubectl apply -f examples/standard</code> and a Kubernetes service and deployment will be created. (Note: Adjust the apiVersion of some resource if your kubernetes cluster's version is not 1.8+, check the yaml file for more information).</p>\n<p dir=\"auto\">To have Prometheus discover kube-state-metrics instances it is advised to create a specific Prometheus scrape config for kube-state-metrics that picks up both metrics endpoints. Annotation based discovery is discouraged as only one of the endpoints would be able to be selected, plus kube-state-metrics in most cases has special authentication and authorization requirements as it essentially grants read access through the metrics endpoint to most information available to it.</p>\n<p dir=\"auto\"><strong>Note:</strong> Google Kubernetes Engine (GKE) Users - GKE has strict role permissions that will prevent the kube-state-metrics roles and role bindings from being created. To work around this, you can give your GCP identity the cluster-admin role by running the following one-liner:</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud info --format='value(config.account)')\"><pre class=\"notranslate\"><code class=\"notranslate\">kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud info --format='value(config.account)')\n</code></pre></div>\n<p dir=\"auto\">Note that your GCP identity is case sensitive but <code class=\"notranslate\">gcloud info</code> as of Google Cloud SDK 221.0.0 is not. This means that if your IAM member contains capital letters, the above one-liner may not work for you. If you have 403 forbidden responses after running the above command and <code class=\"notranslate\">kubectl apply -f examples/standard</code>, check the IAM member associated with your account at <a href=\"https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID\" rel=\"nofollow\">https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID</a>. If it contains capital letters, you may need to set the --user flag in the command above to the case-sensitive role listed at <a href=\"https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID\" rel=\"nofollow\">https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID</a>.</p>\n<p dir=\"auto\">After running the above, if you see <code class=\"notranslate\">Clusterrolebinding \"cluster-admin-binding\" created</code>, then you are able to continue with the setup of this service.</p>\n<h4 dir=\"auto\">Healthcheck Endpoints</h4>\n<p dir=\"auto\">The following healthcheck endpoints are available (<code class=\"notranslate\">self</code> refers to the telemetry port, while <code class=\"notranslate\">main</code> refers to the exposition port):</p>\n<ul dir=\"auto\">\n<li><code class=\"notranslate\">/healthz</code> (exposed on <code class=\"notranslate\">main</code>): Returns a 200 status code if the application is running. We recommend to use this for the startup probe.</li>\n<li><code class=\"notranslate\">/livez</code> (exposed on <code class=\"notranslate\">main</code>): Returns a 200 status code if the application is not affected by an outage of the Kubernetes API Server. We recommend to using this for the liveness probe.</li>\n<li><code class=\"notranslate\">/readyz</code> (exposed on <code class=\"notranslate\">self</code>): Returns a 200 status code if the application is ready to accept requests and expose metrics. We recommend using this for the readiness probe.</li>\n</ul>\n<p dir=\"auto\">Note that it is discouraged to use the telemetry metrics endpoint for any probe when proxying the exposition data.</p>\n<h4 dir=\"auto\">Limited privileges environment</h4>\n<p dir=\"auto\">If you want to run kube-state-metrics in an environment where you don't have cluster-reader role, you can:</p>\n<ul dir=\"auto\">\n<li>create a serviceaccount</li>\n</ul>\n<div class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"apiVersion: v1\nkind: ServiceAccount\nmetadata:\n  name: kube-state-metrics\n  namespace: your-namespace-where-kube-state-metrics-will-deployed\"><pre class=\"notranslate\"><span class=\"pl-ent\">apiVersion</span>: <span class=\"pl-c1\">v1</span>\n<span class=\"pl-ent\">kind</span>: <span class=\"pl-s\">ServiceAccount</span>\n<span class=\"pl-ent\">metadata</span>:\n  <span class=\"pl-ent\">name</span>: <span class=\"pl-s\">kube-state-metrics</span>\n  <span class=\"pl-ent\">namespace</span>: <span class=\"pl-s\">your-namespace-where-kube-state-metrics-will-deployed</span></pre></div>\n<ul dir=\"auto\">\n<li>give it <code class=\"notranslate\">view</code> privileges on specific namespaces (using roleBinding) (<em>note: you can add this roleBinding to all the NS you want your serviceaccount to access</em>)</li>\n</ul>\n<div class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"apiVersion: rbac.authorization.k8s.io/v1\nkind: RoleBinding\nmetadata:\n  name: kube-state-metrics\n  namespace: project1\nroleRef:\n  apiGroup: rbac.authorization.k8s.io\n  kind: ClusterRole\n  name: view\nsubjects:\n  - kind: ServiceAccount\n    name: kube-state-metrics\n    namespace: your-namespace-where-kube-state-metrics-will-deployed\"><pre class=\"notranslate\"><span class=\"pl-ent\">apiVersion</span>: <span class=\"pl-s\">rbac.authorization.k8s.io/v1</span>\n<span class=\"pl-ent\">kind</span>: <span class=\"pl-s\">RoleBinding</span>\n<span class=\"pl-ent\">metadata</span>:\n  <span class=\"pl-ent\">name</span>: <span class=\"pl-s\">kube-state-metrics</span>\n  <span class=\"pl-ent\">namespace</span>: <span class=\"pl-s\">project1</span>\n<span class=\"pl-ent\">roleRef</span>:\n  <span class=\"pl-ent\">apiGroup</span>: <span class=\"pl-s\">rbac.authorization.k8s.io</span>\n  <span class=\"pl-ent\">kind</span>: <span class=\"pl-s\">ClusterRole</span>\n  <span class=\"pl-ent\">name</span>: <span class=\"pl-s\">view</span>\n<span class=\"pl-ent\">subjects</span>:\n  - <span class=\"pl-ent\">kind</span>: <span class=\"pl-s\">ServiceAccount</span>\n    <span class=\"pl-ent\">name</span>: <span class=\"pl-s\">kube-state-metrics</span>\n    <span class=\"pl-ent\">namespace</span>: <span class=\"pl-s\">your-namespace-where-kube-state-metrics-will-deployed</span></pre></div>\n<ul dir=\"auto\">\n<li>then specify a set of namespaces (using the <code class=\"notranslate\">--namespaces</code> option) and a set of kubernetes objects (using the <code class=\"notranslate\">--resources</code>) that your serviceaccount has access to in the <code class=\"notranslate\">kube-state-metrics</code> deployment configuration</li>\n</ul>\n<div class=\"highlight highlight-source-yaml notranslate position-relative overflow-auto\" dir=\"auto\" data-snippet-clipboard-copy-content=\"spec:\n  template:\n    spec:\n      containers:\n      - name: kube-state-metrics\n        args:\n          - '--resources=pods'\n          - '--namespaces=project1'\"><pre class=\"notranslate\"><span class=\"pl-ent\">spec</span>:\n  <span class=\"pl-ent\">template</span>:\n    <span class=\"pl-ent\">spec</span>:\n      <span class=\"pl-ent\">containers</span>:\n      - <span class=\"pl-ent\">name</span>: <span class=\"pl-s\">kube-state-metrics</span>\n        <span class=\"pl-ent\">args</span>:\n          - <span class=\"pl-s\"><span class=\"pl-pds\">'</span>--resources=pods<span class=\"pl-pds\">'</span></span>\n          - <span class=\"pl-s\"><span class=\"pl-pds\">'</span>--namespaces=project1<span class=\"pl-pds\">'</span></span></pre></div>\n<p dir=\"auto\">For the full list of arguments available, see the documentation in <a href=\"./docs/developer/cli-arguments.md\">docs/developer/cli-arguments.md</a></p>\n<h4 dir=\"auto\">Helm Chart</h4>\n<p dir=\"auto\">Starting from the kube-state-metrics chart <code class=\"notranslate\">v2.13.3</code> (kube-state-metrics image <code class=\"notranslate\">v1.9.8</code>), the official <a href=\"https://artifacthub.io/packages/helm/prometheus-community/kube-state-metrics/\" rel=\"nofollow\">Helm chart</a> is maintained in <a href=\"https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics\">prometheus-community/helm-charts</a>. Starting from kube-state-metrics chart <code class=\"notranslate\">v3.0.0</code> only kube-state-metrics images of <code class=\"notranslate\">v2.0.0 +</code> are supported.</p>\n<h4 dir=\"auto\">Development</h4>\n<p dir=\"auto\">When developing, test a metric dump against your local Kubernetes cluster by running:</p>\n<blockquote>\n<p dir=\"auto\">Users can override the apiserver address in KUBE-CONFIG file with <code class=\"notranslate\">--apiserver</code> command line.</p>\n</blockquote>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"go install\nkube-state-metrics --port=8080 --telemetry-port=8081 --kubeconfig=&lt;KUBE-CONFIG&gt; --apiserver=&lt;APISERVER&gt;\"><pre class=\"notranslate\"><code class=\"notranslate\">go install\nkube-state-metrics --port=8080 --telemetry-port=8081 --kubeconfig=&lt;KUBE-CONFIG&gt; --apiserver=&lt;APISERVER&gt;\n</code></pre></div>\n<p dir=\"auto\">Then curl the metrics endpoint</p>\n<div class=\"snippet-clipboard-content notranslate position-relative overflow-auto\" data-snippet-clipboard-copy-content=\"curl localhost:8080/metrics\"><pre class=\"notranslate\"><code class=\"notranslate\">curl localhost:8080/metrics\n</code></pre></div>\n<p dir=\"auto\">To run the e2e tests locally see the documentation in <a href=\"./tests/README.md\">tests/README.md</a>.</p>\n<h4 dir=\"auto\">Developer Contributions</h4>\n<p dir=\"auto\">When developing, there are certain code patterns to follow to better your contributing experience and likelihood of e2e and other ci tests to pass. To learn more about them, see the documentation in <a href=\"./docs/developer/guide.md\">docs/developer/guide.md</a>.</p>\n<h4 dir=\"auto\">Community</h4>\n<p dir=\"auto\">This project is sponsored by <a href=\"https://github.com/kubernetes/community/tree/master/sig-instrumentation\">SIG Instrumentation</a>.</p>\n<p dir=\"auto\">There is also a channel for <a href=\"https://kubernetes.slack.com/archives/CJJ529RUY\" rel=\"nofollow\">#kube-state-metrics</a> on Kubernetes' Slack.</p>\n<p dir=\"auto\">You can also join the SIG Instrumentation <a href=\"https://groups.google.com/forum/#!forum/kubernetes-sig-instrumentation\" rel=\"nofollow\">mailing list</a>.<br>\nThis will typically add invites for the following meetings to your calendar, in which topics around kube-state-metrics can be discussed.</p>\n<ul dir=\"auto\">\n<li>Regular SIG Meeting: <a href=\"https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09\" rel=\"nofollow\">Thursdays at 9:30 PT (Pacific Time)</a> (biweekly). <a href=\"http://www.thetimezoneconverter.com/?t=9:30&amp;tz=PT%20%28Pacific%20Time%29\" rel=\"nofollow\">Convert to your timezone</a>.</li>\n<li>Regular Triage Meeting: <a href=\"https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09\" rel=\"nofollow\">Thursdays at 9:30 PT (Pacific Time)</a> (biweekly - alternating with regular meeting). <a href=\"http://www.thetimezoneconverter.com/?t=9:30&amp;tz=PT%20%28Pacific%20Time%29\" rel=\"nofollow\">Convert to your timezone</a>.</li>\n</ul>","updatedAt":"2025-05-21T16:09:08Z","upvoteCount":null,"author":{"login":"eryajf","avatarUrl":"https://avatars.githubusercontent.com/u/33259379?u=e4a4090a38ac2473aaed4ef9945233636776c6c3&v=4","url":"https://github.com/eryajf"},"category":null,"labels":{"edges":[{"node":{"name":"更多","color":"25B472"}},{"node":{"name":"Prometheus-Exporter","color":"367acb"}},{"node":{"name":"kubernetes","color":"9273f9"}}]},"comments":{"edges":[]}}},"pageContext":{"number":334,"previous":{"title":"kubernetes-sigs/kubespray: 部署一个生产環境的 Kubernetes 集群","number":333},"next":{"title":"danielfoehrKn/kubeswitch: 一款 k8s 多集群配置文件管理切换工具","number":335}}},
    "staticQueryHashes": ["151096407","2861350382"]}