Compare commits
774 Commits
Author | SHA1 | Date |
---|---|---|
|
bc45a49c9b | |
|
012b46d220 | |
|
1556ac589f | |
|
547afad282 | |
|
997272f779 | |
|
bd174abd54 | |
|
b5820387c0 | |
|
bc1e7f8965 | |
|
b30335fa54 | |
|
9222ba465f | |
|
95b29ac8a9 | |
|
f8f39bc9fc | |
|
3a0eec4626 | |
|
d680e8c991 | |
|
921147623e | |
|
5de7a63748 | |
|
0a50cabaf9 | |
|
72ed667151 | |
|
9add5df58e | |
|
61cb551bb5 | |
|
fc6ab5bf65 | |
|
c309d3a00f | |
|
cb6bdd2046 | |
|
dc54dc6580 | |
|
63a0298d5a | |
|
61be81fa1f | |
|
c106a38fab | |
|
104c83fb9f | |
|
9f6f1cd762 | |
|
f421b9a69a | |
|
dd2ca7b09b | |
|
6942640a45 | |
|
a483701408 | |
|
56d3b561e6 | |
|
dff9a1e8f5 | |
|
a0889d56c8 | |
|
edc9db4649 | |
|
0a8f32ff12 | |
|
291a962840 | |
|
c6ae6f53f7 | |
|
9576360078 | |
|
8b2aa61c70 | |
|
d59fe58df9 | |
|
5e8e4fffa6 | |
|
301240eccc | |
|
a5789613f1 | |
|
15e6171c37 | |
|
873c140040 | |
|
5c130dadad | |
|
2258ba71e8 | |
|
55d2a7cfac | |
|
97bfa326ab | |
|
ea6b123caf | |
|
b9068888d0 | |
|
dbf6e9b4e2 | |
|
d84b10a125 | |
|
775e4586ad | |
|
bea09e59f0 | |
|
4519b2848b | |
|
99224f2c29 | |
|
84e2d8fe69 | |
|
6beab20acd | |
|
bb2ad9d2ea | |
|
28bf0e817d | |
|
1018969872 | |
|
043b59ab08 | |
|
8ec1fb3c15 | |
|
e178d8e582 | |
|
20af6bac6d | |
|
9ea1495953 | |
|
090535fcd2 | |
|
d45250dec2 | |
|
3b21633bee | |
|
0b01e3abce | |
|
012b785665 | |
|
209f3ab5fa | |
|
d060e4f32c | |
|
aab32a9e1a | |
|
e204ab31cb | |
|
38e2fa6e53 | |
|
f6e2b5fbda | |
|
3aee5ff2bb | |
|
55e124f509 | |
|
f0f9898fa1 | |
|
a0d9835e78 | |
|
a09d690396 | |
|
05187b47e2 | |
|
518db3d3cd | |
|
0c029b690e | |
|
ffd8f41131 | |
|
4f62f0fde4 | |
|
1c923dc83b | |
|
a6ff8ae41c | |
|
b528c28f7e | |
|
bc2a57140c | |
|
5f116914f1 | |
|
8b631bbff4 | |
|
bc60722ddd | |
|
456ac8f2e8 | |
|
aa6e88c2d5 | |
|
b3d26f7a9f | |
|
40602cb3e3 | |
|
a3972f90ab | |
|
dab65d7cb4 | |
|
05e45869ff | |
|
3d73ddbd09 | |
|
5906b6dc9e | |
|
c853e41fee | |
|
2c423907a3 | |
|
0129759430 | |
|
c405dcf1f3 | |
|
7f9b0d1189 | |
|
a775fe3458 | |
|
3527ceb4d5 | |
|
9ce7e6b771 | |
|
cd49aeac35 | |
|
16db8b7368 | |
|
350a7c472e | |
|
919ce06ec7 | |
|
2a95d4649b | |
|
dc60c09548 | |
|
4fa35209c1 | |
|
4a585c91be | |
|
25eda406ea | |
|
c7caee60c9 | |
|
b6305cb93b | |
|
faf377ea13 | |
|
33250c57f5 | |
|
c3b1afe61c | |
|
d4f79cbe7f | |
|
9cf257a9b3 | |
|
afc7bbcd01 | |
|
662afca405 | |
|
21df5706ea | |
|
61134a08b6 | |
|
0c69b3567a | |
|
288b3cf855 | |
|
88ef004119 | |
|
9f3ebac101 | |
|
3b72e1943b | |
|
ee0d05d15a | |
|
ecf94572bf | |
|
c198a18d28 | |
|
4955306dfa | |
|
1e06e16967 | |
|
387bd8b244 | |
|
ae38bc4e67 | |
|
89f8110d61 | |
|
0591d0bd71 | |
|
279f84b095 | |
|
1412eaa183 | |
|
a4d64fb993 | |
|
d3f0c1853f | |
|
6cfc844ca0 | |
|
b5abea9294 | |
|
543738ba62 | |
|
7c2b8b5c09 | |
|
ace5a4b236 | |
|
36318bb970 | |
|
ea3f5fac90 | |
|
fb28420d3c | |
|
4bce5ea4bd | |
|
4a96a782fc | |
|
5e332b307a | |
|
69ce9757f5 | |
|
ca0df61115 | |
|
56316019cd | |
|
32e7727ff4 | |
|
9652811b2f | |
|
098e785d08 | |
|
c4565c44b9 | |
|
ce98457f1b | |
|
76308fc8b8 | |
|
b3ac231a32 | |
|
20f30233bd | |
|
170bbd4c62 | |
|
ea5826a92c | |
|
dcfaae9890 | |
|
0ee2640bb9 | |
|
7657b02cd2 | |
|
f09d015f43 | |
|
acbf6d390b | |
|
7ac99685c1 | |
|
690b9627f5 | |
|
7677b414e0 | |
|
cacc980de3 | |
|
3736c9aa82 | |
|
8859a4289d | |
|
17151aca65 | |
|
e763ea2aa3 | |
|
b4d98d7b40 | |
|
77e564ba5d | |
|
cad704d488 | |
|
d7d2d89017 | |
|
0bcfd5bba5 | |
|
b6499c9af7 | |
|
5e7d0f4523 | |
|
c5665b69bf | |
|
7a54a8ebf0 | |
|
b2c8fa7837 | |
|
ba7ff1a0e5 | |
|
34abbcf202 | |
|
076987a505 | |
|
1734bd8403 | |
|
c87b507116 | |
|
9c61d7ea81 | |
|
c804368d08 | |
|
fa27721993 | |
|
0303532851 | |
|
02b6a214c6 | |
|
b0e9be550b | |
|
fac6119d43 | |
|
0738de0be2 | |
|
dfb688c966 | |
|
61a1993fdc | |
|
c67f02f0f3 | |
|
7980f03c52 | |
|
37f10f0602 | |
|
ca66c9d344 | |
|
ea648da9c6 | |
|
70088ed1ea | |
|
f94ef65cc7 | |
|
e5eb2ed132 | |
|
2c346763cf | |
|
31f793129f | |
|
2aa766ee03 | |
|
9f15cc1c8c | |
|
63749c5d15 | |
|
75e7841c10 | |
|
3c6bc83911 | |
|
c24e50d042 | |
|
17c69692c4 | |
|
eb5e34701d | |
|
110f03d733 | |
|
45b7e20ee3 | |
|
2db568c4fc | |
|
3b5c6240a9 | |
|
32d5ab5ac5 | |
|
7574addd80 | |
|
51f854f305 | |
|
2dacb29426 | |
|
f3ff773d31 | |
|
9652c29fe6 | |
|
5c43e10fa0 | |
|
f9c945aef5 | |
|
0a331e1a60 | |
|
e14a9d771c | |
|
ea7034553f | |
|
75fba81cf3 | |
|
28129e4d6d | |
|
e29519112d | |
|
d7f7bd5297 | |
|
90e7e1178c | |
|
f3b7593031 | |
|
77a99a52c5 | |
|
bd6beed33b | |
|
0013d73987 | |
|
4356a0f66e | |
|
a936341496 | |
|
cd29fabd66 | |
|
de58db2ed4 | |
|
166921b797 | |
|
7b375e9ef4 | |
|
2c5a2499f0 | |
|
49b25a87b9 | |
|
f7ac762056 | |
|
ecbb910841 | |
|
f2a76390e1 | |
|
3e2d1e9d9a | |
|
ba9eb94f51 | |
|
294163d5d6 | |
|
fb46163add | |
|
f7ec4da618 | |
|
f50205a4df | |
|
4b420cb6f7 | |
|
826134a3ff | |
|
9322447ced | |
|
0b64d71e6b | |
|
f2ab628d2b | |
|
24c2194e7e | |
|
9aad0c02f3 | |
|
012121e50e | |
|
1a1ca73eca | |
|
8195dbe969 | |
|
3d969c5ce9 | |
|
76ef24190d | |
|
f34cd69cee | |
|
aebbb39082 | |
|
3a10a4ee2e | |
|
52ae178b7d | |
|
3dced14afe | |
|
24b0f7fffa | |
|
12a2291287 | |
|
4aced25f69 | |
|
db01d3eb02 | |
|
805b70a086 | |
|
e6f359db36 | |
|
218f051024 | |
|
643739d04a | |
|
20589ac310 | |
|
082aba26c0 | |
|
c864c93606 | |
|
4d82424e9e | |
|
8e4a2ec7c9 | |
|
518a39aae1 | |
|
029b6d3a97 | |
|
1e8fd2c107 | |
|
48ade3d36b | |
|
1408e45721 | |
|
f7304dc8d8 | |
|
8359c102fa | |
|
dec7a1b93e | |
|
2762759041 | |
|
894862eb6a | |
|
0a86b24b08 | |
|
089ed4551f | |
|
f8aa7d9bb9 | |
|
ab06f81c00 | |
|
2548615cd7 | |
|
a652104dec | |
|
b1c2e0c1cf | |
|
b43702ed14 | |
|
cdce0e3278 | |
|
311d3f749a | |
|
720ea8cd89 | |
|
aeade61698 | |
|
f44bafd9af | |
|
312b298239 | |
|
3aebcf71a9 | |
|
45b5a26c3e | |
|
5878458d97 | |
|
74d226ccf0 | |
|
cc79a58411 | |
|
d1e717911b | |
|
0dd960eb31 | |
|
e96dfc0a39 | |
|
aeb9e355b5 | |
|
e18b5573ac | |
|
eda1984438 | |
|
19a0544f44 | |
|
c9ceded724 | |
|
bb5a37c6e9 | |
|
4a524950f1 | |
|
85f8a2c4cc | |
|
49e1170f67 | |
|
b27845d535 | |
|
8f3c5c432b | |
|
b45913db59 | |
|
a3e9266c8f | |
|
38c2689093 | |
|
8753dfd5b7 | |
|
76c5888e34 | |
|
b8c1166153 | |
|
b4f4dff5c5 | |
|
7104d579e9 | |
|
2e4b3e4965 | |
|
5972617294 | |
|
eea0524d54 | |
|
f7618dfc32 | |
|
dbb0276a42 | |
|
a1fb0ce267 | |
|
b954ff66f6 | |
|
b980579e08 | |
|
dae1f062c0 | |
|
85d1423b5b | |
|
6e1ca9923d | |
|
d01ed2f8de | |
|
f6c5a4bb2c | |
|
dc86adec12 | |
|
d862cacaa6 | |
|
6f8f7d1f7b | |
|
eb80c09755 | |
|
f4ab888d57 | |
|
1483f22ce4 | |
|
086af0cbaf | |
|
2aa41eef9a | |
|
4269ab10ab | |
|
fba4a75753 | |
|
2bd0b60b5a | |
|
9dfddac86a | |
|
5ac3eff94b | |
|
c99e26a229 | |
|
f954f30419 | |
|
124117ff27 | |
|
5d387b0f89 | |
|
dba6d4d7e4 | |
|
9f61037781 | |
|
8760088b49 | |
|
89f0db6dd2 | |
|
cd460fef29 | |
|
669b5018f2 | |
|
3a81bf3528 | |
|
698f76a8d5 | |
|
ee3913967e | |
|
28dbd26540 | |
|
b4f032ecfd | |
|
e97933bcb9 | |
|
738e6befae | |
|
7995d5fd23 | |
|
f28abc9258 | |
|
a4ddfe6ed9 | |
|
ab03a29d46 | |
|
c38f24b2aa | |
|
bb0a33c7a6 | |
|
9917008f7e | |
|
8c75a8b589 | |
|
85762cdf97 | |
|
d01fb796da | |
|
d8dd6e0704 | |
|
b6697e5166 | |
|
b983ed5f42 | |
|
8867e6ece9 | |
|
7caed2384c | |
|
2b2d1dc133 | |
|
fa083b53d0 | |
|
63a7bc9bc7 | |
|
93e8d99a7d | |
|
a5e168f269 | |
|
2b8eea4e27 | |
|
2a23510019 | |
|
7fc6c5dd2e | |
|
a0f5ebef42 | |
|
9e6e70d328 | |
|
569e820c65 | |
|
6d8f7573aa | |
|
8b8c93c62a | |
|
86846679a3 | |
|
be6fc00d98 | |
|
b1b8d24cbf | |
|
ef4fceac06 | |
|
610918ea24 | |
|
a40944b47b | |
|
ba23b77203 | |
|
ff78ed0f07 | |
|
9e855147a2 | |
|
1be8dafc30 | |
|
e8a9bcfed9 | |
|
623952925d | |
|
07364ba2c1 | |
|
0c030421ca | |
|
851c01d0fd | |
|
fd2a1f83f3 | |
|
d7d561f999 | |
|
b72faf3af9 | |
|
ea8a7f8c33 | |
|
071c523e20 | |
|
20895032eb | |
|
7aa1659a35 | |
|
d4ae486023 | |
|
1669ae6c77 | |
|
66601c2be4 | |
|
3fc953561f | |
|
1e8b837eb1 | |
|
48050aea65 | |
|
3478fe9ddd | |
|
3f44ad0f7b | |
|
97b10ea5e7 | |
|
768a0a4338 | |
|
fa5eb67feb | |
|
2a06c45061 | |
|
0a8b3b4aad | |
|
8e7b38d516 | |
|
f9f1d5036a | |
|
fea5dfd26d | |
|
a3489c0ace | |
|
97c710b40d | |
|
097ae84c0c | |
|
9ba2547ca7 | |
|
3cf239076f | |
|
0cb296564b | |
|
9ba1c37021 | |
|
ce23b82cd8 | |
|
393430ed86 | |
|
44c65d2723 | |
|
195d277259 | |
|
e74428eb1e | |
|
c92541d2bd | |
|
a1329c1d22 | |
|
8f2224ec37 | |
|
8481b06a25 | |
|
42a499930a | |
|
01507af984 | |
|
122e5e8999 | |
|
e52dcc8695 | |
|
0fb6eee2af | |
|
dbdb77c920 | |
|
8876d40ecd | |
|
e9435887d5 | |
|
e0c3e8384a | |
|
b6496c7fb4 | |
|
883296e946 | |
|
0e23fdbe5a | |
|
67f184cb13 | |
|
bfa611dc51 | |
|
4be2ddf3f7 | |
|
ee2f53a2f1 | |
|
90bd24f27c | |
|
a04bba69ca | |
|
51ccb665c4 | |
|
fde27ece8a | |
|
7324ae5f12 | |
|
50411374cd | |
|
37ceaf4218 | |
|
5834d64a65 | |
|
f94716aa74 | |
|
d99a440774 | |
|
9bbed501f2 | |
|
4cbd42a56d | |
|
091ddf9d96 | |
|
532fb2dba7 | |
|
c11318fa83 | |
|
5058e146cd | |
|
1091bf4318 | |
|
4cbea37226 | |
|
b49d390298 | |
|
adf5df45bf | |
|
39ffa00576 | |
|
a73ae3d6bf | |
|
1fe8e08c13 | |
|
960857e501 | |
|
d247126d90 | |
|
0442ef339e | |
|
ef8f1bfa32 | |
|
4de960dc39 | |
|
376b033ab5 | |
|
fd3cd41fe6 | |
|
245d7fcc18 | |
|
02d0c940c8 | |
|
b948807ba3 | |
|
ed1a7f992c | |
|
0bc4b19ac5 | |
|
069aeebaa3 | |
|
a403bb3ff5 | |
|
8c1153e15d | |
|
5ab665a68b | |
|
14e935a49f | |
|
ca569e1ffe | |
|
622efeee0a | |
|
bee257a1a1 | |
|
4c9c2ddc05 | |
|
b195db65c4 | |
|
3d0f76bcd4 | |
|
84acb90341 | |
|
c707af4c2d | |
|
a017f90941 | |
|
98b38ba9bb | |
|
ad0e06c453 | |
|
d3fe638cab | |
|
240cffd908 | |
|
e09df21d5d | |
|
f25f840a55 | |
|
be0082792a | |
|
fcc7927ffb | |
|
87ad659502 | |
|
c299a591f6 | |
|
bef45e8815 | |
|
2b2991f589 | |
|
804c4f177c | |
|
426001a9a9 | |
|
fc1831d8b2 | |
|
4e431f6d14 | |
|
48b967a9e6 | |
|
97a75c0065 | |
|
7b8ea900e6 | |
|
e9c7e66748 | |
|
a5e439a0a8 | |
|
0cb5ca45fe | |
|
0634b0d528 | |
|
e4d2bd48c8 | |
|
60515bf580 | |
|
82fd15ccc4 | |
|
252c5f7338 | |
|
9a499d2a05 | |
|
3b7b426fe4 | |
|
9facc368ed | |
|
423c5f260b | |
|
015578526d | |
|
dce0ec5cf8 | |
|
f2b8966452 | |
|
f76af437ff | |
|
fc483f5b0c | |
|
bc8ccc91d8 | |
|
d1f04c2479 | |
|
c5c6c9a3f8 | |
|
f7ca9909df | |
|
eac6d3b1c9 | |
|
d9830a7ac2 | |
|
889671b7cf | |
|
b38786fe8c | |
|
bcac1bf101 | |
|
6be7404b6b | |
|
d57919d14e | |
|
5fc87fac85 | |
|
d33929e543 | |
|
539f57d75d | |
|
5c71459a61 | |
|
12c91544a6 | |
|
d2c6e20efb | |
|
f8b0cb75ca | |
|
82f567907e | |
|
4a87392734 | |
|
b91dd31139 | |
|
5761c277ee | |
|
b2a220b68b | |
|
a8ab3202b4 | |
|
ac7f9fb056 | |
|
00161f140d | |
|
76f42c19af | |
|
cf00170dd4 | |
|
023f83dd03 | |
|
a7cb7f736a | |
|
81e825dfea | |
|
39d76ab36b | |
|
a2cdfc048c | |
|
48038befa7 | |
|
550775b7be | |
|
435aa5a06e | |
|
08a183414b | |
|
84abaf7138 | |
|
25fb4fa076 | |
|
858a7f6035 | |
|
f3698288ff | |
|
dbd456831b | |
|
db81be0f03 | |
|
a379639a52 | |
|
5ce46d5f6c | |
|
e52fbce7d5 | |
|
7bf825d989 | |
|
dcb8cf5b12 | |
|
66a6caecc9 | |
|
6bf2df6ba9 | |
|
535085e412 | |
|
801f8bb31c | |
|
7324e7067c | |
|
634c04ef90 | |
|
6b1daa7191 | |
|
6071db7f49 | |
|
2181414c8d | |
|
1536c720f7 | |
|
e3dd5ff151 | |
|
6f7269858d | |
|
e8272ced47 | |
|
109413e35b | |
|
95f4ad2417 | |
|
3070acb507 | |
|
b1991d6d97 | |
|
60d4c4e082 | |
|
570970378e | |
|
44333795fe | |
|
7ab061282d | |
|
59860ab904 | |
|
e57a28af2f | |
|
c1d57de772 | |
|
aff4d97715 | |
|
6de105ebbe | |
|
3e4d91c4ba | |
|
0d45f1adf2 | |
|
a9bdda09b9 | |
|
d97275796b | |
|
6bc0cc33fc | |
|
73253a6f1c | |
|
c6f4a9014f | |
|
0974832307 | |
|
92858f325e | |
|
02417fbc99 | |
|
56a3a0a64e | |
|
7189f3938f | |
|
217acfcadc | |
|
61c9de04cd | |
|
71e099bfb7 | |
|
38c9ed6292 | |
|
89c1bc3be8 | |
|
dc679e1b3a | |
|
dc79b3e927 | |
|
3fb1e86c18 | |
|
a24fecc5cd | |
|
c3c552821a | |
|
b4535b3b23 | |
|
5f79e4fde0 | |
|
229befd41d | |
|
1cd78c708a | |
|
bb6e9f42f8 | |
|
b4b609481d | |
|
3a5c76d8b8 | |
|
1879a13b1b | |
|
c0eb61aeeb | |
|
2be0d9e34c | |
|
3d46fe0f72 | |
|
8a8b7b47fc | |
|
31d6e8fc26 | |
|
1e8b10d7bb | |
|
32cc599309 | |
|
17b3343d46 | |
|
122658ea5e | |
|
93fe0be5e6 | |
|
697abd36ed | |
|
fe5e38f0fe | |
|
4de59b3189 | |
|
95a5c8d06d | |
|
4a57755660 | |
|
ecf921cd4f | |
|
b0fe5f9a1d | |
|
42e7742cae | |
|
379d9a56a7 | |
|
5010c4a282 | |
|
25a1d8da05 | |
|
5e4cd5495c | |
|
258c62a87b | |
|
3b95dd1cf0 | |
|
5f31736e44 | |
|
723b0faefa | |
|
205e19eed4 | |
|
76efe2d354 | |
|
dae63b9b57 | |
|
eb45f33a1e | |
|
847d6c8d2c | |
|
7c7a9ceb52 | |
|
32f8c5e805 | |
|
b3157f78de | |
|
b382da615a | |
|
d16935b3df | |
|
168254d64c | |
|
d9572ac392 | |
|
2990fd50f2 | |
|
e3d99ba7cf | |
|
b23f04078c | |
|
4efc9d1f86 | |
|
e58139d646 | |
|
0d17918968 | |
|
fa940a8b7f | |
|
aebe4103f8 | |
|
6eadca823e | |
|
5fae5968ac | |
|
8fe5180dfc | |
|
1529d94ec8 | |
|
9254f7e0df | |
|
b76e410ec1 | |
|
cef8c1fa4c | |
|
6c80e5b227 | |
|
a96d0b59a3 | |
|
a577a59470 | |
|
b11ec2b306 | |
|
d46edde08b | |
|
999f97146e | |
|
12027146b9 | |
|
aa5860ef21 | |
|
56d6c68818 | |
|
39c66ee248 | |
|
686f858370 | |
|
a3bd5d52ff | |
|
a1a9eda1c8 | |
|
fecc78fb19 | |
|
acea5dfb6d | |
|
054f2a4e71 | |
|
d799f4038b | |
|
26950a49fc | |
|
417e9c9eac | |
|
3a7e617949 | |
|
da0bcebab9 | |
|
6c286e0f5f | |
|
3f0532bc50 | |
|
ca1da6b22e | |
|
91c09d0a96 | |
|
ebb47002a2 | |
|
eb6358ea82 | |
|
d498cab7c6 | |
|
b54e43d555 | |
|
8869f9a535 | |
|
c493044e4a | |
|
da10923ae1 | |
|
bcfef5a9ca | |
|
db94c08005 | |
|
f5f648ac24 | |
|
1acb4dfdac |
|
@ -18,10 +18,18 @@ If the matter is security related, please disclose it privately see https://gith
|
|||
|
||||
**How to reproduce it (as minimally and precisely as possible)**:
|
||||
|
||||
```bash
|
||||
# An example: https://github.com/kubernetes/kube-state-metrics/issues/2223#issuecomment-1792850276
|
||||
minikube start
|
||||
...
|
||||
go run main.go --custom-resource-state-only --custom-resource-state-config-file ksm-2223/custom-resource-config-file.yaml --kubeconfig ~/.kube/config
|
||||
```
|
||||
|
||||
**Anything else we need to know?**:
|
||||
|
||||
**Environment**:
|
||||
- kube-state-metrics version:
|
||||
- Kubernetes version (use `kubectl version`):
|
||||
- Cloud provider or hardware configuration:
|
||||
- Other info:
|
||||
|
||||
* kube-state-metrics version:
|
||||
* Kubernetes version (use `kubectl version`):
|
||||
* Cloud provider or hardware configuration:
|
||||
* Other info:
|
||||
|
|
|
@ -9,10 +9,10 @@ assignees: ''
|
|||
|
||||
<!-- Please only use this template for submitting feature requests -->
|
||||
|
||||
**What would you like to be added**:
|
||||
**What would you like to be added:**
|
||||
|
||||
**Why is this needed**:
|
||||
**Why is this needed:**
|
||||
|
||||
**Describe the solution you'd like**
|
||||
**Describe the solution you'd like:**
|
||||
|
||||
**Additional context**
|
||||
**Additional context:**
|
||||
|
|
|
@ -5,9 +5,10 @@
|
|||
4. If the PR is unfinished, see how to mark it: https://git.k8s.io/community/contributors/guide/pull-requests.md#marking-unfinished-pull-requests
|
||||
-->
|
||||
|
||||
**What this PR does / why we need it**:
|
||||
<!-- markdownlint-disable-next-line MD041 -->
|
||||
**What this PR does / why we need it:**
|
||||
|
||||
**How does this change affect the cardinality of KSM**: *(increases, decreases or does not change cardinality)*
|
||||
**How does this change affect the cardinality of KSM:** *(increases, decreases or does not change cardinality)*
|
||||
|
||||
**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
|
||||
**Which issue(s) this PR fixes:** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*
|
||||
Fixes #
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
version: 2
|
||||
updates:
|
||||
- package-ecosystem: "gomod"
|
||||
directory: "/"
|
||||
groups:
|
||||
k8s-dependencies:
|
||||
patterns:
|
||||
- "k8s.io*"
|
||||
schedule:
|
||||
interval: "weekly"
|
||||
- package-ecosystem: "github-actions"
|
||||
directory: "/"
|
||||
schedule:
|
||||
interval: "weekly"
|
|
@ -20,27 +20,23 @@ env:
|
|||
E2E_SETUP_KIND: yes
|
||||
E2E_SETUP_KUBECTL: yes
|
||||
SUDO: sudo
|
||||
GO_VERSION: "^1.19"
|
||||
GOLANGCI_LINT_VERSION: "v1.50.1"
|
||||
GO_VERSION: "^1.24"
|
||||
GOLANGCI_LINT_VERSION: "v2.0.2"
|
||||
|
||||
jobs:
|
||||
ci-go-lint:
|
||||
name: ci-go-lint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
make install-tools
|
||||
|
||||
- name: Lint
|
||||
run: |
|
||||
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin ${{ env.GOLANGCI_LINT_VERSION }}
|
||||
|
@ -50,19 +46,15 @@ jobs:
|
|||
name: ci-validate-manifests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
make install-tools
|
||||
|
||||
- name: Validate generated manifests
|
||||
run: |
|
||||
make validate-manifests
|
||||
|
@ -71,19 +63,15 @@ jobs:
|
|||
name: ci-validate-go-modules
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
make install-tools
|
||||
|
||||
- name: Validate go modules
|
||||
run: |
|
||||
make validate-modules
|
||||
|
@ -92,20 +80,16 @@ jobs:
|
|||
name: ci-validate-docs
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
make install-tools
|
||||
|
||||
- name: Check that all metrics are documented
|
||||
- name: Check that all metrics are documented and templates have no delta
|
||||
run: |
|
||||
make doccheck
|
||||
|
||||
|
@ -113,19 +97,15 @@ jobs:
|
|||
name: ci-unit-tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
make install-tools
|
||||
|
||||
- name: Unit tests
|
||||
run: |
|
||||
make test-unit
|
||||
|
@ -135,7 +115,7 @@ jobs:
|
|||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Setup promtool
|
||||
run: |
|
||||
|
@ -149,40 +129,42 @@ jobs:
|
|||
name: ci-benchmark-tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
make install-tools
|
||||
|
||||
- name: Benchmark tests
|
||||
run: |
|
||||
make test-benchmark-compare
|
||||
BENCHSTAT_OUTPUT_FILE=result.txt make test-benchmark-compare
|
||||
- run: |
|
||||
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
|
||||
cat result.txt >> "$GITHUB_STEP_SUMMARY"
|
||||
echo "\`\`\`" >> "$GITHUB_STEP_SUMMARY"
|
||||
cat <<EOL >> "$GITHUB_STEP_SUMMARY"
|
||||
<hr />
|
||||
The table shows the median and 95% confidence interval (CI) summaries for each benchmark comparing the HEAD and the BASE, and an A/B comparison under "vs base". The last column shows the statistical p-value with ten runs (n=10).
|
||||
The last row has the Geometric Mean (geomean) for the given rows in the table.
|
||||
Refer to <a href="https://pkg.go.dev/golang.org/x/perf/cmd/benchstat">benchstat's documentation</a> for more help.
|
||||
EOL
|
||||
|
||||
ci-build-kube-state-metrics:
|
||||
name: ci-build-kube-state-metrics
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
make install-tools
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
make build
|
||||
|
@ -191,19 +173,15 @@ jobs:
|
|||
name: ci-e2e-tests
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
id: go
|
||||
|
||||
- name: Check out code into the Go module directory
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Setup environment
|
||||
run: |
|
||||
make install-tools
|
||||
|
||||
- name: End-to-end tests
|
||||
run: |
|
||||
make e2e
|
||||
|
|
|
@ -6,16 +6,19 @@ on:
|
|||
- cron: '0 0 * * 1'
|
||||
|
||||
env:
|
||||
GO_VERSION: "^1.19"
|
||||
GO_VERSION: "^1.24"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
ci-security-checks:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
name: Checkout code
|
||||
- name: Set up Go 1.x
|
||||
uses: actions/setup-go@v3
|
||||
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v5.5.0
|
||||
with:
|
||||
go-version: ${{ env.GO_VERSION }}
|
||||
- name: Install govulncheck binary
|
||||
|
@ -23,4 +26,4 @@ jobs:
|
|||
go install golang.org/x/vuln/cmd/govulncheck@latest
|
||||
- name: Run security checks
|
||||
run: |
|
||||
govulncheck -v ./...
|
||||
govulncheck ./...
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
name: openvex
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
vexctl:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Set environment variables
|
||||
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
|
||||
|
||||
- uses: openvex/generate-vex@c59881b41451d7ccba5c3b74cd195382b8971fcd
|
||||
# Refer: https://github.com/openvex/vexctl#operational-model
|
||||
name: Run vexctl
|
||||
with:
|
||||
product: pkg:golang/k8s.io/kube-state-metrics/v2@${{ env.RELEASE_VERSION }}
|
||||
file: kube-state-metrics.openvex.json
|
||||
|
||||
- name: Upload OpenVEX document to GitHub Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release upload ${{ env.RELEASE_VERSION }} kube-state-metrics.openvex.json
|
|
@ -0,0 +1,41 @@
|
|||
name: Generate SBOM with Kubernetes BOM
|
||||
|
||||
on:
|
||||
release:
|
||||
types:
|
||||
- released
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
sbom:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
env:
|
||||
OUTPUT: sbom.spdx
|
||||
TAG: ${{ github.event.release.tag_name }}
|
||||
|
||||
steps:
|
||||
- name: Fetch source code into GITHUB_WORKSPACE
|
||||
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
||||
|
||||
- name: Install Kubernetes BOM
|
||||
uses: kubernetes-sigs/release-actions/setup-bom@a30d93cf2aa029e1e4c8a6c79f766aebf429fddb # v0.3.1
|
||||
|
||||
- name: Generate SBOM
|
||||
run: |
|
||||
bom generate \
|
||||
--dirs=. \
|
||||
--image=registry.k8s.io/kube-state-metrics/kube-state-metrics:$TAG \
|
||||
--namespace=https://github.com/kubernetes/kube-state-metrics/releases/download/$TAG/$OUTPUT \
|
||||
--output=$OUTPUT
|
||||
|
||||
- name: Upload SBOM to GitHub Release
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
gh release upload $TAG $OUTPUT
|
|
@ -0,0 +1,23 @@
|
|||
name: "Lint pull request title"
|
||||
|
||||
on:
|
||||
pull_request_target:
|
||||
types:
|
||||
- opened
|
||||
- edited
|
||||
- synchronize
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
main:
|
||||
permissions:
|
||||
pull-requests: read # for amannn/action-semantic-pull-request to analyze PRs
|
||||
statuses: write # for amannn/action-semantic-pull-request to mark status of analyzed PR
|
||||
name: Validate PR title for semantic commit message
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: amannn/action-semantic-pull-request@0723387faaf9b38adef4775cd42cfd5155ed6017 # v5.5.3
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
@ -1,15 +1,10 @@
|
|||
run:
|
||||
deadline: 5m
|
||||
|
||||
version: "2"
|
||||
linters:
|
||||
disable-all: true
|
||||
default: none
|
||||
enable:
|
||||
- gocritic
|
||||
- gocyclo
|
||||
- gofmt
|
||||
- goimports
|
||||
- gosec
|
||||
- gosimple
|
||||
- govet
|
||||
- ineffassign
|
||||
- misspell
|
||||
|
@ -17,22 +12,49 @@ linters:
|
|||
- revive
|
||||
- staticcheck
|
||||
- unconvert
|
||||
- unused
|
||||
exclusions:
|
||||
generated: lax
|
||||
rules:
|
||||
- linters:
|
||||
- promlinter
|
||||
path: _test\.go
|
||||
- linters:
|
||||
- gosec
|
||||
text: 'G104:'
|
||||
- linters:
|
||||
- revive
|
||||
text: 'package-comments:|var-naming:'
|
||||
# This needs to stay as long as we support exposing v1.endpoints metrics
|
||||
- linters:
|
||||
- staticcheck
|
||||
text: 'SA1019: v1.Endpoint'
|
||||
path: 'internal/store/endpoint.*.go|internal/store/builder.go'
|
||||
# TODO: Use functions with context https://github.com/kubernetes/kube-state-metrics/issues/2721
|
||||
- linters:
|
||||
- staticcheck
|
||||
text: 'SA1019: .*List|Watch'
|
||||
path: 'pkg/sharding/listwatch.go|pkg/watch/watch.go'
|
||||
|
||||
linters-settings:
|
||||
goimports:
|
||||
local-prefixes: k8s.io/kube-state-metrics,k8s.io/kube-state-metrics/v2
|
||||
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
issues:
|
||||
exclude-use-default: false
|
||||
exclude-rules:
|
||||
# We don't check metrics naming in the tests.
|
||||
- path: _test\.go
|
||||
linters:
|
||||
- promlinter
|
||||
# TODO(mrueg) Improve error handling
|
||||
- text: "G104:"
|
||||
linters:
|
||||
- gosec
|
||||
- text: "package-comments:"
|
||||
linters:
|
||||
- revive
|
||||
max-issues-per-linter: 0
|
||||
max-same-issues: 0
|
||||
formatters:
|
||||
enable:
|
||||
- gofmt
|
||||
- goimports
|
||||
settings:
|
||||
goimports:
|
||||
local-prefixes:
|
||||
- k8s.io/kube-state-metrics
|
||||
- k8s.io/kube-state-metrics/v2
|
||||
exclusions:
|
||||
generated: lax
|
||||
paths:
|
||||
- third_party$
|
||||
- builtin$
|
||||
- examples$
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"globs": [
|
||||
"**/*.md"
|
||||
],
|
||||
// ToDo: Following rules can't be fixed automatically. They should be enabled when fixed.
|
||||
"config": {
|
||||
"MD004": {
|
||||
"style": "asterisk"
|
||||
},
|
||||
"MD013": false, // https://github.com/markdownlint/markdownlint/blob/main/docs/RULES.md#md013---line-length
|
||||
"MD033": {
|
||||
"allowed_elements": [
|
||||
"details",
|
||||
"summary",
|
||||
"br"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,28 @@
|
|||
# OpenVEX Templates Directory
|
||||
|
||||
This directory contains the OpenVEX data for this repository.
|
||||
The files stored in this directory are used as templates by
|
||||
`vexctl generate` when generating VEX data for a release or
|
||||
a specific artifact.
|
||||
|
||||
To add new statements to publish data about a vulnerability,
|
||||
download [vexctl](https://github.com/openvex/vexctl)
|
||||
and append new statements using `vexctl add`. For example:
|
||||
|
||||
```bash
|
||||
vexctl add --in-place main.openvex.json pkg:oci/test CVE-2014-1234567 fixed
|
||||
```
|
||||
|
||||
That will add a new VEX statement expressing that the impact of
|
||||
CVE-2014-1234567 is under investigation in the test image. When
|
||||
cutting a new release, for `pkg:oci/test` the new file will be
|
||||
incorporated to the relase's VEX data.
|
||||
|
||||
## Read more about OpenVEX
|
||||
|
||||
To know more about generating, publishing and using VEX data
|
||||
in your project, please check out the [vexctl repository and
|
||||
documentation](https://github.com/openvex/vexctl).
|
||||
|
||||
OpenVEX also has an [examples repository](https://github.com/openvex/examples)
|
||||
with samples and docs.
|
|
@ -0,0 +1,8 @@
|
|||
{
|
||||
"@context": "https://openvex.dev/ns/v0.2.0",
|
||||
"@id": "https://openvex.dev/docs/public/vex-2912204db7d51d98234a931d600f7cc2dd0bf24a5b5b326de138d64b30c22911",
|
||||
"author": "vexctl (automated template)",
|
||||
"timestamp": "2023-12-15T22:55:18.754525+05:30",
|
||||
"version": 1,
|
||||
"statements": []
|
||||
}
|
245
CHANGELOG.md
245
CHANGELOG.md
|
@ -1,3 +1,170 @@
|
|||
# Changelog
|
||||
|
||||
## v2.16.0 / 2025-06-23
|
||||
|
||||
**Note:**
|
||||
|
||||
* This release builds with Golang `v1.24.4`
|
||||
* This release builds with `k8s.io/client-go`: `v0.32.6`
|
||||
|
||||
* [FEATURE] Add a `reclaim_policy` label to the `kube_persistentvolume_info` metric by @SuperQ in <https://github.com/kubernetes/kube-state-metrics/pull/2615>
|
||||
* [FEATURE] Use dlclark/regexp2 over standard library's package to support lookarounds by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2616>
|
||||
* [BUGFIX] Report correct values in `kube_pod_status_reason` metric by @carlosmorenokm1 in <https://github.com/kubernetes/kube-state-metrics/pull/2644>
|
||||
* [FEATURE] Add add `pathType` to `kube_ingress_path` by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2670>
|
||||
* [FEATURE] Introduce object limits by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2626>
|
||||
* [BUGFIX] Close reflectors once their corresponding CRDs are dropped by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2672>
|
||||
* [FEATURE] Incorporate `WithAuthenticationAndAuthorization` to support endpoint authn/z by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2686>
|
||||
|
||||
## v2.15.0 / 2025-02-03
|
||||
|
||||
**Note:**
|
||||
|
||||
* This release builds with Golang `v1.23.5`
|
||||
* This release builds with `k8s.io/client-go`: `v0.32.1`
|
||||
|
||||
* [BUGFIX] Fix CR cache for GVK all specified case by @chelseychen in <https://github.com/kubernetes/kube-state-metrics/pull/2567>
|
||||
* [BUGFIX] Deduplicate tolerations before creating metric by @RiRa12621 in <https://github.com/kubernetes/kube-state-metrics/pull/2559>
|
||||
* [BUGFIX] Make `$VERSION` 3rd-party independant by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2572>
|
||||
* [BUGFIX] Fix NoNodePod naming in jsonnet by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2598>
|
||||
* [BUGFIX] Panic in `util.GVRFromType` for structured types by @L3n41c in <https://github.com/kubernetes/kube-state-metrics/pull/2553>
|
||||
* [FEATURE] Add external traffic policy to kube_service_info by @jahantech in <https://github.com/kubernetes/kube-state-metrics/pull/2584>
|
||||
* [FEATURE] Promote kube_statefulset_ordinals_start from ALPHA -> STABLE by @pwschuurman in <https://github.com/kubernetes/kube-state-metrics/pull/2415>
|
||||
* [FEATURE] Add timezone to kube_cronjob_info / Make kube_cronjob_next_schedule_time timezone-aware by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2376>
|
||||
|
||||
## v2.14.0 / 2024-11-08
|
||||
|
||||
**Note:**
|
||||
|
||||
* This release builds with Golang `v1.23.3`
|
||||
* This release builds with `k8s.io/client-go`: `v0.31.2`
|
||||
* This release removes `kube_endpoint_address_not_ready` and `kube_endpoint_address_available` which have been deprecated in 2022. Please use `kube_endpoint_address`as a replacement.
|
||||
|
||||
* [BUGFIX] Use --track-unscheduled-pods to select unscheduled pods in Daemonset sharding by @CatherineF-dev in <https://github.com/kubernetes/kube-state-metrics/pull/2388>
|
||||
* [BUGFIX] Install tools so VERSION gets set by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2456>
|
||||
* [BUGFIX] Syntax errors in kube-state-metrics.libsonnet by @jeffmccune in <https://github.com/kubernetes/kube-state-metrics/pull/2454>
|
||||
* [BUGFIX] Set kube_job_status_failed metric even when there are no job.Status.Conditions present by @richabanker in <https://github.com/kubernetes/kube-state-metrics/pull/2485>
|
||||
* [BUGFIX] de-duplication of custom resource metrics by @bartlettc22 in <https://github.com/kubernetes/kube-state-metrics/pull/2502>
|
||||
* [BUGFIX] Configure sharding every time MetricsHandler.Run runs by @wallee94 in <https://github.com/kubernetes/kube-state-metrics/pull/2478>
|
||||
* [BUGFIX] Panic in `util.GVRFromType` for core objects by @L3n41c in <https://github.com/kubernetes/kube-state-metrics/pull/2535>
|
||||
* [BUGFIX] Big memory value overflow by @leiwingqueen in <https://github.com/kubernetes/kube-state-metrics/pull/2540>
|
||||
* [BUGFIX] Expose empty labels by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2539>
|
||||
* [BUGFIX] CustomResourceMetrics: Convert status condition Unknown to a valid value by @Haleygo in <https://github.com/kubernetes/kube-state-metrics/pull/2536>
|
||||
* [CHANGE] Remove deprecated endpoint address metric by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2527>
|
||||
* [FEATURE] Add new metric kube_job_status_suspended by @Indresh2410 in <https://github.com/kubernetes/kube-state-metrics/pull/2542>
|
||||
* [FEATURE] Move endpoint ports into address metric by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2503>
|
||||
* [ENHANCEMENT] Use concurrent map when storing metrics by @rarruda in <https://github.com/kubernetes/kube-state-metrics/pull/2510>
|
||||
|
||||
## v2.13.0 / 2024-07-18
|
||||
|
||||
**Note:**
|
||||
|
||||
* This release builds with Golang `v1.22.5`.
|
||||
* This release builds with `k8s.io/client-go`: `v0.30.3`.
|
||||
* This release adds read and write timeouts for requests. The defaults might have an impact on scrapes that take a long time.
|
||||
|
||||
* [BUGFIX] Pod autosharding: transition from labelselector to fieldselector by @pkoutsovasilis in <https://github.com/kubernetes/kube-state-metrics/pull/2347>
|
||||
* [ENHANCEMENT] Add automatic detection of memory limits by @SuperQ in <https://github.com/kubernetes/kube-state-metrics/pull/2447>
|
||||
* [FEATURE] Add `readyz` endpoint by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2442>
|
||||
* [FEATURE] Add `livez` endpoint by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2418>
|
||||
* [FEATURE] Add kube_persistentvolume_volume_mode metric by @ricardoapl in <https://github.com/kubernetes/kube-state-metrics/pull/2370>
|
||||
* [FEATURE] Add read and write timeouts by @Pokom in <https://github.com/kubernetes/kube-state-metrics/pull/2412>
|
||||
|
||||
## v2.12.0 / 2024-04-02
|
||||
|
||||
**Note:**
|
||||
|
||||
* This release addresses a critical issue where scraping the exposition data for certain types caused metrics-backends to crash: <https://github.com/kubernetes/kube-state-metrics/issues/2248>.
|
||||
* This release builds with `k8s.io/client-go`: `v0.29.3`.
|
||||
|
||||
* [BUGFIX] Fallback to `gauge` for `protobuf`-based negotiations by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2270>
|
||||
* [ENHANCEMENT] Add `kube_pod_container_status_last_terminated_timestamp`by @tetianakravchenko in <https://github.com/kubernetes/kube-state-metrics/pull/2291>
|
||||
* [FEATURE] Allow prefixing expandable paths by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2052>
|
||||
|
||||
## v2.11.0 / 2024-03-04
|
||||
|
||||
**Note:**
|
||||
|
||||
This release builds with Golang `v1.21.8`.
|
||||
|
||||
* [ENHANCEMENT] Add OpenSSF Scorecard to README by @dalehenries in <https://github.com/kubernetes/kube-state-metrics/pull/2277>
|
||||
* [ENHANCEMENT] Generate OpenVX data for every release by @shafeeqes in <https://github.com/kubernetes/kube-state-metrics/pull/2276>
|
||||
* [ENHANCEMENT] Add restartPolicy to `kube_pod_init_container_info` metric by @changhyuni in <https://github.com/kubernetes/kube-state-metrics/pull/2240>
|
||||
* [FEATURE] Add `kube_node_status_addresses` metric by @stonith in <https://github.com/kubernetes/kube-state-metrics/pull/2252>
|
||||
* [FEATURE] Add namespace label to `endpointslice` metrics by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2266>
|
||||
* [FEATURE] Add opt-in `kube_persistentvolume_csi_attributes` metric by @machadovilaca in <https://github.com/kubernetes/kube-state-metrics/pull/2133>
|
||||
* [FEATURE] Add new metric `kube_pod_scheduler` metric by @adinhodovic in <https://github.com/kubernetes/kube-state-metrics/pull/2222>
|
||||
* [FEATURE] Support filtering annotations allow-list by `*` by @xonvanetta in <https://github.com/kubernetes/kube-state-metrics/pull/2234>
|
||||
* [ENHANCEMENT] Support scraping pod metrics that are still in scheduling status and have no assigned nodes by @mickeyzzc in <https://github.com/kubernetes/kube-state-metrics/pull/2217>
|
||||
* [FEATURE] Add backend resource info for `kube_ingress_path` by @rohitphatak in <https://github.com/kubernetes/kube-state-metrics/pull/2109>
|
||||
|
||||
## v2.10.1 / 2023-10-09
|
||||
|
||||
**Note:**
|
||||
|
||||
* This release addresses a regression introduced in [#2105](https://github.com/kubernetes/kube-state-metrics/pull/2105).
|
||||
|
||||
* [BUGFIX] Remove FieldSelector from non-namespaced resources by @mrueg and @dgrisonnet in [#2190](https://github.com/kubernetes/kube-state-metrics/pull/2190)
|
||||
* [ENHANCEMENT] Bump Go to v1.20.8
|
||||
|
||||
## v2.10.0 / 2023-08-31
|
||||
|
||||
**Note:**
|
||||
|
||||
* Label and annotation metrics aren't exposed by default anymore to reduce the memory usage of the default configuration of kube-state-metrics. Before this change, they used to only include the name and namespace of the objects which is not relevant to users not opting in these metrics.
|
||||
|
||||
* [BUGFIX] Log no _info suffix in name only once per reading the configuration for custommetrics by @chrischdi in <https://github.com/kubernetes/kube-state-metrics/pull/2157>
|
||||
* [BUGFIX] Don't crash on non-existent valueFrom path values by @chihshenghuang in <https://github.com/kubernetes/kube-state-metrics/pull/2140>
|
||||
* [BUGFIX] Index out of range in metrics_store.SanitizeHeaders by @mrueg in <https://github.com/kubernetes/kube-state-metrics/pull/2166>
|
||||
* [BUGFIX] Always extract the headers but only write it when we have custommetrics by @chrischdi in <https://github.com/kubernetes/kube-state-metrics/pull/2154>
|
||||
* [BUGFIX] Add filtering for Lease metrics by @ntoofu in <https://github.com/kubernetes/kube-state-metrics/pull/2122>
|
||||
* [FEATURE] Implement kube_pod_status_initialized_time by @opeco17 in <https://github.com/kubernetes/kube-state-metrics/pull/2148>
|
||||
* [FEATURE] Disable labels and annotations metrics when metric-annotations-… by @opeco17 in <https://github.com/kubernetes/kube-state-metrics/pull/2145>
|
||||
* [FEATURE] Add webhooks client config service metrics by @dgrisonnet in <https://github.com/kubernetes/kube-state-metrics/pull/2114>
|
||||
* [FEATURE] Support kube_persistentvolumeclaim_deletion_timestamp by @maxime1907 in <https://github.com/kubernetes/kube-state-metrics/pull/2074>
|
||||
* [FEATURE] Support kube_persistentvolume_deletion_timestamp by @maxime1907 in <https://github.com/kubernetes/kube-state-metrics/pull/2075>
|
||||
* [FEATURE] Adds new metric `kube_pod_service_account` by @swarup-stripe in <https://github.com/kubernetes/kube-state-metrics/pull/2096>
|
||||
* [FEATURE] Add volumemode to PVC info metric by @machadovilaca in <https://github.com/kubernetes/kube-state-metrics/pull/2134>
|
||||
* [FEATURE] Enable metric-annotations-allowlist and metric-labels-allowlist for ResourceQuota by @opeco17 in <https://github.com/kubernetes/kube-state-metrics/pull/2175>
|
||||
* [FEATURE] Allow field KV general matching by @rexagod in <https://github.com/kubernetes/kube-state-metrics/pull/2067>
|
||||
* [FEATURE] Support hot reload for kubeconfig by @opeco17 in <https://github.com/kubernetes/kube-state-metrics/pull/2144>
|
||||
* [FEATURE] Add support for endpoint topology routing hints by @MarkSRobinson in <https://github.com/kubernetes/kube-state-metrics/pull/2090>
|
||||
|
||||
## v2.9.2 / 2023-05-30
|
||||
|
||||
This release does not incorporate any user-facing changes. Re-running release procedures as the process for the previous release failed. Changes are listed in v2.9.0.
|
||||
|
||||
## v2.9.1 / 2023-05-29
|
||||
|
||||
This release does not incorporate any user-facing changes. Re-running release procedures as the process for the previous release failed. Changes are listed in v2.9.0.
|
||||
|
||||
## v2.9.0 / 2023-05-23
|
||||
|
||||
The changes mentioned below are only the user-facing ones. For a list of the complete set of changes, refer the changelog associated with the release tag.
|
||||
|
||||
**Note:**
|
||||
|
||||
* The deprecated experimental VerticalPodAutoscaler metrics are no longer supported, and have been removed. We recommend to use CustomResourceState metrics to gather metrics from custom resources like the Vertical Pod Autoscaler.
|
||||
* #2004 regulated label names to adhere with [OTel-Prometheus standards](https://github.com/open-telemetry/opentelemetry-specification/blob/8946dfc6a2302f78b0224fcc3f4dfb816a7bb1f4/specification/compatibility/prometheus_and_openmetrics.md?plain=1#L224-L229), so existing label names that do not follow the same may be replaced by the ones that do. Please refer to the PR for more details.
|
||||
|
||||
* [BUGFIX] Adhere to OTel-Prometheus standard for labels #2004 @rexagod
|
||||
* [BUGFIX] Respect relative paths for label resolutions #2007 @rexagod
|
||||
* [BUGFIX] Support LabelsFromPath functionality for Info-typed metrics #2048 @murphd40
|
||||
* [CHANGE] Remove VerticalPodAutoscaler #2017 @mrueg
|
||||
* [ENHANCEMENT] Add StatefulSet Start Ordinal metrics for KEP-3335 #1959 @pwschuurman
|
||||
* [ENHANCEMENT] Add namespace label to `kube_lease_renew_time` #2073 @A-Hilaly
|
||||
* [ENHANCEMENT] Add parameters for PodSecurity #2042 @jcpunk
|
||||
* [ENHANCEMENT] Add support for multi cluster prometheus alerts #2058 @jkroepke
|
||||
* [ENHANCEMENT] Don't crash on non-existent path values #1998 @rexagod
|
||||
* [ENHANCEMENT] Only use OpenMetrics and Text in contentType #2024 @CatherineF-dev
|
||||
* [ENHANCEMENT] Update go version to 1.20.4 #2056 @RamakrishnanArun
|
||||
* [FEATURE] Add support for variable VKs in CRS config #1851 @rexagod
|
||||
* [FEATURE] Support quantities and percentages #1989 @mrueg
|
||||
* [FEATURE] Use prometheus/exporter-toolkit landing page #2034 @mrueg
|
||||
|
||||
## v2.8.2 / 2023-03-17
|
||||
|
||||
* [BUGFIX] Only use OpenMetrics and Text in contentType #2024 @CatherineF-dev
|
||||
|
||||
## v2.8.1 / 2023-02-22
|
||||
|
||||
* [BUGFIX] Don't crash on non-existent paths @rexagod #1998
|
||||
|
@ -60,6 +227,7 @@ See: #1847
|
|||
* [BUGFIX] Allow lease metrics to be exported across all namespaces #1845 @lantingchiang
|
||||
|
||||
## v2.6.0 / 2022-08-26
|
||||
|
||||
* [FEATURE] Add local storage labels to kube_persistentvolume_info #1814 @nabokihms
|
||||
* [FEATURE] Add support for StateSet and Info metrics for Custom-Resource State #1777 @chrischdi
|
||||
* [FEATURE] Add support for Rolebinding resource metrics #1799 @kaitoii11
|
||||
|
@ -93,9 +261,11 @@ See: #1847
|
|||
* [BUGFIX] Properly initialize KSM Server test #1699 @fpetkovski
|
||||
|
||||
## v2.4.2 / 2022-02-10
|
||||
* [BUGFIX] Publish images with with the correct tag
|
||||
|
||||
* [BUGFIX] Publish images with with the correct tag
|
||||
|
||||
## v2.4.1 / 2022-02-10
|
||||
|
||||
* [FEATURE] Add `ingressclass` label to `kube_ingress_info` metric #1652 @adammw
|
||||
* [FEATURE] Extend KSM library to support custom resource metrics #1644 @Garrybest
|
||||
* [ENHANCEMENT] Use apiVersion `v1` for `PodDisruptionBudget` and `CronJob` resources #1491 @bison
|
||||
|
@ -120,9 +290,10 @@ See: #1847
|
|||
|
||||
## v2.2.3 / 2021-10-13
|
||||
|
||||
* [BUGFIX] Fix the image build job. Reverts #1602
|
||||
* [BUGFIX] Fix the image build job. Reverts #1602
|
||||
|
||||
## v2.2.2 / 2021-10-13
|
||||
|
||||
* [BUGFIX] Downgrade latest allowed go version to 1.16.9 #1601 @mrueg
|
||||
* [BUGFIX] Fix CI variable names used for building KSM images @mrueg
|
||||
|
||||
|
@ -196,6 +367,7 @@ Location on quay.io will not be updated anymore. Previously pushed images will b
|
|||
* [BUGFIX] Propagate resource version when sharded #1402
|
||||
|
||||
## v2.0.0-beta / 2020-12-04
|
||||
|
||||
Promotion to beta release after a period of no bugs.
|
||||
|
||||
## v2.0.0-alpha.3 / 2020-11-19
|
||||
|
@ -218,69 +390,68 @@ kube_pod_container_resource_requests and kube_pod_container_resource_limits
|
|||
|
||||
* [CHANGE] Update go module path to k8s.io/kube-state-metrics/v2 #1238
|
||||
* [CHANGE] Bump klog to v2 and client-go to 1.19 #1250
|
||||
* [FEATURE] Add iscsi initiator name to persistentvolume_info #1235
|
||||
* [BUGFIX] Added Namespace to Rolebinding Jsonnet #1233
|
||||
* [BUGFIX] Reference closure scoped family generator #1240
|
||||
* [FEATURE] Add iscsi initiator name to persistentvolume_info #1235
|
||||
* [BUGFIX] Added Namespace to Rolebinding Jsonnet #1233
|
||||
* [BUGFIX] Reference closure scoped family generator #1240
|
||||
|
||||
## v2.0.0-alpha / 2020-09-16
|
||||
|
||||
NOTE: This is a major new alpha 2.0 release with breaking changes and removed metrics. See details below!
|
||||
|
||||
* [CHANGE] Apply boundaries to metrics and allow via flag (--labels-allow-list) what labels to include #1125
|
||||
* [CHANGE] Apply boundaries to metrics and allow via flag (--labels-allow-list) what labels to include #1125
|
||||
* [CHANGE] Update DaemonSet updated_number_scheduled metric name to be consistent #1181
|
||||
Metric was changed from kube_daemonset_updated_number_scheduled to kube_daemonset_status_updated_number_scheduled
|
||||
Metric was changed from kube_daemonset_updated_number_scheduled to kube_daemonset_status_updated_number_scheduled
|
||||
* [CHANGE] Rework resource metrics #1168
|
||||
Metrics kube_pod_container_resource_requests, kube_pod_container_resource_limits, kube_pod_overhead, kube_pod_init_container_resource_limits, kube_pod_init_container_resource_requests changed
|
||||
* [CHANGE] Convert k8s labels to snake case #1165
|
||||
* [CHANGE] Mutatingwebhookconfiguration.go: Switch to v1 #1144
|
||||
* [CHANGE] Convert k8s labels to snake case #1165
|
||||
* [CHANGE] Mutatingwebhookconfiguration.go: Switch to v1 #1144
|
||||
* [CHANGE] v2: Rename storage class labels reclaimPolicy to reclaim_policy and volumeBindingMode to volume_binding_mode #1107
|
||||
* [CHANGE] v2: Renamed --namespace flag to --namespaces #1098
|
||||
* [CHANGE] Rename kube_pod_deleted to kube_pod_deletion_timestamp #1079
|
||||
* [CHANGE] v2: Rename collector flag to resource flag #1006
|
||||
--resources is the new flag
|
||||
* [CHANGE] Remove non-identifying labels from pod metrics #1009
|
||||
* [CHANGE] Remove non-identifying labels from pod metrics #1009
|
||||
* [CHANGE] v2: Remove deprecated stable metrics #1004
|
||||
Note that some of these were replaced with EXPERIMENTAL resource metrics. See #1168 for more details.
|
||||
`kube_pod_container_resource_requests` and `kube_pod_container_resource_limits` are the replacements with `resource` labels
|
||||
representing the resource name and `unit` labels representing the resource unit.
|
||||
- kube_pod_container_resource_requests_cpu_cores
|
||||
- kube_pod_container_resource_limits_cpu_cores
|
||||
- kube_pod_container_resource_requests_memory_bytes
|
||||
- kube_pod_container_resource_limits_memory_bytes
|
||||
- `kube_node_status_capacity` and `kube_node_status_allocatable` are the replacements with `resource` labels
|
||||
* kube_pod_container_resource_requests_cpu_cores
|
||||
* kube_pod_container_resource_limits_cpu_cores
|
||||
* kube_pod_container_resource_requests_memory_bytes
|
||||
* kube_pod_container_resource_limits_memory_bytes
|
||||
* `kube_node_status_capacity` and `kube_node_status_allocatable` are the replacements with `resource` labels
|
||||
representing the resource name and `unit` labels representing the resource unit.
|
||||
- kube_node_status_capacity_pods
|
||||
- kube_node_status_capacity_cpu_cores
|
||||
- kube_node_status_capacity_memory_bytes
|
||||
- kube_node_status_allocatable_pods
|
||||
- kube_node_status_allocatable_cpu_cores
|
||||
- kube_node_status_allocatable_memory_bytes
|
||||
* kube_node_status_capacity_pods
|
||||
* kube_node_status_capacity_cpu_cores
|
||||
* kube_node_status_capacity_memory_bytes
|
||||
* kube_node_status_allocatable_pods
|
||||
* kube_node_status_allocatable_cpu_cores
|
||||
* kube_node_status_allocatable_memory_bytes
|
||||
* [CHANGE] Rename black-/whitelist to allow/deny-list #1045
|
||||
New flags are --metric-allowlist and --metric-denylist
|
||||
* [CHANGE] Update telemetry port to 8081 #1049
|
||||
* [CHANGE] v2: Rename hpa metrics to use full horizontalpodautoscaler #1003
|
||||
* [CHANGE] Update telemetry port to 8081 #1049
|
||||
* [CHANGE] v2: Rename hpa metrics to use full horizontalpodautoscaler #1003
|
||||
All metrics with prefix of kube_hpa_ were renamed to kube_horizontalpodautoscaler_
|
||||
* [CHANGE] v2: change metrics port to 8080, telemetry port to 8081 #1005
|
||||
* [CHANGE] v2: change metrics port to 8080, telemetry port to 8081 #1005
|
||||
* [FEATURE] Add http request metric for kube-state-metrics main /metrics #1218
|
||||
* [FEATURE] Add fc/iscsi/nfs identifier tags to persistentvolume_info metric #1208
|
||||
* [FEATURE] Adds new pod metric kube_pod_container_state_started #1183
|
||||
* [FEATURE] Add fc/iscsi/nfs identifier tags to persistentvolume_info metric #1208
|
||||
* [FEATURE] Adds new pod metric kube_pod_container_state_started #1183
|
||||
* [FEATURE] Add observedGeneration metric (kube_daemonset_status_observed_generation) for DaemonSets #1178
|
||||
* [FEATURE] Add internal_ip to node_info #1172
|
||||
* [FEATURE] Avoid conflicts when mapping Kubernetes labels to Prometheus labels #1156
|
||||
* [FEATURE] Add internal_ip to node_info #1172
|
||||
* [FEATURE] Avoid conflicts when mapping Kubernetes labels to Prometheus labels #1156
|
||||
* [FEATURE] Add aws/gce volume id to kube_persistentvolume_info #1146
|
||||
* [FEATURE] Add UnexpectedAdmissionError to kube_pod_status_reason metric #1145
|
||||
* [FEATURE] Add init container requests (kube_pod_init_container_resource_requests) #1123
|
||||
* [FEATURE] Add host_network to kube_pod_info #1100
|
||||
* [FEATURE] Add kube_replicationcontroller_owner #1058
|
||||
* [FEATURE] Pod: add gauges for pod overhead (kube_pod_overhead) #1053
|
||||
* [FEATURE] Add "Terminating" status in kube_pod_status_phase metrics #1013
|
||||
* [FEATURE] Add lease collector metrics #1038
|
||||
* [FEATURE] Add host_network to kube_pod_info #1100
|
||||
* [FEATURE] Add kube_replicationcontroller_owner #1058
|
||||
* [FEATURE] Pod: add gauges for pod overhead (kube_pod_overhead) #1053
|
||||
* [FEATURE] Add "Terminating" status in kube_pod_status_phase metrics #1013
|
||||
* [FEATURE] Add lease collector metrics #1038
|
||||
* [ENHANCEMENT] Add DeprecatedVersion to struct FamilyGenerator and func NewFamilyGenerator #1160
|
||||
* [ENHANCEMENT] Add security context to deployment and statefulset #1034
|
||||
* [ENHANCEMENT] Add security context to deployment and statefulset #1034
|
||||
* [BUGFIX] Fix VolumeAttachment API version mismatch: expected v1 but watching v1beta1 #1136
|
||||
* [BUGFIX] Fix various CI issues (kube_volumeattachment_info nodeName -> node label rename) #1117
|
||||
* [BUGFIX] Fix maxUnavailable to round down instead up #1076
|
||||
|
||||
* [BUGFIX] Fix various CI issues (kube_volumeattachment_info nodeName -> node label rename) #1117
|
||||
* [BUGFIX] Fix maxUnavailable to round down instead up #1076
|
||||
|
||||
## v1.9.7 / 2020-05-24
|
||||
|
||||
|
|
|
@ -6,21 +6,49 @@ _As contributors and maintainers of this project, and in the interest of fosteri
|
|||
|
||||
## Getting Started
|
||||
|
||||
We have full documentation on how to get started contributing here:
|
||||
We have full documentation on how to get started contributing here:
|
||||
|
||||
<!---
|
||||
If your repo has certain guidelines for contribution, put them here ahead of the general k8s resources
|
||||
-->
|
||||
### Semantic Commit Messages
|
||||
|
||||
- [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests
|
||||
- [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing)
|
||||
- [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet/README.md) - Common resources for existing developers
|
||||
We use [semantic commit messages](https://www.conventionalcommits.org/en/v1.0.0/) in this repository.
|
||||
|
||||
They follow this format: `<type>[optional scope]: <description>`
|
||||
|
||||
Examples for commit messages following this are:
|
||||
|
||||
`feat: allow provided config object to extend other configs`
|
||||
|
||||
You can also include a scope within parenthesis:
|
||||
|
||||
`fix(scope): Prevent wrong calculation of storage`
|
||||
|
||||
Here's a list of types that we use:
|
||||
|
||||
| Type | Explanation |
|
||||
|---|---|
|
||||
| feat | A new feature |
|
||||
| fix | A bug fix |
|
||||
| docs | Documentation only changes |
|
||||
| style | Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc) |
|
||||
| refactor | A code change that neither fixes a bug nor adds a feature |
|
||||
| perf | A code change that improves performance |
|
||||
| test | Adding missing tests or correcting existing tests |
|
||||
| build |Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm) |
|
||||
| ci | Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs) |
|
||||
| chore | Other changes that don't modify src or test files |
|
||||
| revert | Reverts a previous commit |
|
||||
|
||||
### Further Information
|
||||
|
||||
* [Contributor License Agreement](https://git.k8s.io/community/CLA.md) Kubernetes projects require that you sign a Contributor License Agreement (CLA) before we can accept your pull requests
|
||||
* [Kubernetes Contributor Guide](http://git.k8s.io/community/contributors/guide) - Main contributor documentation, or you can just jump directly to the [contributing section](http://git.k8s.io/community/contributors/guide#contributing)
|
||||
* [Contributor Cheat Sheet](https://git.k8s.io/community/contributors/guide/contributor-cheatsheet/README.md) - Common resources for existing developers
|
||||
|
||||
## Mentorship
|
||||
|
||||
- [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
|
||||
* [Mentoring Initiatives](https://git.k8s.io/community/mentoring) - We have a diverse set of mentorship programs available that are always looking for volunteers!
|
||||
|
||||
## Contact Information
|
||||
|
||||
- [Join Slack](http://slack.k8s.io) to sign up and join the Kubernetes Slack. Please make sure to read our [Slack Guidelines](https://github.com/kubernetes/community/blob/master/communication/slack-guidelines.md) before participating.
|
||||
- The [kube-state-metrics slack channel](https://kubernetes.slack.com/messages/CJJ529RUY) provides an effective communication platform to reach out to members and other users of the project. It offers an alternative to submitting a GitHub issue for when you have questions and issues.
|
||||
* [Join Slack](http://slack.k8s.io) to sign up and join the Kubernetes Slack. Please make sure to read our [Slack Guidelines](https://github.com/kubernetes/community/blob/master/communication/slack-guidelines.md) before participating.
|
||||
* The [kube-state-metrics slack channel](https://kubernetes.slack.com/messages/CJJ529RUY) provides an effective communication platform to reach out to members and other users of the project. It offers an alternative to submitting a GitHub issue for when you have questions and issues.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
ARG GOVERSION=1.19
|
||||
ARG GOVERSION=1.24
|
||||
ARG GOARCH
|
||||
FROM golang:${GOVERSION} as builder
|
||||
FROM golang:${GOVERSION} AS builder
|
||||
ARG GOARCH
|
||||
ENV GOARCH=${GOARCH}
|
||||
WORKDIR /go/src/k8s.io/kube-state-metrics/
|
||||
|
@ -8,7 +8,7 @@ COPY . /go/src/k8s.io/kube-state-metrics/
|
|||
|
||||
RUN make build-local
|
||||
|
||||
FROM gcr.io/distroless/static:latest-${GOARCH}
|
||||
FROM gcr.io/distroless/static-debian12:latest-${GOARCH}
|
||||
COPY --from=builder /go/src/k8s.io/kube-state-metrics/kube-state-metrics /
|
||||
|
||||
USER nobody
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# Maintaining kube-state-metrics
|
||||
|
||||
kube-state-metrics is welcoming contributions from the community. If you are interested in intensifying your contributions and becoming a maintainer, this doc describes the necessary steps.
|
||||
|
||||
As part of the Kubernetes project, we rely on the [community membership process](https://github.com/kubernetes/community/blob/master/community-membership.md). We do not adhere strictly to the numbers of contributions and reviews. Still as becoming a maintainer is a trust-based process and we desire positive outcomes for the project, we look for a long-term interest and engagement.
|
||||
|
||||
## Adding a new reviewer
|
||||
|
||||
* Ensure the new reviewer is a member of the [kubernetes organization](https://github.com/kubernetes/org/blob/main/config/kubernetes/org.yaml).
|
||||
* Add the new reviewer to the [OWNERS](OWNERS) file to be able to review pull requests.
|
||||
* Add the new reviewer to the [kube-state-metrics-maintainers group](https://github.com/kubernetes/org/blob/main/config/kubernetes/sig-instrumentation/teams.yaml), to gain write access to the kube-state-metrics repository (e.g. for creating new releases).
|
||||
|
||||
## Adding a new approver
|
||||
|
||||
* Ensure the new approver is already a reviewer in the [OWNERS](OWNERS) file.
|
||||
* Add the new approver to the [OWNERS](OWNERS) file to be able to approve pull requests.
|
||||
* Add the new approver to the [SECURITY_CONTACTS](SECURITY_CONTACTS) file to be able to get notified on security related incidents.
|
||||
* Add the new approver to the [kube-state-metrics-admin group](https://github.com/kubernetes/org/blob/main/config/kubernetes/sig-instrumentation/teams.yaml), to get admin access to the kube-state-metrics repository.
|
||||
* Add the new approver to the k8s.io [OWNERS](https://github.com/kubernetes/k8s.io/blob/main/k8s.gcr.io/images/k8s-staging-kube-state-metrics/OWNERS) file to be able to approve image promotion from the staging registry.
|
75
Makefile
75
Makefile
|
@ -2,12 +2,10 @@ FLAGS =
|
|||
TESTENVVAR =
|
||||
REGISTRY ?= gcr.io/k8s-staging-kube-state-metrics
|
||||
TAG_PREFIX = v
|
||||
VERSION = $(shell cat VERSION)
|
||||
VERSION = $(shell grep '^version:' data.yaml | grep -oE "[0-9]+.[0-9]+.[0-9]+")
|
||||
TAG ?= $(TAG_PREFIX)$(VERSION)
|
||||
LATEST_RELEASE_BRANCH := release-$(shell grep -ohE "[0-9]+.[0-9]+" VERSION)
|
||||
LATEST_RELEASE_BRANCH := release-$(shell echo $(VERSION) | grep -ohE "[0-9]+.[0-9]+")
|
||||
BRANCH = $(strip $(shell git rev-parse --abbrev-ref HEAD))
|
||||
DOCKER_CLI ?= docker
|
||||
PROMTOOL_CLI ?= promtool
|
||||
PKGS = $(shell go list ./... | grep -v /vendor/ | grep -v /tests/e2e)
|
||||
ARCH ?= $(shell go env GOARCH)
|
||||
BUILD_DATE = $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
|
||||
|
@ -15,12 +13,21 @@ GIT_COMMIT ?= $(shell git rev-parse --short HEAD)
|
|||
OS ?= $(shell uname -s | tr A-Z a-z)
|
||||
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
||||
PKG = github.com/prometheus/common
|
||||
PROMETHEUS_VERSION = 2.40.6
|
||||
GO_VERSION = 1.19.6
|
||||
PROMETHEUS_VERSION = 3.4.1
|
||||
GO_VERSION = 1.24.4
|
||||
IMAGE = $(REGISTRY)/kube-state-metrics
|
||||
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
|
||||
USER ?= $(shell id -u -n)
|
||||
HOST ?= $(shell hostname)
|
||||
MARKDOWNLINT_CLI2_VERSION = 0.18.1
|
||||
|
||||
DOCKER_CLI ?= docker
|
||||
PROMTOOL_CLI ?= promtool
|
||||
GOMPLATE_CLI ?= go tool github.com/hairyhenderson/gomplate/v4/cmd/gomplate
|
||||
GOJSONTOYAML_CLI ?= go tool github.com/brancz/gojsontoyaml
|
||||
EMBEDMD_CLI ?= go tool github.com/campoy/embedmd
|
||||
JSONNET_CLI ?= go tool github.com/google/go-jsonnet/cmd/jsonnet
|
||||
JB_CLI ?= go tool github.com/jsonnet-bundler/jsonnet-bundler/cmd/jb
|
||||
|
||||
export DOCKER_CLI_EXPERIMENTAL=enabled
|
||||
|
||||
|
@ -41,23 +48,24 @@ licensecheck:
|
|||
exit 1; \
|
||||
fi
|
||||
|
||||
lint: shellcheck licensecheck
|
||||
lint: shellcheck licensecheck lint-markdown-format
|
||||
golangci-lint run
|
||||
|
||||
lint-fix:
|
||||
lint-fix: fix-markdown-format
|
||||
golangci-lint run --fix -v
|
||||
|
||||
doccheck: generate
|
||||
|
||||
doccheck: generate validate-template
|
||||
@echo "- Checking if the generated documentation is up to date..."
|
||||
@git diff --exit-code
|
||||
@echo "- Checking if the documentation is in sync with the code..."
|
||||
@grep -hoE -d skip '\| kube_[^ |]+' docs/* --exclude=README.md | sed -E 's/\| //g' | sort -u > documented_metrics
|
||||
@grep -rhoE '\| kube_[^ |]+' docs/metrics/* --exclude=README.md | sed -E 's/\| //g' | sort -u > documented_metrics
|
||||
@find internal/store -type f -not -name '*_test.go' -exec sed -nE 's/.*"(kube_[^"]+)".*/\1/p' {} \; | sort -u > code_metrics
|
||||
@diff -u0 code_metrics documented_metrics || (echo "ERROR: Metrics with - are present in code but missing in documentation, metrics with + are documented but not found in code."; exit 1)
|
||||
@echo OK
|
||||
@rm -f code_metrics documented_metrics
|
||||
@echo "- Checking for orphan documentation files"
|
||||
@cd docs; for doc in *.md; do if [ "$$doc" != "README.md" ] && ! grep -q "$$doc" *.md; then echo "ERROR: No link to documentation file $${doc} detected"; exit 1; fi; done
|
||||
@cd docs; for doc in $$(find metrics/* -name '*.md' | sed 's/.*\///'); do if [ "$$doc" != "README.md" ] && ! grep -q "$$doc" *.md; then echo "ERROR: No link to documentation file $${doc} detected"; exit 1; fi; done
|
||||
@echo OK
|
||||
|
||||
build-local:
|
||||
|
@ -78,12 +86,24 @@ test-rules:
|
|||
shellcheck:
|
||||
${DOCKER_CLI} run -v "${PWD}:/mnt" koalaman/shellcheck:stable $(shell find . -type f -name "*.sh" -not -path "*vendor*")
|
||||
|
||||
lint-markdown-format:
|
||||
${DOCKER_CLI} run -v "${PWD}:/workdir" davidanson/markdownlint-cli2:v${MARKDOWNLINT_CLI2_VERSION} --config .markdownlint-cli2.jsonc
|
||||
|
||||
fix-markdown-format:
|
||||
${DOCKER_CLI} run -v "${PWD}:/workdir" davidanson/markdownlint-cli2:v${MARKDOWNLINT_CLI2_VERSION} --fix --config .markdownlint-cli2.jsonc
|
||||
|
||||
generate-template:
|
||||
${GOMPLATE_CLI} -d config=./data.yaml --file README.md.tpl > README.md
|
||||
|
||||
validate-template: generate-template
|
||||
git diff --no-ext-diff --quiet --exit-code README.md
|
||||
|
||||
# Runs benchmark tests on the current git ref and the last release and compares
|
||||
# the two.
|
||||
test-benchmark-compare:
|
||||
@git fetch
|
||||
./tests/compare_benchmarks.sh main
|
||||
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH}
|
||||
./tests/compare_benchmarks.sh main 2
|
||||
./tests/compare_benchmarks.sh ${LATEST_RELEASE_BRANCH} 2
|
||||
|
||||
all: all-container
|
||||
|
||||
|
@ -120,10 +140,10 @@ clean:
|
|||
e2e:
|
||||
./tests/e2e.sh
|
||||
|
||||
generate: build-local
|
||||
generate: build-local generate-template
|
||||
@echo ">> generating docs"
|
||||
@./scripts/generate-help-text.sh
|
||||
embedmd -w `find . -path ./vendor -prune -o -name "*.md" -print`
|
||||
${EMBEDMD_CLI} -w `find . -path ./vendor -prune -o -name "*.md" -print`
|
||||
|
||||
validate-manifests: examples
|
||||
@git diff --exit-code
|
||||
|
@ -132,30 +152,31 @@ mixin: examples/prometheus-alerting-rules/alerts.yaml
|
|||
|
||||
examples/prometheus-alerting-rules/alerts.yaml: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/mixin.jsonnet scripts/vendor
|
||||
mkdir -p examples/prometheus-alerting-rules
|
||||
jsonnet -J scripts/vendor scripts/mixin.jsonnet | gojsontoyaml > examples/prometheus-alerting-rules/alerts.yaml
|
||||
${JSONNET_CLI} -J scripts/vendor scripts/mixin.jsonnet | ${GOJSONTOYAML_CLI} > examples/prometheus-alerting-rules/alerts.yaml
|
||||
|
||||
examples: examples/standard examples/autosharding mixin
|
||||
examples: examples/standard examples/autosharding examples/daemonsetsharding mixin
|
||||
|
||||
examples/standard: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/standard.jsonnet scripts/vendor VERSION
|
||||
examples/standard: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/standard.jsonnet scripts/vendor
|
||||
mkdir -p examples/standard
|
||||
jsonnet -J scripts/vendor -m examples/standard --ext-str version="$(VERSION)" scripts/standard.jsonnet | xargs -I{} sh -c 'cat {} | gojsontoyaml > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
|
||||
${JSONNET_CLI} -J scripts/vendor -m examples/standard --ext-str version="$(VERSION)" scripts/standard.jsonnet | xargs -I{} sh -c 'cat {} | ${GOJSONTOYAML_CLI} > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
|
||||
find examples -type f ! -name '*.yaml' -delete
|
||||
|
||||
examples/autosharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/autosharding.jsonnet scripts/vendor VERSION
|
||||
examples/autosharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/autosharding.jsonnet scripts/vendor
|
||||
mkdir -p examples/autosharding
|
||||
jsonnet -J scripts/vendor -m examples/autosharding --ext-str version="$(VERSION)" scripts/autosharding.jsonnet | xargs -I{} sh -c 'cat {} | gojsontoyaml > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
|
||||
${JSONNET_CLI} -J scripts/vendor -m examples/autosharding --ext-str version="$(VERSION)" scripts/autosharding.jsonnet | xargs -I{} sh -c 'cat {} | ${GOJSONTOYAML_CLI} > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
|
||||
find examples -type f ! -name '*.yaml' -delete
|
||||
|
||||
examples/daemonsetsharding: jsonnet $(shell find jsonnet | grep ".libsonnet") scripts/daemonsetsharding.jsonnet scripts/vendor
|
||||
mkdir -p examples/daemonsetsharding
|
||||
${JSONNET_CLI} -J scripts/vendor -m examples/daemonsetsharding --ext-str version="$(VERSION)" scripts/daemonsetsharding.jsonnet | xargs -I{} sh -c 'cat {} | ${GOJSONTOYAML_CLI} > `echo {} | sed "s/\(.\)\([A-Z]\)/\1-\2/g" | tr "[:upper:]" "[:lower:]"`.yaml' -- {}
|
||||
find examples -type f ! -name '*.yaml' -delete
|
||||
|
||||
scripts/vendor: scripts/jsonnetfile.json scripts/jsonnetfile.lock.json
|
||||
cd scripts && jb install
|
||||
|
||||
install-tools:
|
||||
@echo Installing tools from tools.go
|
||||
grep '^\s*_' tools/tools.go | awk '{print $$2}' | xargs -tI % go install -mod=readonly -modfile=tools/go.mod %
|
||||
cd scripts && ${JB_CLI} install
|
||||
|
||||
install-promtool:
|
||||
@echo Installing promtool
|
||||
@wget -qO- "https://github.com/prometheus/prometheus/releases/download/v${PROMETHEUS_VERSION}/prometheus-${PROMETHEUS_VERSION}.${OS}-${ARCH}.tar.gz" |\
|
||||
tar xvz --strip-components=1 prometheus-${PROMETHEUS_VERSION}.${OS}-${ARCH}/promtool
|
||||
|
||||
.PHONY: all build build-local all-push all-container container container-* do-push-* sub-push-* push push-multi-arch test-unit test-rules test-benchmark-compare clean e2e validate-modules shellcheck licensecheck lint lint-fix generate embedmd
|
||||
.PHONY: all build build-local all-push all-container container container-* do-push-* sub-push-* push push-multi-arch test-unit test-rules test-benchmark-compare clean e2e validate-modules shellcheck licensecheck lint lint-fix generate generate-template validate-template embedmd
|
||||
|
|
5
OWNERS
5
OWNERS
|
@ -1,17 +1,18 @@
|
|||
reviewers:
|
||||
- CatherineF-dev
|
||||
- dgrisonnet
|
||||
- fpetkovski
|
||||
- logicalhan
|
||||
- mrueg
|
||||
- rexagod
|
||||
approvers:
|
||||
- CatherineF-dev
|
||||
- dgrisonnet
|
||||
- fpetkovski
|
||||
- mrueg
|
||||
- rexagod
|
||||
emeritus_approvers:
|
||||
- LiliC
|
||||
- andyxning
|
||||
- brancz
|
||||
- tariq1890
|
||||
- zouyee
|
||||
- fpetkovski
|
||||
|
|
185
README.md
185
README.md
|
@ -4,6 +4,8 @@
|
|||
[](https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics)
|
||||
[](https://pkg.go.dev/github.com/kubernetes/kube-state-metrics)
|
||||
[](https://github.com/kubernetes/kube-state-metrics/actions/workflows/govulncheck.yml)
|
||||
[](https://www.bestpractices.dev/projects/8696)
|
||||
[](https://api.securityscorecards.dev/projects/github.com/kubernetes/kube-state-metrics)
|
||||
|
||||
kube-state-metrics (KSM) is a simple service that listens to the Kubernetes API
|
||||
server and generates metrics about the state of the objects. (See examples in
|
||||
|
@ -28,43 +30,46 @@ the raw metrics. Note that the metrics exposed on the `/metrics` endpoint
|
|||
reflect the current state of the Kubernetes cluster. When Kubernetes objects
|
||||
are deleted they are no longer visible on the `/metrics` endpoint.
|
||||
|
||||
> [!NOTE]
|
||||
> This README is generated from a [template](./README.md.tpl). Please make your changes there and run `make generate-template`.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Versioning](#versioning)
|
||||
- [Kubernetes Version](#kubernetes-version)
|
||||
- [Compatibility matrix](#compatibility-matrix)
|
||||
- [Resource group version compatibility](#resource-group-version-compatibility)
|
||||
- [Container Image](#container-image)
|
||||
- [Metrics Documentation](#metrics-documentation)
|
||||
- [Conflict resolution in label names](#conflict-resolution-in-label-names)
|
||||
- [Enabling VerticalPodAutoscalers](#enabling-verticalpodautoscalers)
|
||||
- [Kube-state-metrics self metrics](#kube-state-metrics-self-metrics)
|
||||
- [Resource recommendation](#resource-recommendation)
|
||||
- [Latency](#latency)
|
||||
- [A note on costing](#a-note-on-costing)
|
||||
- [kube-state-metrics vs. metrics-server](#kube-state-metrics-vs-metrics-server)
|
||||
- [Scaling kube-state-metrics](#scaling-kube-state-metrics)
|
||||
- [Resource recommendation](#resource-recommendation)
|
||||
- [Horizontal sharding](#horizontal-sharding)
|
||||
- [Automated sharding](#automated-sharding)
|
||||
- [Daemonset sharding for pod metrics](#daemonset-sharding-for-pod-metrics)
|
||||
- [Setup](#setup)
|
||||
- [Building the Docker container](#building-the-docker-container)
|
||||
- [Usage](#usage)
|
||||
- [Kubernetes Deployment](#kubernetes-deployment)
|
||||
- [Limited privileges environment](#limited-privileges-environment)
|
||||
- [Helm Chart](#helm-chart)
|
||||
- [Development](#development)
|
||||
- [Developer Contributions](#developer-contributions)
|
||||
* [Versioning](#versioning)
|
||||
* [Kubernetes Version](#kubernetes-version)
|
||||
* [Compatibility matrix](#compatibility-matrix)
|
||||
* [Resource group version compatibility](#resource-group-version-compatibility)
|
||||
* [Container Image](#container-image)
|
||||
* [Metrics Documentation](#metrics-documentation)
|
||||
* [ECMAScript regular expression support for allow and deny lists](#ecmascript-regular-expression-support-for-allow-and-deny-lists)
|
||||
* [Conflict resolution in label names](#conflict-resolution-in-label-names)
|
||||
* [Kube-state-metrics self metrics](#kube-state-metrics-self-metrics)
|
||||
* [Resource recommendation](#resource-recommendation)
|
||||
* [Latency](#latency)
|
||||
* [A note on costing](#a-note-on-costing)
|
||||
* [kube-state-metrics vs. metrics-server](#kube-state-metrics-vs-metrics-server)
|
||||
* [Scaling kube-state-metrics](#scaling-kube-state-metrics)
|
||||
* [Resource recommendation](#resource-recommendation)
|
||||
* [Horizontal sharding](#horizontal-sharding)
|
||||
* [Automated sharding](#automated-sharding)
|
||||
* [Daemonset sharding for pod metrics](#daemonset-sharding-for-pod-metrics)
|
||||
* [Setup](#setup)
|
||||
* [Building the Docker container](#building-the-docker-container)
|
||||
* [Usage](#usage)
|
||||
* [Kubernetes Deployment](#kubernetes-deployment)
|
||||
* [Limited privileges environment](#limited-privileges-environment)
|
||||
* [Helm Chart](#helm-chart)
|
||||
* [Development](#development)
|
||||
* [Developer Contributions](#developer-contributions)
|
||||
* [Community](#community)
|
||||
|
||||
### Versioning
|
||||
|
||||
#### Kubernetes Version
|
||||
|
||||
kube-state-metrics uses [`client-go`](https://github.com/kubernetes/client-go) to talk with
|
||||
Kubernetes clusters. The supported Kubernetes cluster version is determined by `client-go`.
|
||||
The compatibility matrix for client-go and Kubernetes cluster can be found
|
||||
[here](https://github.com/kubernetes/client-go#compatibility-matrix).
|
||||
Kubernetes clusters. The supported Kubernetes cluster version is determined by
|
||||
[`client-go`](https://github.com/kubernetes/client-go#compatibility-matrix).
|
||||
All additional compatibility is only best effort, or happens to still/already be supported.
|
||||
|
||||
#### Compatibility matrix
|
||||
|
@ -74,13 +79,12 @@ Generally, it is recommended to use the latest release of kube-state-metrics. If
|
|||
|
||||
| kube-state-metrics | Kubernetes client-go Version |
|
||||
|--------------------|:----------------------------:|
|
||||
| **v2.4.2** | v1.23 |
|
||||
| **v2.5.0** | v1.24 |
|
||||
| **v2.6.0** | v1.24 |
|
||||
| **v2.7.0** | v1.25 |
|
||||
| **v2.8.1** | v1.26 |
|
||||
| **main** | v1.26 |
|
||||
|
||||
| **v2.12.0** | v1.29 |
|
||||
| **v2.13.0** | v1.30 |
|
||||
| **v2.14.0** | v1.31 |
|
||||
| **v2.15.0** | v1.32 |
|
||||
| **v2.16.0** | v1.32 |
|
||||
| **main** | v1.33 |
|
||||
|
||||
#### Resource group version compatibility
|
||||
|
||||
|
@ -91,7 +95,9 @@ release.
|
|||
#### Container Image
|
||||
|
||||
The latest container image can be found at:
|
||||
* `registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.8.1` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
|
||||
|
||||
* `registry.k8s.io/kube-state-metrics/kube-state-metrics:v2.16.0` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
|
||||
* [Multi-architecture images](https://explore.ggcr.dev/?image=registry.k8s.io%2Fkube-state-metrics%2Fkube-state-metrics:v2.16.0)
|
||||
|
||||
### Metrics Documentation
|
||||
|
||||
|
@ -123,12 +129,9 @@ e.g. by standardizing Kubernetes labels using an
|
|||
[Admission Webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/)
|
||||
that ensures that there are no possible conflicts.
|
||||
|
||||
#### Enabling VerticalPodAutoscalers
|
||||
#### ECMAScript regular expression support for allow and deny lists
|
||||
|
||||
Please note that the collector for `verticalpodautoscalers` is **disabled** by default; Vertical Pod Autoscaler metrics will not be collected until the collector is enabled. This is because Vertical Pod Autoscalers are managed as custom resources.
|
||||
|
||||
If you want to enable this collector,
|
||||
the [instructions](./docs/verticalpodautoscaler-metrics.md#Configuration) are located in the [Vertical Pod Autoscaler Metrics](./docs/verticalpodautoscaler-metrics.md) documentation.
|
||||
Starting from [#2616](https://github.com/kubernetes/kube-state-metrics/pull/2616/files), kube-state-metrics supports ECMAScript's `regexp` for allow and deny lists. This was incorporated as a workaround for the limitations of the `regexp` 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.
|
||||
|
||||
### Kube-state-metrics self metrics
|
||||
|
||||
|
@ -139,14 +142,16 @@ If you encounter those errors in the metrics, it is most likely a configuration
|
|||
at the logs of kube-state-metrics.
|
||||
|
||||
Example of the above mentioned metrics:
|
||||
```
|
||||
|
||||
```prometheus
|
||||
kube_state_metrics_list_total{resource="*v1.Node",result="success"} 1
|
||||
kube_state_metrics_list_total{resource="*v1.Node",result="error"} 52
|
||||
kube_state_metrics_watch_total{resource="*v1beta1.Ingress",result="success"} 1
|
||||
```
|
||||
|
||||
kube-state-metrics also exposes some http request metrics, examples of those are:
|
||||
```
|
||||
|
||||
```prometheus
|
||||
http_request_duration_seconds_bucket{handler="metrics",method="get",le="2.5"} 30
|
||||
http_request_duration_seconds_bucket{handler="metrics",method="get",le="5"} 30
|
||||
http_request_duration_seconds_bucket{handler="metrics",method="get",le="10"} 30
|
||||
|
@ -156,20 +161,21 @@ http_request_duration_seconds_count{handler="metrics",method="get"} 30
|
|||
```
|
||||
|
||||
kube-state-metrics also exposes build and configuration metrics:
|
||||
```
|
||||
|
||||
```prometheus
|
||||
kube_state_metrics_build_info{branch="main",goversion="go1.15.3",revision="6c9d775d",version="v2.0.0-beta"} 1
|
||||
kube_state_metrics_shard_ordinal{shard_ordinal="0"} 0
|
||||
kube_state_metrics_total_shards 1
|
||||
```
|
||||
|
||||
`kube_state_metrics_build_info` is used to expose version and other build information. For more usage about the info pattern,
|
||||
please check the blog post [here](https://www.robustperception.io/exposing-the-software-version-to-prometheus).
|
||||
please check this [blog post](https://www.robustperception.io/exposing-the-software-version-to-prometheus).
|
||||
Sharding metrics expose `--shard` and `--total-shards` flags and can be used to validate
|
||||
run-time configuration, see [`/examples/prometheus-alerting-rules`](./examples/prometheus-alerting-rules).
|
||||
|
||||
kube-state-metrics also exposes metrics about it config file and the Custom Resource State config file:
|
||||
|
||||
```
|
||||
```prometheus
|
||||
kube_state_metrics_config_hash{filename="crs.yml",type="customresourceconfig"} 2.38272279311849e+14
|
||||
kube_state_metrics_config_hash{filename="config.yml",type="config"} 2.65285922340846e+14
|
||||
kube_state_metrics_last_config_reload_success_timestamp_seconds{filename="crs.yml",type="customresourceconfig"} 1.6704882592037103e+09
|
||||
|
@ -196,7 +202,7 @@ Note that if CPU limits are set too low, kube-state-metrics' internal queues wil
|
|||
|
||||
In a 100 node cluster scaling test the latency numbers were as follows:
|
||||
|
||||
```
|
||||
```text
|
||||
"Perc50": 259615384 ns,
|
||||
"Perc90": 475000000 ns,
|
||||
"Perc99": 906666666 ns.
|
||||
|
@ -204,7 +210,7 @@ In a 100 node cluster scaling test the latency numbers were as follows:
|
|||
|
||||
### A note on costing
|
||||
|
||||
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 [configure what metrics you'd like to expose](docs/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
|
||||
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 [configure what metrics you'd like to expose](docs/developer/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
|
||||
|
||||
### kube-state-metrics vs. metrics-server
|
||||
|
||||
|
@ -253,12 +259,14 @@ The downside of using an auto-sharded setup comes from the rollout strategy supp
|
|||
### Daemonset sharding for pod metrics
|
||||
|
||||
For pod metrics, they can be sharded per node with the following flag:
|
||||
* `--node`
|
||||
|
||||
* `--node=$(NODE_NAME)`
|
||||
|
||||
Each kube-state-metrics pod uses FieldSelector (spec.nodeName) to watch/list pod metrics only on the same node.
|
||||
|
||||
A daemonset kube-state-metrics example:
|
||||
```
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
spec:
|
||||
|
@ -278,21 +286,38 @@ spec:
|
|||
fieldPath: spec.nodeName
|
||||
```
|
||||
|
||||
To track metrics for unassigned pods, you need to add an additional deployment and set `--track-unscheduled-pods`, as shown in the following example:
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
|
||||
name: kube-state-metrics
|
||||
args:
|
||||
- --resources=pods
|
||||
- --track-unscheduled-pods
|
||||
```
|
||||
|
||||
Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
|
||||
|
||||
### Setup
|
||||
|
||||
Install this project to your `$GOPATH` using `go get`:
|
||||
|
||||
```
|
||||
go get k8s.io/kube-state-metrics
|
||||
```bash
|
||||
go get k8s.io/kube-state-metrics/v2
|
||||
```
|
||||
|
||||
#### Building the Docker container
|
||||
|
||||
Simply run the following command in this root folder, which will create a
|
||||
self-contained, statically-linked binary and build a Docker image:
|
||||
```
|
||||
|
||||
```bash
|
||||
make container
|
||||
```
|
||||
|
||||
|
@ -305,7 +330,7 @@ service account token that has read-only access to the Kubernetes cluster.
|
|||
|
||||
The ([`kube-prometheus`](https://github.com/prometheus-operator/kube-prometheus/)) stack installs kube-state-metrics as one of its [components](https://github.com/prometheus-operator/kube-prometheus#kube-prometheus); you do not need to install kube-state-metrics if you're using the kube-prometheus stack.
|
||||
|
||||
If you want to revise the default configuration for kube-prometheus, for example to enable non-default metrics, have a look at [Customizing Kube-Prometheus](https://github.com/prometheus-operator/kube-prometheus#customizing-kube-prometheus).
|
||||
If you want to revise the default configuration for kube-prometheus, for example to enable non-default metrics, have a look at [Customizing Kube-Prometheus](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizing.md).
|
||||
|
||||
#### Kubernetes Deployment
|
||||
|
||||
|
@ -315,19 +340,30 @@ To have Prometheus discover kube-state-metrics instances it is advised to create
|
|||
|
||||
**Note:** 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:
|
||||
|
||||
```
|
||||
```bash
|
||||
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud info --format='value(config.account)')
|
||||
```
|
||||
|
||||
Note that your GCP identity is case sensitive but `gcloud info` 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 `kubectl apply -f examples/standard`, check the IAM member associated with your account at https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID. If it contains capital letters, you may need to set the --user flag in the command above to the case-sensitive role listed at https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID.
|
||||
Note that your GCP identity is case sensitive but `gcloud info` 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 `kubectl apply -f examples/standard`, check the IAM member associated with your account at <https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID>. If it contains capital letters, you may need to set the --user flag in the command above to the case-sensitive role listed at <https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID>.
|
||||
|
||||
After running the above, if you see `Clusterrolebinding "cluster-admin-binding" created`, then you are able to continue with the setup of this service.
|
||||
|
||||
#### Healthcheck Endpoints
|
||||
|
||||
The following healthcheck endpoints are available (`self` refers to the telemetry port, while `main` refers to the exposition port):
|
||||
|
||||
* `/healthz` (exposed on `main`): Returns a 200 status code if the application is running. We recommend to use this for the startup probe.
|
||||
* `/livez` (exposed on `main`): 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.
|
||||
* `/readyz` (exposed on `self`): Returns a 200 status code if the application is ready to accept requests and expose metrics. We recommend using this for the readiness probe.
|
||||
|
||||
Note that it is discouraged to use the telemetry metrics endpoint for any probe when proxying the exposition data.
|
||||
|
||||
#### Limited privileges environment
|
||||
|
||||
If you want to run kube-state-metrics in an environment where you don't have cluster-reader role, you can:
|
||||
|
||||
- create a serviceaccount
|
||||
* create a serviceaccount
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
|
@ -336,7 +372,8 @@ metadata:
|
|||
namespace: your-namespace-where-kube-state-metrics-will-deployed
|
||||
```
|
||||
|
||||
- give it `view` privileges on specific namespaces (using roleBinding) (*note: you can add this roleBinding to all the NS you want your serviceaccount to access*)
|
||||
* give it `view` privileges on specific namespaces (using roleBinding) (*note: you can add this roleBinding to all the NS you want your serviceaccount to access*)
|
||||
|
||||
```yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
|
@ -353,7 +390,7 @@ subjects:
|
|||
namespace: your-namespace-where-kube-state-metrics-will-deployed
|
||||
```
|
||||
|
||||
- then specify a set of namespaces (using the `--namespaces` option) and a set of kubernetes objects (using the `--resources`) that your serviceaccount has access to in the `kube-state-metrics` deployment configuration
|
||||
* then specify a set of namespaces (using the `--namespaces` option) and a set of kubernetes objects (using the `--resources`) that your serviceaccount has access to in the `kube-state-metrics` deployment configuration
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
|
@ -366,8 +403,7 @@ spec:
|
|||
- '--namespaces=project1'
|
||||
```
|
||||
|
||||
For the full list of arguments available, see the documentation in [docs/cli-arguments.md](./docs/cli-arguments.md)
|
||||
|
||||
For the full list of arguments available, see the documentation in [docs/developer/cli-arguments.md](./docs/developer/cli-arguments.md)
|
||||
|
||||
#### Helm Chart
|
||||
|
||||
|
@ -375,20 +411,35 @@ Starting from the kube-state-metrics chart `v2.13.3` (kube-state-metrics image `
|
|||
|
||||
#### Development
|
||||
|
||||
When developing, test a metric dump against your local Kubernetes cluster by
|
||||
running:
|
||||
When developing, test a metric dump against your local Kubernetes cluster by running:
|
||||
|
||||
> Users can override the apiserver address in KUBE-CONFIG file with `--apiserver` command line.
|
||||
|
||||
go install
|
||||
kube-state-metrics --port=8080 --telemetry-port=8081 --kubeconfig=<KUBE-CONFIG> --apiserver=<APISERVER>
|
||||
```bash
|
||||
go install
|
||||
kube-state-metrics --port=8080 --telemetry-port=8081 --kubeconfig=<KUBE-CONFIG> --apiserver=<APISERVER>
|
||||
```
|
||||
|
||||
Then curl the metrics endpoint
|
||||
|
||||
curl localhost:8080/metrics
|
||||
```bash
|
||||
curl localhost:8080/metrics
|
||||
```
|
||||
|
||||
To run the e2e tests locally see the documentation in [tests/README.md](./tests/README.md).
|
||||
|
||||
#### Developer Contributions
|
||||
|
||||
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 [docs/developer/guide.md](./docs/developer/guide.md).
|
||||
|
||||
#### Community
|
||||
|
||||
This project is sponsored by [SIG Instrumentation](https://github.com/kubernetes/community/tree/master/sig-instrumentation).
|
||||
|
||||
There is also a channel for [#kube-state-metrics](https://kubernetes.slack.com/archives/CJJ529RUY) on Kubernetes' Slack.
|
||||
|
||||
You can also join the SIG Instrumentation [mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-instrumentation).
|
||||
This will typically add invites for the following meetings to your calendar, in which topics around kube-state-metrics can be discussed.
|
||||
|
||||
* Regular SIG Meeting: [Thursdays at 9:30 PT (Pacific Time)](https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09) (biweekly). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=9:30&tz=PT%20%28Pacific%20Time%29).
|
||||
* Regular Triage Meeting: [Thursdays at 9:30 PT (Pacific Time)](https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09) (biweekly - alternating with regular meeting). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=9:30&tz=PT%20%28Pacific%20Time%29).
|
||||
|
|
|
@ -0,0 +1,446 @@
|
|||
# Overview
|
||||
|
||||
[](https://github.com/kubernetes/kube-state-metrics/actions)
|
||||
[](https://goreportcard.com/report/github.com/kubernetes/kube-state-metrics)
|
||||
[](https://pkg.go.dev/github.com/kubernetes/kube-state-metrics)
|
||||
[](https://github.com/kubernetes/kube-state-metrics/actions/workflows/govulncheck.yml)
|
||||
[](https://www.bestpractices.dev/projects/8696)
|
||||
[](https://api.securityscorecards.dev/projects/github.com/kubernetes/kube-state-metrics)
|
||||
|
||||
kube-state-metrics (KSM) is a simple service that listens to the Kubernetes API
|
||||
server and generates metrics about the state of the objects. (See examples in
|
||||
the Metrics section below.) It is not focused on the health of the individual
|
||||
Kubernetes components, but rather on the health of the various objects inside,
|
||||
such as deployments, nodes and pods.
|
||||
|
||||
kube-state-metrics is about generating metrics from Kubernetes API objects
|
||||
without modification. This ensures that features provided by kube-state-metrics
|
||||
have the same grade of stability as the Kubernetes API objects themselves. In
|
||||
turn, this means that kube-state-metrics in certain situations may not show the
|
||||
exact same values as kubectl, as kubectl applies certain heuristics to display
|
||||
comprehensible messages. kube-state-metrics exposes raw data unmodified from the
|
||||
Kubernetes API, this way users have all the data they require and perform
|
||||
heuristics as they see fit.
|
||||
|
||||
The metrics are exported on the HTTP endpoint `/metrics` on the listening port
|
||||
(default 8080). They are served as plaintext. They are designed to be consumed
|
||||
either by Prometheus itself or by a scraper that is compatible with scraping a
|
||||
Prometheus client endpoint. You can also open `/metrics` in a browser to see
|
||||
the raw metrics. Note that the metrics exposed on the `/metrics` endpoint
|
||||
reflect the current state of the Kubernetes cluster. When Kubernetes objects
|
||||
are deleted they are no longer visible on the `/metrics` endpoint.
|
||||
|
||||
> [!NOTE]
|
||||
> This README is generated from a [template](./README.md.tpl). Please make your changes there and run `make generate-template`.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
* [Versioning](#versioning)
|
||||
* [Kubernetes Version](#kubernetes-version)
|
||||
* [Compatibility matrix](#compatibility-matrix)
|
||||
* [Resource group version compatibility](#resource-group-version-compatibility)
|
||||
* [Container Image](#container-image)
|
||||
* [Metrics Documentation](#metrics-documentation)
|
||||
* [ECMAScript regular expression support for allow and deny lists](#ecmascript-regular-expression-support-for-allow-and-deny-lists)
|
||||
* [Conflict resolution in label names](#conflict-resolution-in-label-names)
|
||||
* [Kube-state-metrics self metrics](#kube-state-metrics-self-metrics)
|
||||
* [Resource recommendation](#resource-recommendation)
|
||||
* [Latency](#latency)
|
||||
* [A note on costing](#a-note-on-costing)
|
||||
* [kube-state-metrics vs. metrics-server](#kube-state-metrics-vs-metrics-server)
|
||||
* [Scaling kube-state-metrics](#scaling-kube-state-metrics)
|
||||
* [Resource recommendation](#resource-recommendation)
|
||||
* [Horizontal sharding](#horizontal-sharding)
|
||||
* [Automated sharding](#automated-sharding)
|
||||
* [Daemonset sharding for pod metrics](#daemonset-sharding-for-pod-metrics)
|
||||
* [Setup](#setup)
|
||||
* [Building the Docker container](#building-the-docker-container)
|
||||
* [Usage](#usage)
|
||||
* [Kubernetes Deployment](#kubernetes-deployment)
|
||||
* [Limited privileges environment](#limited-privileges-environment)
|
||||
* [Helm Chart](#helm-chart)
|
||||
* [Development](#development)
|
||||
* [Developer Contributions](#developer-contributions)
|
||||
* [Community](#community)
|
||||
|
||||
### Versioning
|
||||
|
||||
#### Kubernetes Version
|
||||
|
||||
kube-state-metrics uses [`client-go`](https://github.com/kubernetes/client-go) to talk with
|
||||
Kubernetes clusters. The supported Kubernetes cluster version is determined by
|
||||
[`client-go`](https://github.com/kubernetes/client-go#compatibility-matrix).
|
||||
All additional compatibility is only best effort, or happens to still/already be supported.
|
||||
|
||||
#### Compatibility matrix
|
||||
|
||||
At most, 5 kube-state-metrics and 5 [kubernetes releases](https://github.com/kubernetes/kubernetes/releases) will be recorded below.
|
||||
Generally, 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.
|
||||
|
||||
| kube-state-metrics | Kubernetes client-go Version |
|
||||
|--------------------|:----------------------------:|
|
||||
{{ define "compat-matrix" -}}
|
||||
{{- range . -}}
|
||||
| **{{ .version }}**{{ strings.Repeat (conv.ToInt (math.Sub 15 (len .version))) " " }}| v{{ .kubernetes }} |
|
||||
{{ end -}}
|
||||
{{- end -}}
|
||||
{{ template "compat-matrix" (datasource "config").compat }}
|
||||
#### Resource group version compatibility
|
||||
|
||||
Resources in Kubernetes can evolve, i.e., the group version for a resource may change from alpha to beta and finally GA
|
||||
in different Kubernetes versions. For now, kube-state-metrics will only use the oldest API available in the latest
|
||||
release.
|
||||
|
||||
#### Container Image
|
||||
|
||||
The latest container image can be found at:
|
||||
{{ define "get-latest-release" -}}
|
||||
{{ (index . (math.Sub (len .) 2)).version -}}
|
||||
{{ end }}
|
||||
* `registry.k8s.io/kube-state-metrics/kube-state-metrics:{{ template "get-latest-release" (datasource "config").compat }}` (arch: `amd64`, `arm`, `arm64`, `ppc64le` and `s390x`)
|
||||
* [Multi-architecture images](https://explore.ggcr.dev/?image=registry.k8s.io%2Fkube-state-metrics%2Fkube-state-metrics:{{ template "get-latest-release" (datasource "config").compat -}})
|
||||
|
||||
### Metrics Documentation
|
||||
|
||||
Any resources and metrics based on alpha Kubernetes APIs are excluded from any stability guarantee,
|
||||
which may be changed at any given release.
|
||||
|
||||
See the [`docs`](docs) directory for more information on the exposed metrics.
|
||||
|
||||
#### Conflict resolution in label names
|
||||
|
||||
The `*_labels` family of metrics exposes Kubernetes labels as Prometheus labels.
|
||||
As [Kubernetes](https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/#syntax-and-character-set)
|
||||
is more liberal than
|
||||
[Prometheus](https://prometheus.io/docs/concepts/data_model/#metric-names-and-labels)
|
||||
in terms of allowed characters in label names,
|
||||
we automatically convert unsupported characters to underscores.
|
||||
For example, `app.kubernetes.io/name` becomes `label_app_kubernetes_io_name`.
|
||||
|
||||
This conversion can create conflicts when multiple Kubernetes labels like
|
||||
`foo-bar` and `foo_bar` would be converted to the same Prometheus label `label_foo_bar`.
|
||||
|
||||
Kube-state-metrics automatically adds a suffix `_conflictN` to resolve this conflict,
|
||||
so it converts the above labels to
|
||||
`label_foo_bar_conflict1` and `label_foo_bar_conflict2`.
|
||||
|
||||
If you'd like to have more control over how this conflict is resolved,
|
||||
you might want to consider addressing this issue on a different level of the stack,
|
||||
e.g. by standardizing Kubernetes labels using an
|
||||
[Admission Webhook](https://kubernetes.io/docs/reference/access-authn-authz/extensible-admission-controllers/)
|
||||
that ensures that there are no possible conflicts.
|
||||
|
||||
#### ECMAScript regular expression support for allow and deny lists
|
||||
|
||||
Starting from [#2616](https://github.com/kubernetes/kube-state-metrics/pull/2616/files), kube-state-metrics supports ECMAScript's `regexp` for allow and deny lists. This was incorporated as a workaround for the limitations of the `regexp` 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.
|
||||
|
||||
### Kube-state-metrics self metrics
|
||||
|
||||
kube-state-metrics exposes its own general process metrics under `--telemetry-host` and `--telemetry-port` (default 8081).
|
||||
|
||||
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.
|
||||
If 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
|
||||
at the logs of kube-state-metrics.
|
||||
|
||||
Example of the above mentioned metrics:
|
||||
|
||||
```prometheus
|
||||
kube_state_metrics_list_total{resource="*v1.Node",result="success"} 1
|
||||
kube_state_metrics_list_total{resource="*v1.Node",result="error"} 52
|
||||
kube_state_metrics_watch_total{resource="*v1beta1.Ingress",result="success"} 1
|
||||
```
|
||||
|
||||
kube-state-metrics also exposes some http request metrics, examples of those are:
|
||||
|
||||
```prometheus
|
||||
http_request_duration_seconds_bucket{handler="metrics",method="get",le="2.5"} 30
|
||||
http_request_duration_seconds_bucket{handler="metrics",method="get",le="5"} 30
|
||||
http_request_duration_seconds_bucket{handler="metrics",method="get",le="10"} 30
|
||||
http_request_duration_seconds_bucket{handler="metrics",method="get",le="+Inf"} 30
|
||||
http_request_duration_seconds_sum{handler="metrics",method="get"} 0.021113919999999998
|
||||
http_request_duration_seconds_count{handler="metrics",method="get"} 30
|
||||
```
|
||||
|
||||
kube-state-metrics also exposes build and configuration metrics:
|
||||
|
||||
```prometheus
|
||||
kube_state_metrics_build_info{branch="main",goversion="go1.15.3",revision="6c9d775d",version="v2.0.0-beta"} 1
|
||||
kube_state_metrics_shard_ordinal{shard_ordinal="0"} 0
|
||||
kube_state_metrics_total_shards 1
|
||||
```
|
||||
|
||||
`kube_state_metrics_build_info` is used to expose version and other build information. For more usage about the info pattern,
|
||||
please check this [blog post](https://www.robustperception.io/exposing-the-software-version-to-prometheus).
|
||||
Sharding metrics expose `--shard` and `--total-shards` flags and can be used to validate
|
||||
run-time configuration, see [`/examples/prometheus-alerting-rules`](./examples/prometheus-alerting-rules).
|
||||
|
||||
kube-state-metrics also exposes metrics about it config file and the Custom Resource State config file:
|
||||
|
||||
```prometheus
|
||||
kube_state_metrics_config_hash{filename="crs.yml",type="customresourceconfig"} 2.38272279311849e+14
|
||||
kube_state_metrics_config_hash{filename="config.yml",type="config"} 2.65285922340846e+14
|
||||
kube_state_metrics_last_config_reload_success_timestamp_seconds{filename="crs.yml",type="customresourceconfig"} 1.6704882592037103e+09
|
||||
kube_state_metrics_last_config_reload_success_timestamp_seconds{filename="config.yml",type="config"} 1.6704882592035313e+09
|
||||
kube_state_metrics_last_config_reload_successful{filename="crs.yml",type="customresourceconfig"} 1
|
||||
kube_state_metrics_last_config_reload_successful{filename="config.yml",type="config"} 1
|
||||
```
|
||||
|
||||
### Scaling kube-state-metrics
|
||||
|
||||
#### Resource recommendation
|
||||
|
||||
Resource usage for kube-state-metrics changes with the Kubernetes objects (Pods/Nodes/Deployments/Secrets etc.) size of the cluster.
|
||||
To some extent, the Kubernetes objects in a cluster are in direct proportion to the node number of the cluster.
|
||||
|
||||
As a general rule, you should allocate:
|
||||
|
||||
* 250MiB memory
|
||||
* 0.1 cores
|
||||
|
||||
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.
|
||||
|
||||
### Latency
|
||||
|
||||
In a 100 node cluster scaling test the latency numbers were as follows:
|
||||
|
||||
```text
|
||||
"Perc50": 259615384 ns,
|
||||
"Perc90": 475000000 ns,
|
||||
"Perc99": 906666666 ns.
|
||||
```
|
||||
|
||||
### A note on costing
|
||||
|
||||
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 [configure what metrics you'd like to expose](docs/developer/cli-arguments.md), as well as consult the documentation for your Kubernetes environment in order to avoid unexpectedly high costs.
|
||||
|
||||
### kube-state-metrics vs. metrics-server
|
||||
|
||||
The [metrics-server](https://github.com/kubernetes-incubator/metrics-server)
|
||||
is a project that has been inspired by
|
||||
[Heapster](https://github.com/kubernetes-retired/heapster) and is implemented
|
||||
to serve the goals of core metrics pipelines in [Kubernetes monitoring
|
||||
architecture](https://github.com/kubernetes/design-proposals-archive/blob/main/instrumentation/monitoring_architecture.md).
|
||||
It is a cluster level component which periodically scrapes metrics from all
|
||||
Kubernetes nodes served by Kubelet through Metrics API. The metrics are
|
||||
aggregated, stored in memory and served in [Metrics API
|
||||
format](https://git.k8s.io/metrics/pkg/apis/metrics/v1alpha1/types.go). The
|
||||
metrics-server stores the latest values only and is not responsible for
|
||||
forwarding metrics to third-party destinations.
|
||||
|
||||
kube-state-metrics is focused on generating completely new metrics from
|
||||
Kubernetes' object state (e.g. metrics based on deployments, replica sets,
|
||||
etc.). It holds an entire snapshot of Kubernetes state in memory and
|
||||
continuously generates new metrics based off of it. And just like the
|
||||
metrics-server it too is not responsible for exporting its metrics anywhere.
|
||||
|
||||
Having kube-state-metrics as a separate project also enables access to these
|
||||
metrics from monitoring systems such as Prometheus.
|
||||
|
||||
### Horizontal sharding
|
||||
|
||||
In order to shard kube-state-metrics horizontally, some automated sharding capabilities have been implemented. It is configured with the following flags:
|
||||
|
||||
* `--shard` (zero indexed)
|
||||
* `--total-shards`
|
||||
|
||||
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 `--use-apiserver-cache` flag. In addition to reducing the latency, this option will also lead to a reduction in the load on etcd.
|
||||
|
||||
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).
|
||||
|
||||
#### Automated sharding
|
||||
|
||||
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.
|
||||
|
||||
To enable automated sharding, kube-state-metrics must be run by a `StatefulSet` and the pod name and namespace must be handed to the kube-state-metrics process via the `--pod` and `--pod-namespace` flags. Example manifests demonstrating the autosharding functionality can be found in [`/examples/autosharding`](./examples/autosharding).
|
||||
|
||||
This way of deploying shards is useful when you want to manage KSM shards through a single Kubernetes resource (a single `StatefulSet` in this case) instead of having one `Deployment` per shard. The advantage can be especially significant when deploying a high number of shards.
|
||||
|
||||
The downside of using an auto-sharded setup comes from the rollout strategy supported by `StatefulSet`s. When managed by a `StatefulSet`, 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.
|
||||
|
||||
### Daemonset sharding for pod metrics
|
||||
|
||||
For pod metrics, they can be sharded per node with the following flag:
|
||||
|
||||
* `--node=$(NODE_NAME)`
|
||||
|
||||
Each kube-state-metrics pod uses FieldSelector (spec.nodeName) to watch/list pod metrics only on the same node.
|
||||
|
||||
A daemonset kube-state-metrics example:
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: DaemonSet
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
|
||||
name: kube-state-metrics
|
||||
args:
|
||||
- --resource=pods
|
||||
- --node=$(NODE_NAME)
|
||||
env:
|
||||
- name: NODE_NAME
|
||||
valueFrom:
|
||||
fieldRef:
|
||||
apiVersion: v1
|
||||
fieldPath: spec.nodeName
|
||||
```
|
||||
|
||||
To track metrics for unassigned pods, you need to add an additional deployment and set `--track-unscheduled-pods`, as shown in the following example:
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- image: registry.k8s.io/kube-state-metrics/kube-state-metrics:IMAGE_TAG
|
||||
name: kube-state-metrics
|
||||
args:
|
||||
- --resources=pods
|
||||
- --track-unscheduled-pods
|
||||
```
|
||||
|
||||
Other metrics can be sharded via [Horizontal sharding](#horizontal-sharding).
|
||||
|
||||
### Setup
|
||||
|
||||
Install this project to your `$GOPATH` using `go get`:
|
||||
|
||||
```bash
|
||||
go get k8s.io/kube-state-metrics/v2
|
||||
```
|
||||
|
||||
#### Building the Docker container
|
||||
|
||||
Simply run the following command in this root folder, which will create a
|
||||
self-contained, statically-linked binary and build a Docker image:
|
||||
|
||||
```bash
|
||||
make container
|
||||
```
|
||||
|
||||
### Usage
|
||||
|
||||
Simply build and run kube-state-metrics inside a Kubernetes pod which has a
|
||||
service account token that has read-only access to the Kubernetes cluster.
|
||||
|
||||
#### For users of prometheus-operator/kube-prometheus stack
|
||||
|
||||
The ([`kube-prometheus`](https://github.com/prometheus-operator/kube-prometheus/)) stack installs kube-state-metrics as one of its [components](https://github.com/prometheus-operator/kube-prometheus#kube-prometheus); you do not need to install kube-state-metrics if you're using the kube-prometheus stack.
|
||||
|
||||
If you want to revise the default configuration for kube-prometheus, for example to enable non-default metrics, have a look at [Customizing Kube-Prometheus](https://github.com/prometheus-operator/kube-prometheus/blob/main/docs/customizing.md).
|
||||
|
||||
#### Kubernetes Deployment
|
||||
|
||||
To deploy this project, you can simply run `kubectl apply -f examples/standard` 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).
|
||||
|
||||
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.
|
||||
|
||||
**Note:** 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:
|
||||
|
||||
```bash
|
||||
kubectl create clusterrolebinding cluster-admin-binding --clusterrole=cluster-admin --user=$(gcloud info --format='value(config.account)')
|
||||
```
|
||||
|
||||
Note that your GCP identity is case sensitive but `gcloud info` 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 `kubectl apply -f examples/standard`, check the IAM member associated with your account at <https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID>. If it contains capital letters, you may need to set the --user flag in the command above to the case-sensitive role listed at <https://console.cloud.google.com/iam-admin/iam?project=PROJECT_ID>.
|
||||
|
||||
After running the above, if you see `Clusterrolebinding "cluster-admin-binding" created`, then you are able to continue with the setup of this service.
|
||||
|
||||
#### Healthcheck Endpoints
|
||||
|
||||
The following healthcheck endpoints are available (`self` refers to the telemetry port, while `main` refers to the exposition port):
|
||||
|
||||
* `/healthz` (exposed on `main`): Returns a 200 status code if the application is running. We recommend to use this for the startup probe.
|
||||
* `/livez` (exposed on `main`): 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.
|
||||
* `/readyz` (exposed on `self`): Returns a 200 status code if the application is ready to accept requests and expose metrics. We recommend using this for the readiness probe.
|
||||
|
||||
Note that it is discouraged to use the telemetry metrics endpoint for any probe when proxying the exposition data.
|
||||
|
||||
#### Limited privileges environment
|
||||
|
||||
If you want to run kube-state-metrics in an environment where you don't have cluster-reader role, you can:
|
||||
|
||||
* create a serviceaccount
|
||||
|
||||
```yaml
|
||||
apiVersion: v1
|
||||
kind: ServiceAccount
|
||||
metadata:
|
||||
name: kube-state-metrics
|
||||
namespace: your-namespace-where-kube-state-metrics-will-deployed
|
||||
```
|
||||
|
||||
* give it `view` privileges on specific namespaces (using roleBinding) (*note: you can add this roleBinding to all the NS you want your serviceaccount to access*)
|
||||
|
||||
```yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: RoleBinding
|
||||
metadata:
|
||||
name: kube-state-metrics
|
||||
namespace: project1
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: view
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: kube-state-metrics
|
||||
namespace: your-namespace-where-kube-state-metrics-will-deployed
|
||||
```
|
||||
|
||||
* then specify a set of namespaces (using the `--namespaces` option) and a set of kubernetes objects (using the `--resources`) that your serviceaccount has access to in the `kube-state-metrics` deployment configuration
|
||||
|
||||
```yaml
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kube-state-metrics
|
||||
args:
|
||||
- '--resources=pods'
|
||||
- '--namespaces=project1'
|
||||
```
|
||||
|
||||
For the full list of arguments available, see the documentation in [docs/developer/cli-arguments.md](./docs/developer/cli-arguments.md)
|
||||
|
||||
#### Helm Chart
|
||||
|
||||
Starting from the kube-state-metrics chart `v2.13.3` (kube-state-metrics image `v1.9.8`), the official [Helm chart](https://artifacthub.io/packages/helm/prometheus-community/kube-state-metrics/) is maintained in [prometheus-community/helm-charts](https://github.com/prometheus-community/helm-charts/tree/main/charts/kube-state-metrics). Starting from kube-state-metrics chart `v3.0.0` only kube-state-metrics images of `v2.0.0 +` are supported.
|
||||
|
||||
#### Development
|
||||
|
||||
When developing, test a metric dump against your local Kubernetes cluster by running:
|
||||
|
||||
> Users can override the apiserver address in KUBE-CONFIG file with `--apiserver` command line.
|
||||
|
||||
```bash
|
||||
go install
|
||||
kube-state-metrics --port=8080 --telemetry-port=8081 --kubeconfig=<KUBE-CONFIG> --apiserver=<APISERVER>
|
||||
```
|
||||
|
||||
Then curl the metrics endpoint
|
||||
|
||||
```bash
|
||||
curl localhost:8080/metrics
|
||||
```
|
||||
|
||||
To run the e2e tests locally see the documentation in [tests/README.md](./tests/README.md).
|
||||
|
||||
#### Developer Contributions
|
||||
|
||||
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 [docs/developer/guide.md](./docs/developer/guide.md).
|
||||
|
||||
#### Community
|
||||
|
||||
This project is sponsored by [SIG Instrumentation](https://github.com/kubernetes/community/tree/master/sig-instrumentation).
|
||||
|
||||
There is also a channel for [#kube-state-metrics](https://kubernetes.slack.com/archives/CJJ529RUY) on Kubernetes' Slack.
|
||||
|
||||
You can also join the SIG Instrumentation [mailing list](https://groups.google.com/forum/#!forum/kubernetes-sig-instrumentation).
|
||||
This will typically add invites for the following meetings to your calendar, in which topics around kube-state-metrics can be discussed.
|
||||
|
||||
* Regular SIG Meeting: [Thursdays at 9:30 PT (Pacific Time)](https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09) (biweekly). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=9:30&tz=PT%20%28Pacific%20Time%29).
|
||||
* Regular Triage Meeting: [Thursdays at 9:30 PT (Pacific Time)](https://zoom.us/j/5342565819?pwd=RlVsK21NVnR1dmE3SWZQSXhveHZPdz09) (biweekly - alternating with regular meeting). [Convert to your timezone](http://www.thetimezoneconverter.com/?t=9:30&tz=PT%20%28Pacific%20Time%29).
|
10
RELEASE.md
10
RELEASE.md
|
@ -14,19 +14,23 @@ Maintaining the release branches for older minor releases happens on a best effo
|
|||
|
||||
## Prepare your release
|
||||
|
||||
* Bump the version in the `VERSION` file in the root of the repository.
|
||||
* Update the [data.yaml](data.yaml)
|
||||
* Update the compat list
|
||||
* Update the version key to refer to your new release
|
||||
* Run `make examples`, which will re-generate all example manifests to use the new version.
|
||||
* Make a PR to update:
|
||||
* [Compatibility matrix](README.md#compatibility-matrix)
|
||||
* Run `make generate`, which will update the compatibility matrix in README.md
|
||||
* Changelog entry
|
||||
* Only include user relevant changes
|
||||
* Entries in the [`CHANGELOG.md`](CHANGELOG.md) are meant to be in this order:
|
||||
```
|
||||
|
||||
```text
|
||||
[CHANGE]
|
||||
[FEATURE]
|
||||
[ENHANCEMENT]
|
||||
[BUGFIX]
|
||||
```
|
||||
|
||||
* All lines should be full sentences
|
||||
* kube-state-metrics image tag used in Kubernetes deployment yaml config.
|
||||
* Cut the new release branch, e.g. `release-1.2`, or merge/cherry-pick changes onto the minor release branch you intend to tag the release on
|
||||
|
|
|
@ -0,0 +1,49 @@
|
|||
# Refer: https://github.com/ossf/security-insights-spec/blob/main/specification.md#specification
|
||||
header:
|
||||
schema-version: "1.0.0"
|
||||
expiration-date: "2024-12-15T19:10:00.000Z"
|
||||
project-url: https://github.com/kubernetes/kube-state-metrics
|
||||
changelog: https://github.com/kubernetes/kube-state-metrics/blob/main/CHANGELOG.md
|
||||
license: https://github.com/kubernetes/kube-state-metrics/blob/main/LICENSE
|
||||
project-lifecycle:
|
||||
status: active
|
||||
bug-fixes-only: false
|
||||
core-maintainers:
|
||||
- github:dgrisonnet
|
||||
- github:mrueg
|
||||
- github:rexagod
|
||||
release-process: https://github.com/kubernetes/kube-state-metrics/blob/main/RELEASE.md
|
||||
contribution-policy:
|
||||
accepts-pull-requests: true
|
||||
accepts-automated-pull-requests: true
|
||||
contributing-policy: https://github.com/kubernetes/kube-state-metrics/blob/main/CONTRIBUTING.md
|
||||
code-of-conduct: https://github.com/kubernetes/kube-state-metrics/blob/main/code-of-conduct.md
|
||||
distribution-points:
|
||||
- https://github.com/kubernetes/kube-state-metrics/releases
|
||||
- https://github.com/kubernetes/k8s.io/blob/main/registry.k8s.io/images/k8s-staging-kube-state-metrics/images.yaml
|
||||
security-contacts:
|
||||
- type: website
|
||||
value: https://github.com/kubernetes/kube-state-metrics/blob/main/SECURITY_CONTACTS
|
||||
vulnerability-reporting:
|
||||
accepts-vulnerability-reports: true
|
||||
security-policy: https://github.com/kubernetes/kube-state-metrics/blob/main/SECURITY.md
|
||||
dependencies:
|
||||
third-party-packages: true
|
||||
dependencies-lists:
|
||||
- https://github.com/kubernetes/kube-state-metrics/blob/main/go.mod
|
||||
- https://github.com/kubernetes/kube-state-metrics/blob/main/Dockerfile
|
||||
env-dependencies-policy:
|
||||
policy-url: https://github.com/kubernetes/kube-state-metrics/blob/main/docs/dependencies-policy.md
|
||||
documentation:
|
||||
- https://github.com/kubernetes/kube-state-metrics/tree/main/docs
|
||||
security-testing:
|
||||
- tool-type: dast
|
||||
tool-name: govulncheck
|
||||
tool-version: latest
|
||||
tool-url: https://go.googlesource.com/vuln
|
||||
tool-rulesets:
|
||||
- built-in
|
||||
integration:
|
||||
ci: true
|
||||
comment: |
|
||||
Detects vulnerabilities as a result of the affected call-paths being invoked directly in the repository, while reducing false positives by ignoring dormant call-paths for package dependencies.
|
|
@ -11,5 +11,6 @@
|
|||
# INSTRUCTIONS AT https://kubernetes.io/security/
|
||||
|
||||
dgrisonnet
|
||||
fpetkovski
|
||||
mrueg
|
||||
rexagod
|
||||
CatherineF-dev
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
# See https://cloud.google.com/cloud-build/docs/build-config
|
||||
timeout: 1800s
|
||||
timeout: 2700s
|
||||
options:
|
||||
substitution_option: ALLOW_LOOSE
|
||||
steps:
|
||||
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20220609-2e4c91eb7e'
|
||||
- name: 'gcr.io/k8s-staging-test-infra/gcb-docker-gcloud:v20241111-71c32dbdcc'
|
||||
entrypoint: make
|
||||
env:
|
||||
- TAG=$_PULL_BASE_REF
|
||||
|
|
|
@ -0,0 +1,19 @@
|
|||
# The purpose of this config is to keep all versions in a single file and make them machine accessible
|
||||
|
||||
# Marks the latest release
|
||||
version: "2.16.0"
|
||||
|
||||
# List at max 5 releases here + the main branch
|
||||
compat:
|
||||
- version: "v2.12.0"
|
||||
kubernetes: "1.29"
|
||||
- version: "v2.13.0"
|
||||
kubernetes: "1.30"
|
||||
- version: "v2.14.0"
|
||||
kubernetes: "1.31"
|
||||
- version: "v2.15.0"
|
||||
kubernetes: "1.32"
|
||||
- version: "v2.16.0"
|
||||
kubernetes: "1.32"
|
||||
- version: "main"
|
||||
kubernetes: "1.33"
|
133
docs/README.md
133
docs/README.md
|
@ -6,10 +6,10 @@ Any contribution to improving this documentation or adding sample usages will be
|
|||
|
||||
## Table of Contents
|
||||
|
||||
- [Metrics Stages](#metrics-stages)
|
||||
- [Exposed Metrics](#exposed-metrics)
|
||||
- [Join Metrics](#join-metrics)
|
||||
- [CLI arguments](#cli-arguments)
|
||||
* [Metrics Stages](#metrics-stages)
|
||||
* [Exposed Metrics](#exposed-metrics)
|
||||
* [Join Metrics](#join-metrics)
|
||||
* [CLI arguments](#cli-arguments)
|
||||
|
||||
## Metrics Stages
|
||||
|
||||
|
@ -32,45 +32,44 @@ See each file for specific documentation about the exposed metrics:
|
|||
|
||||
### Default Resources
|
||||
|
||||
- [CertificateSigningRequest Metrics](certificatesigningrequest-metrics.md)
|
||||
- [ConfigMap Metrics](configmap-metrics.md)
|
||||
- [CronJob Metrics](cronjob-metrics.md)
|
||||
- [DaemonSet Metrics](daemonset-metrics.md)
|
||||
- [Deployment Metrics](deployment-metrics.md)
|
||||
- [Endpoint Metrics](endpoint-metrics.md)
|
||||
- [Horizontal Pod Autoscaler Metrics](horizontalpodautoscaler-metrics.md)
|
||||
- [Ingress Metrics](ingress-metrics.md)
|
||||
- [Job Metrics](job-metrics.md)
|
||||
- [Lease Metrics](lease-metrics.md)
|
||||
- [LimitRange Metrics](limitrange-metrics.md)
|
||||
- [MutatingWebhookConfiguration Metrics](mutatingwebhookconfiguration-metrics.md)
|
||||
- [Namespace Metrics](namespace-metrics.md)
|
||||
- [NetworkPolicy Metrics](networkpolicy-metrics.md)
|
||||
- [Node Metrics](node-metrics.md)
|
||||
- [PersistentVolume Metrics](persistentvolume-metrics.md)
|
||||
- [PersistentVolumeClaim Metrics](persistentvolumeclaim-metrics.md)
|
||||
- [Pod Disruption Budget Metrics](poddisruptionbudget-metrics.md)
|
||||
- [Pod Metrics](pod-metrics.md)
|
||||
- [ReplicaSet Metrics](replicaset-metrics.md)
|
||||
- [ReplicationController Metrics](replicationcontroller-metrics.md)
|
||||
- [ResourceQuota Metrics](resourcequota-metrics.md)
|
||||
- [Secret Metrics](secret-metrics.md)
|
||||
- [Service Metrics](service-metrics.md)
|
||||
- [StatefulSet Metrics](statefulset-metrics.md)
|
||||
- [StorageClass Metrics](storageclass-metrics.md)
|
||||
- [ValidatingWebhookConfiguration Metrics](validatingwebhookconfiguration-metrics.md)
|
||||
- [VolumeAttachment Metrics](volumeattachment-metrics.md)
|
||||
* [CertificateSigningRequest Metrics](metrics/auth/certificatesigningrequest-metrics.md)
|
||||
* [ConfigMap Metrics](metrics/storage/configmap-metrics.md)
|
||||
* [CronJob Metrics](metrics/workload/cronjob-metrics.md)
|
||||
* [DaemonSet Metrics](metrics/workload/daemonset-metrics.md)
|
||||
* [Deployment Metrics](metrics/workload/deployment-metrics.md)
|
||||
* [Endpoint Metrics](metrics/service/endpoint-metrics.md)
|
||||
* [Horizontal Pod Autoscaler Metrics](metrics/workload/horizontalpodautoscaler-metrics.md)
|
||||
* [Ingress Metrics](metrics/service/ingress-metrics.md)
|
||||
* [Job Metrics](metrics/workload/job-metrics.md)
|
||||
* [Lease Metrics](metrics/cluster/lease-metrics.md)
|
||||
* [LimitRange Metrics](metrics/policy/limitrange-metrics.md)
|
||||
* [MutatingWebhookConfiguration Metrics](metrics/extend/mutatingwebhookconfiguration-metrics.md)
|
||||
* [Namespace Metrics](metrics/cluster/namespace-metrics.md)
|
||||
* [NetworkPolicy Metrics](metrics/policy/networkpolicy-metrics.md)
|
||||
* [Node Metrics](metrics/cluster/node-metrics.md)
|
||||
* [PersistentVolume Metrics](metrics/storage/persistentvolume-metrics.md)
|
||||
* [PersistentVolumeClaim Metrics](metrics/storage/persistentvolumeclaim-metrics.md)
|
||||
* [Pod Disruption Budget Metrics](metrics/policy/poddisruptionbudget-metrics.md)
|
||||
* [Pod Metrics](metrics/workload/pod-metrics.md)
|
||||
* [ReplicaSet Metrics](metrics/workload/replicaset-metrics.md)
|
||||
* [ReplicationController Metrics](metrics/workload/replicationcontroller-metrics.md)
|
||||
* [ResourceQuota Metrics](metrics/policy/resourcequota-metrics.md)
|
||||
* [Secret Metrics](metrics/storage/secret-metrics.md)
|
||||
* [Service Metrics](metrics/service/service-metrics.md)
|
||||
* [StatefulSet Metrics](metrics/workload/statefulset-metrics.md)
|
||||
* [StorageClass Metrics](metrics/storage/storageclass-metrics.md)
|
||||
* [ValidatingWebhookConfiguration Metrics](metrics/extend/validatingwebhookconfiguration-metrics.md)
|
||||
* [VolumeAttachment Metrics](metrics/storage/volumeattachment-metrics.md)
|
||||
|
||||
### Optional Resources
|
||||
|
||||
- [ClusterRole Metrics](clusterrole-metrics.md)
|
||||
- [ClusterRoleBinding Metrics](clusterrolebinding-metrics.md)
|
||||
- [EndpointSlice Metrics](endpointslice-metrics.md)
|
||||
- [IngressClass Metrics](ingressclass-metrics.md)
|
||||
- [Role Metrics](role-metrics.md)
|
||||
- [RoleBinding Metrics](rolebinding-metrics.md)
|
||||
- [ServiceAccount Metrics](serviceaccount-metrics.md)
|
||||
- [VerticalPodAutoscaler Metrics](verticalpodautoscaler-metrics.md)
|
||||
* [ClusterRole Metrics](metrics/cluster/clusterrole-metrics.md)
|
||||
* [ClusterRoleBinding Metrics](metrics/cluster/clusterrolebinding-metrics.md)
|
||||
* [EndpointSlice Metrics](metrics/service/endpointslice-metrics.md)
|
||||
* [IngressClass Metrics](metrics/service/ingressclass-metrics.md)
|
||||
* [Role Metrics](metrics/auth/role-metrics.md)
|
||||
* [RoleBinding Metrics](metrics/auth/rolebinding-metrics.md)
|
||||
* [ServiceAccount Metrics](metrics/auth/serviceaccount-metrics.md)
|
||||
|
||||
## Join Metrics
|
||||
|
||||
|
@ -80,21 +79,67 @@ can be used to extend single metrics output.
|
|||
This example adds `label_release` to the set of default labels of the `kube_pod_status_ready` metric
|
||||
and allows you select or group the metrics by Helm release label:
|
||||
|
||||
```
|
||||
```promql
|
||||
kube_pod_status_ready * on (namespace, pod) group_left(label_release) kube_pod_labels
|
||||
```
|
||||
|
||||
Another useful example would be to query the memory usage of pods by its `phase`, such as `Running`:
|
||||
|
||||
```
|
||||
```promql
|
||||
sum(kube_pod_container_resource_requests{resource="memory"}) by (namespace, pod, node)
|
||||
* on (namespace, pod) group_left() (sum(kube_pod_status_phase{phase="Running"}) by (pod, namespace) == 1)
|
||||
```
|
||||
|
||||
## Metrics from Custom Resources
|
||||
|
||||
See [Custom Resource State Metrics](customresourcestate-metrics.md) for experimental support for custom resources.
|
||||
See [Custom Resource State Metrics](metrics/extend/customresourcestate-metrics.md) for experimental support for custom resources.
|
||||
|
||||
## CLI Arguments
|
||||
|
||||
Additionally, options for `kube-state-metrics` can be passed when executing as a CLI, or in a kubernetes / openshift environment. More information can be found here: [CLI Arguments](cli-arguments.md)
|
||||
Additionally, options for `kube-state-metrics` can be passed when executing as a CLI, or in a kubernetes / openshift environment. More information can be found here: [CLI Arguments](developer/cli-arguments.md)
|
||||
|
||||
## Protecting /metrics endpoints
|
||||
|
||||
Kube-State-Metrics' metrics can contain sensitive information about the state of the cluster, which you as an operator might want to additionally protect from unauthorized access.
|
||||
In order to achieve this, you need to enable the `--auth-filter` flag on kube-state-metrics.
|
||||
With this, kube-state-metrics will only accept authenticated and authorized requests to the /metrics endpoints.
|
||||
Kube-state-metrics uses Kubernetes' RBAC mechanisms for this, so this means that every scrape will trigger a request against the API Server for TokenReview and SubjectAccessReview.
|
||||
The clients scraping the endpoint, need to use a token which can be provided by a ServiceAccount that can be set up the following way:
|
||||
|
||||
A ClusterRole providing access like this:
|
||||
|
||||
```yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRole
|
||||
metadata:
|
||||
name: metrics-reader
|
||||
rules:
|
||||
- nonResourceURLs:
|
||||
- "/metrics"
|
||||
verbs:
|
||||
- get
|
||||
```
|
||||
|
||||
and a matching ClusterRoleBinding
|
||||
|
||||
```yaml
|
||||
apiVersion: rbac.authorization.k8s.io/v1
|
||||
kind: ClusterRoleBinding
|
||||
metadata:
|
||||
name: metrics-reader-rolebinding
|
||||
roleRef:
|
||||
apiGroup: rbac.authorization.k8s.io
|
||||
kind: ClusterRole
|
||||
name: metrics-reader
|
||||
subjects:
|
||||
- kind: ServiceAccount
|
||||
name: YOUR_SERVICE_ACCOUNT
|
||||
namespace: NAMESPACE_OF_THE_SERVICE_ACCOUNT
|
||||
```
|
||||
|
||||
Your client can then use either this ServiceAccount to gather metrics or you can create a token, that can be used to fetch data like this:
|
||||
|
||||
```bash
|
||||
TOKEN=$(kubectl create token YOUR_SERVICE_ACCOUNT -n NAMESPACE_OF_THE_SERVICE_ACCOUNT)
|
||||
curl -H "Authorization: Bearer $TOKEN" KUBE_STATE_METRICS_URL:8080/metrics
|
||||
```
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
# CertificateSigningRequest Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_certificatesigningrequest_annotations | Gauge | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name>| EXPERIMENTAL |
|
||||
| kube_certificatesigningrequest_created| Gauge | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name>| STABLE |
|
||||
| kube_certificatesigningrequest_condition | Gauge | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name> <br> `condition`=<approved\|denied> | STABLE |
|
||||
| kube_certificatesigningrequest_labels | Gauge | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name>| STABLE |
|
||||
| kube_certificatesigningrequest_cert_length | Gauge | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name>| STABLE |
|
|
@ -1,9 +0,0 @@
|
|||
# ClusterRole Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_clusterrole_annotations | Gauge | `clusterrole`=<clusterrole-name> | EXPERIMENTAL
|
||||
| kube_clusterrole_labels | Gauge | `clusterrole`=<clusterrole-name> | EXPERIMENTAL
|
||||
| kube_clusterrole_info | Gauge | `clusterrole`=<clusterrole-name> | EXPERIMENTAL |
|
||||
| kube_clusterrole_created | Gauge | `clusterrole`=<clusterrole-name> | EXPERIMENTAL |
|
||||
| kube_clusterrole_metadata_resource_version | Gauge | `clusterrole`=<clusterrole-name> | EXPERIMENTAL |
|
|
@ -1,9 +0,0 @@
|
|||
# ClusterRoleBinding Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_clusterrolebinding_annotations | Gauge | `clusterrolebinding`=<clusterrolebinding-name> | EXPERIMENTAL
|
||||
| kube_clusterrolebinding_labels | Gauge | `clusterrolebinding`=<clusterrolebinding-name> | EXPERIMENTAL
|
||||
| kube_clusterrolebinding_info | Gauge | `clusterrolebinding`=<clusterrolebinding-name> <br> `roleref_kind`=<role-kind> <br> `roleref_name`=<role-name> | EXPERIMENTAL |
|
||||
| kube_clusterrolebinding_created | Gauge | `clusterrolebinding`=<clusterrolebinding-name> | EXPERIMENTAL |
|
||||
| kube_clusterrolebinding_metadata_resource_version | Gauge | `clusterrolebinding`=<clusterrolebinding-name> | EXPERIMENTAL |
|
|
@ -1,9 +0,0 @@
|
|||
# ConfigMap Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_configmap_annotations | Gauge | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> <br> `annotation_CONFIGMAP_ANNOTATION`=<CONFIGMAP_ANNOTATION> | EXPERIMENTAL
|
||||
| kube_configmap_labels | Gauge | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> <br> `label_CONFIGMAP_LABEL`=<CONFIGMAP_LABEL> | STABLE
|
||||
| kube_configmap_info | Gauge | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> | STABLE |
|
||||
| kube_configmap_created | Gauge | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> | STABLE |
|
||||
| kube_configmap_metadata_resource_version | Gauge | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> | EXPERIMENTAL |
|
|
@ -1,17 +0,0 @@
|
|||
# CronJob Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_cronjob_annotations | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> <br> `annotation_CRONJOB_ANNOTATION`=<CRONJOB_ANNOTATION> | EXPERIMENTAL
|
||||
| kube_cronjob_info | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> <br> `schedule`=<schedule> <br> `concurrency_policy`=<concurrency-policy> | STABLE
|
||||
| kube_cronjob_labels | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> <br> `label_CRONJOB_LABEL`=<CRONJOB_LABEL> | STABLE
|
||||
| kube_cronjob_created | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE
|
||||
| kube_cronjob_next_schedule_time | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE
|
||||
| kube_cronjob_status_active | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE
|
||||
| kube_cronjob_status_last_schedule_time | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE
|
||||
| kube_cronjob_status_last_successful_time | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | EXPERIMENTAL
|
||||
| kube_cronjob_spec_suspend | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE
|
||||
| kube_cronjob_spec_starting_deadline_seconds | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE
|
||||
| kube_cronjob_metadata_resource_version| Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE
|
||||
| kube_cronjob_spec_successful_job_history_limit | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | EXPERIMENTAL
|
||||
| kube_cronjob_spec_failed_job_history_limit | Gauge | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | EXPERIMENTAL
|
|
@ -1,442 +0,0 @@
|
|||
# Custom Resource State Metrics
|
||||
|
||||
This section describes how to add metrics based on the state of a custom resource without writing a custom resource
|
||||
registry and running your own build of KSM.
|
||||
|
||||
## Configuration
|
||||
|
||||
A YAML configuration file described below is required to define your custom resources and the fields to turn into metrics.
|
||||
|
||||
Two flags can be used:
|
||||
|
||||
* `--custom-resource-state-config "inline yaml (see example)"` or
|
||||
* `--custom-resource-state-config-file /path/to/config.yaml`
|
||||
|
||||
If both flags are provided, the inline configuration will take precedence.
|
||||
When multiple entries for the same resource exist, kube-state-metrics will exit with an error.
|
||||
This includes configuration which refers to a different API version.
|
||||
|
||||
In addition to specifying one of `--custom-resource-state-config*` flags, you should also add the custom resource *Kind*s in plural form to the list of exposed resources in the `--resources` flag. If you don't specify `--resources`, then all known custom resources configured in `--custom-resource-state-config*` and all available default kubernetes objects will be taken into account by kube-state-metrics.
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kube-state-metrics
|
||||
namespace: kube-system
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kube-state-metrics
|
||||
args:
|
||||
- --custom-resource-state-config
|
||||
# in YAML files, | allows a multi-line string to be passed as a flag value
|
||||
# see https://yaml-multiline.info
|
||||
- |
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
version: "v1"
|
||||
kind: Foo
|
||||
metrics:
|
||||
- name: active_count
|
||||
help: "Count of active Foo"
|
||||
each:
|
||||
type: Gauge
|
||||
...
|
||||
- --resources=certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,foos,horizontalpodautoscalers,ingresses,jobs,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments,verticalpodautoscalers
|
||||
```
|
||||
|
||||
It's also possible to configure kube-state-metrics to run in a `custom-resource-mode` only. In addition to specifying one of `--custom-resource-state-config*` flags, you could set `--custom-resource-state-only` to `true`.
|
||||
With this configuration only the known custom resources configured in `--custom-resource-state-config*` will be taken into account by kube-state-metrics.
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kube-state-metrics
|
||||
namespace: kube-system
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kube-state-metrics
|
||||
args:
|
||||
- --custom-resource-state-config
|
||||
# in YAML files, | allows a multi-line string to be passed as a flag value
|
||||
# see https://yaml-multiline.info
|
||||
- |
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
version: "v1"
|
||||
kind: Foo
|
||||
metrics:
|
||||
- name: active_count
|
||||
help: "Count of active Foo"
|
||||
each:
|
||||
type: Gauge
|
||||
...
|
||||
- --custom-resource-state-only=true
|
||||
```
|
||||
|
||||
NOTE: The `customresource_group`, `customresource_version`, and `customresource_kind` common labels are reserved, and will be overwritten by the values from the `groupVersionKind` field.
|
||||
|
||||
### Examples
|
||||
|
||||
The examples in this section will use the following custom resource:
|
||||
|
||||
```yaml
|
||||
kind: Foo
|
||||
apiVersion: myteam.io/vl
|
||||
metadata:
|
||||
annotations:
|
||||
bar: baz
|
||||
qux: quxx
|
||||
labels:
|
||||
foo: bar
|
||||
name: foo
|
||||
spec:
|
||||
version: v1.2.3
|
||||
order:
|
||||
- id: 1
|
||||
value: true
|
||||
- id: 3
|
||||
value: false
|
||||
replicas: 1
|
||||
status:
|
||||
phase: Pending
|
||||
active:
|
||||
type-a: 1
|
||||
type-b: 3
|
||||
conditions:
|
||||
- name: a
|
||||
value: 45
|
||||
- name: b
|
||||
value: 66
|
||||
sub:
|
||||
type-a:
|
||||
active: 1
|
||||
ready: 2
|
||||
type-b:
|
||||
active: 3
|
||||
ready: 4
|
||||
uptime: 43.21
|
||||
```
|
||||
|
||||
#### Single Values
|
||||
|
||||
The config:
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
metrics:
|
||||
- name: "uptime"
|
||||
help: "Foo uptime"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, uptime]
|
||||
```
|
||||
|
||||
Produces the metric:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
|
||||
```
|
||||
|
||||
#### Multiple Metrics/Kitchen Sink
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
# labels can be added to all metrics from a resource
|
||||
commonLabels:
|
||||
crd_type: "foo"
|
||||
labelsFromPath:
|
||||
name: [metadata, name]
|
||||
metrics:
|
||||
- name: "ready_count"
|
||||
help: "Number Foo Bars ready"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
# targeting an object or array will produce a metric for each element
|
||||
# labelsFromPath and value are relative to this path
|
||||
path: [status, sub]
|
||||
|
||||
# if path targets an object, the object key will be used as label value
|
||||
# This is not supported for StateSet type as all values will be truthy, which is redundant.
|
||||
labelFromKey: type
|
||||
# label values can be resolved specific to this path
|
||||
labelsFromPath:
|
||||
active: [active]
|
||||
# The actual field to use as metric value. Should be a number, boolean or RFC3339 timestamp string.
|
||||
valueFrom: [ready]
|
||||
commonLabels:
|
||||
custom_metric: "yes"
|
||||
labelsFromPath:
|
||||
# whole objects may be copied into labels by prefixing with "*"
|
||||
# *anything will be copied into labels, with the highest sorted * strings first
|
||||
"*": [metadata, labels]
|
||||
"**": [metadata, annotations]
|
||||
|
||||
# or specific fields may be copied. these fields will always override values from *s
|
||||
name: [metadata, name]
|
||||
foo: [metadata, labels, foo]
|
||||
```
|
||||
|
||||
Produces the following metrics:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_ready_count{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", active="1",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-a"} 2
|
||||
kube_customresource_ready_count{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", active="3",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-b"} 4
|
||||
```
|
||||
|
||||
### Metric types
|
||||
|
||||
The configuration supports three kind of metrics from the [OpenMetrics specification](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md).
|
||||
|
||||
The metric type is specified by the `type` field and its specific configuration at the types specific struct.
|
||||
|
||||
#### Gauge
|
||||
|
||||
> Gauges are current measurements, such as bytes of memory currently used or the number of items in a queue. For gauges the absolute value is what is of interest to a user. [[0]](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#gauge)
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
metrics:
|
||||
- name: "uptime"
|
||||
help: "Foo uptime"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, uptime]
|
||||
```
|
||||
|
||||
Produces the metric:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
|
||||
```
|
||||
|
||||
##### Type conversion and special handling
|
||||
|
||||
Gauges produce values of type float64 but custom resources can be of all kinds of types.
|
||||
Kube-state-metrics performs implicity type conversions for a lot of type.
|
||||
Supported types are:
|
||||
|
||||
* (u)int32/64, int, float32 and byte are cast to float64
|
||||
* `nil` is generally mapped to `0.0` if NilIsZero is `true`. Otherwise it yields an error
|
||||
* for bool `true` is mapped to `1.0` and `false` is mapped to `0.0`
|
||||
* for string the following logic applies
|
||||
* `"true"` and `"yes"` are mapped to `1.0` and `"false"` and `"no"` are mapped to `0.0` (all case insensitive)
|
||||
* RFC3339 times are parsed to float timestamp
|
||||
* finally the string is parsed to float using https://pkg.go.dev/strconv#ParseFloat which should support all common number formats. If that fails an error is yielded
|
||||
|
||||
##### Example for status conditions on Kubernetes Controllers
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
labelsFromPath:
|
||||
name:
|
||||
- metadata
|
||||
- name
|
||||
namespace:
|
||||
- metadata
|
||||
- namespace
|
||||
metrics:
|
||||
- name: "foo_status"
|
||||
help: "status condition "
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, conditions]
|
||||
labelsFromPath:
|
||||
type: ["type"]
|
||||
valueFrom: ["status"]
|
||||
```
|
||||
|
||||
This will work for kubernetes controller CRs which expose status conditions according to the kubernetes api (https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Condition):
|
||||
|
||||
```yaml
|
||||
status:
|
||||
conditions:
|
||||
- lastTransitionTime: "2019-10-22T16:29:31Z"
|
||||
status: "True"
|
||||
type: Ready
|
||||
```
|
||||
|
||||
kube_customresource_foo_status{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", type="Ready"} 1.0
|
||||
|
||||
#### StateSet
|
||||
|
||||
> StateSets represent a series of related boolean values, also called a bitset. If ENUMs need to be encoded this MAY be done via StateSet. [[1]](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#stateset)
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
metrics:
|
||||
- name: "status_phase"
|
||||
help: "Foo status_phase"
|
||||
each:
|
||||
type: StateSet
|
||||
stateSet:
|
||||
labelName: phase
|
||||
path: [status, phase]
|
||||
list: [Pending, Bar, Baz]
|
||||
```
|
||||
|
||||
Metrics of type `StateSet` will generate a metric for each value defined in `list` for each resource.
|
||||
The value will be 1, if the value matches the one in list.
|
||||
|
||||
Produces the metric:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_status_phase{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", phase="Pending"} 1
|
||||
kube_customresource_status_phase{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", phase="Bar"} 0
|
||||
kube_customresource_status_phase{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", phase="Baz"} 0
|
||||
```
|
||||
|
||||
#### Info
|
||||
|
||||
> Info metrics are used to expose textual information which SHOULD NOT change during process lifetime. Common examples are an application's version, revision control commit, and the version of a compiler. [[2]](https://github.com/OpenObservability/OpenMetrics/blob/main/specification/OpenMetrics.md#info)
|
||||
|
||||
Metrics of type `Info` will always have a value of 1.
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
metrics:
|
||||
- name: "version"
|
||||
help: "Foo version"
|
||||
each:
|
||||
type: Info
|
||||
info:
|
||||
labelsFromPath:
|
||||
version: [spec, version]
|
||||
```
|
||||
|
||||
Produces the metric:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_version{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", version="v1.2.3"} 1
|
||||
```
|
||||
|
||||
### Naming
|
||||
|
||||
The default metric names are prefixed to avoid collisions with other metrics.
|
||||
By default, a metric prefix of `kube_` concatenated with your custom resource's group+version+kind is used.
|
||||
You can override this behavior with the `metricNamePrefix` field.
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind: ...
|
||||
metricNamePrefix: myteam_foos
|
||||
metrics:
|
||||
- name: uptime
|
||||
...
|
||||
```
|
||||
|
||||
Produces:
|
||||
```prometheus
|
||||
myteam_foos_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
|
||||
```
|
||||
|
||||
To omit namespace and/or subsystem altogether, set them to the empty string:
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind: ...
|
||||
metricNamePrefix: ""
|
||||
metrics:
|
||||
- name: uptime
|
||||
...
|
||||
```
|
||||
|
||||
Produces:
|
||||
```prometheus
|
||||
uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
|
||||
```
|
||||
|
||||
### Logging
|
||||
|
||||
If a metric path is registered but not found on a custom resource, an error will be logged. For some resources,
|
||||
this may produce a lot of noise. The error log [verbosity][vlog] for a metric or resource can be set with `errorLogV` on
|
||||
the resource or metric:
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind: ...
|
||||
errorLogV: 0 # 0 = default for errors
|
||||
metrics:
|
||||
- name: uptime
|
||||
errorLogV: 10 # only log at high verbosity
|
||||
```
|
||||
|
||||
[vlog]: https://github.com/go-logr/logr#why-v-levels
|
||||
|
||||
### Path Syntax
|
||||
|
||||
Paths are specified as a list of strings. Each string is a path segment, resolved dynamically against the data of the custom resource.
|
||||
If any part of a path is missing, the result is nil.
|
||||
|
||||
Examples:
|
||||
|
||||
```yaml
|
||||
# simple path lookup
|
||||
[spec, replicas] # spec.replicas == 1
|
||||
|
||||
# indexing an array
|
||||
[spec, order, "0", value] # spec.order[0].value = true
|
||||
|
||||
# finding an element in a list by key=value
|
||||
[status, conditions, "[name=a]", value] # status.conditions[0].value = 45
|
||||
|
||||
# if the value to be matched is a number or boolean, the value is compared as a number or boolean
|
||||
[status, conditions, "[value=66]", name] # status.conditions[1].name = "b"
|
||||
```
|
|
@ -1,16 +0,0 @@
|
|||
# DaemonSet Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_daemonset_annotations | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> <br> `annotation_DAEMONSET_ANNOTATION`=<DAEMONSET_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_daemonset_created | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_current_number_scheduled | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_desired_number_scheduled | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_number_available | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_number_misscheduled | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_number_ready | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_number_unavailable | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_observed_generation | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_updated_number_scheduled | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_metadata_generation | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_labels | Gauge | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> <br> `label_DAEMONSET_LABEL`=<DAEMONSET_LABEL> | STABLE |
|
|
@ -0,0 +1,43 @@
|
|||
# Dependencies Policy
|
||||
|
||||
## Purpose
|
||||
|
||||
This policy describes how kube-state-metrics maintainers consume third-party packages.
|
||||
|
||||
## Scope
|
||||
|
||||
This policy applies to all kube-state-metrics maintainers and all third-party packages used in the kube-state-metrics project.
|
||||
|
||||
## Policy
|
||||
|
||||
kube-state-metrics maintainers must follow these guidelines when consuming third-party packages:
|
||||
|
||||
* Only use third-party packages that are necessary for the functionality of kube-state-metrics.
|
||||
* Use the latest version of all third-party packages whenever possible.
|
||||
* Avoid using third-party packages that are known to have security vulnerabilities.
|
||||
* Pin all third-party packages to specific versions in the kube-state-metrics codebase.
|
||||
* Use a dependency management tool, such as Go modules, to manage third-party dependencies.
|
||||
|
||||
## Procedure
|
||||
|
||||
When adding a new third-party package to kube-state-metrics, maintainers must follow these steps:
|
||||
|
||||
1. Evaluate the need for the package. Is it necessary for the functionality of kube-state-metrics?
|
||||
2. Research the package. Is it actively maintained? Does it have a good reputation?
|
||||
3. Choose a version of the package. Use the latest version whenever possible.
|
||||
4. Pin the package to the specific version in the kube-state-metrics codebase.
|
||||
5. Update the kube-state-metrics documentation to reflect the new dependency.
|
||||
|
||||
## Enforcement
|
||||
|
||||
This policy is enforced by the kube-state-metrics maintainers.
|
||||
|
||||
Maintainers are expected to review each other's code changes to ensure that they comply with this policy.
|
||||
|
||||
## Exceptions
|
||||
|
||||
Exceptions to this policy may be granted by the kube-state-metrics project owners on a case-by-case basis.
|
||||
|
||||
## Credits
|
||||
|
||||
This policy was adapted from Kubescape's [Environment Dependencies Policy](https://github.com/kubescape/kubescape/blob/master/docs/environment-dependencies-policy.md).
|
|
@ -1,19 +0,0 @@
|
|||
# Deployment Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_deployment_annotations | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> <br> `annotation_DEPLOYMENT_ANNOTATION`=<DEPLOYMENT_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_deployment_status_replicas | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_replicas_ready | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_replicas_available | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_replicas_unavailable | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_replicas_updated | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_observed_generation | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_condition | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> <br> `condition`=<deployment-condition> <br> `status`=<true\|false\|unknown> | STABLE |
|
||||
| kube_deployment_spec_replicas | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_spec_paused | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_spec_strategy_rollingupdate_max_unavailable | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_spec_strategy_rollingupdate_max_surge | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_metadata_generation | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_labels | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> <br> `label_DEPLOYMENT_LABEL`=<DEPLOYMENT_LABEL> | STABLE |
|
||||
| kube_deployment_created | Gauge | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
|
@ -0,0 +1,72 @@
|
|||
# Kube-State-Metrics - Timeseries best practices
|
||||
|
||||
---
|
||||
|
||||
Author: Manuel Rüger (<manuel@rueg.eu>)
|
||||
|
||||
Date: October 17th 2024
|
||||
|
||||
---
|
||||
|
||||
## Introduction
|
||||
|
||||
Kube-State-Metrics' goal is to provide insights into the state of Kubernetes objects by exposing them as metrics.
|
||||
This document provides guidelines with the goal to create a good user experience when using these metrics.
|
||||
|
||||
Please be aware that this document is introduced in a later stage of the project and there might be metrics that do not follow these best practices.
|
||||
Feel encouraged to report these metrics and provide a pull request to improve them.
|
||||
|
||||
## General best practices
|
||||
|
||||
We follow [Prometheus](https://prometheus.io/docs/practices/naming/) best practices in terms of naming and labeling.
|
||||
|
||||
## Best practices for kube-state-metrics
|
||||
|
||||
### Avoid pre-computation
|
||||
|
||||
kube-state-metrics should expose metrics on an individual object level and avoid any sort of pre-computation unless it is required due to for example high cardinality on objects.
|
||||
We prefer not to add metrics that can be derived from existing raw metrics. For example, we would not want to expose a metric called `kube_pod_total` as it can be computed with `count(kube_pod_info)`.
|
||||
This way kube-state-metrics allows the user to have full control on how they want to use the metrics and gives them flexibility to do specific computation.
|
||||
|
||||
### Static object properties
|
||||
|
||||
An object usually has a stable set of properties that do not change during its lifecycle in Kubernetes.
|
||||
This includes properties like name, namespace, uid etc. that have a 1:1 relationship with the object.
|
||||
It is a good practice to group those together into an `_info` metric.
|
||||
If there is a 1:n relationship (e.g. a list of ports), it should be in a separate metric to avoid generating too many metrics.
|
||||
|
||||
### Dynamic object properties
|
||||
|
||||
An object can also have a dynamic set of properties, which are usually part of the status field.
|
||||
These change during the lifecycle of the object.
|
||||
For example a pod can be in different states like "Pending", "Running" etc.
|
||||
These should be part of a "State Set" that includes labels that identify the object as well as the dynamic property.
|
||||
|
||||
### Linked properties
|
||||
|
||||
If an object contains a substructure that links multiple properties together (e.g. endpoint address and port), those should be reported in the same metric.
|
||||
|
||||
### Optional properties
|
||||
|
||||
Some Kubernetes objects have optional fields. In case there is an optional value, the label should still be exposed, ideally as an empty string.
|
||||
|
||||
### Timestamps
|
||||
|
||||
Timestamps like creation time or modification time should be exposed as a value. The metric should end with `_timestamp_seconds`. The date value is represented in [UNIX epoch seconds](https://en.wikipedia.org/wiki/Unix_time).
|
||||
|
||||
### Cardinality
|
||||
|
||||
Some object properties can cause cardinality issues if they can contain a lot of different values or are linked together with multiple properties that also can change a lot.
|
||||
In this case it is better to limit the number of values that can be exposed within kube-state-metrics by allowing only a few of them and have a default for others.
|
||||
If for example the Kubernetes object contains a status field that contains an error message that can change a lot, it would be better to have a boolean `error="true"` label in case there is an error.
|
||||
If there are some error messages that are worth exposing, those could be exposed and for any other message, a default value could be provided.
|
||||
|
||||
## Stability
|
||||
|
||||
We follow the stability framework derived from Kubernetes, in which we expose experimental and stable metrics.
|
||||
Experimental metrics are recently introduced or expose alpha/beta resources in the Kubernetes API.
|
||||
They can change anytime and should be used with caution.
|
||||
They can be promoted to a stable metric once the object stabilized in the Kubernetes API or they were part of two consecutive releases and haven't observed any changes in them.
|
||||
|
||||
Stable metrics are considered frozen with the exception of new labels being added.
|
||||
A stable metric or a label on a stable metric can be deprecated in release Major.Minor and the earliest point it will be removed is the release Major.Minor+2.
|
|
@ -1,9 +1,8 @@
|
|||
# Kube-State-Metrics - Performance Optimization Proposal
|
||||
|
||||
|
||||
---
|
||||
|
||||
Author: Max Inden (IndenML@gmail.com)
|
||||
Author: Max Inden (<IndenML@gmail.com>)
|
||||
|
||||
Date: 23. July 2018
|
||||
|
||||
|
@ -11,16 +10,14 @@ Target release: v1.5.0
|
|||
|
||||
---
|
||||
|
||||
|
||||
## Glossary
|
||||
|
||||
- kube-state-metrics: “Simple service that listens to the Kubernetes API server
|
||||
* kube-state-metrics: “Simple service that listens to the Kubernetes API server
|
||||
and generates metrics about the state of the objects”
|
||||
|
||||
- Time series: A single line in a /metrics response e.g.
|
||||
* Time series: A single line in a /metrics response e.g.
|
||||
“metric_name{label="value"} 1”
|
||||
|
||||
|
||||
## Problem Statement
|
||||
|
||||
There has been repeated reports of two issues running kube-state-metrics on
|
||||
|
@ -30,7 +27,6 @@ instances dropping the scrape interval request and marking the given time series
|
|||
as stale. Second kube-state-metrics uses a lot of memory and thereby being
|
||||
out-of-memory killed due to low set Kubernetes resource limits.
|
||||
|
||||
|
||||
## Goal
|
||||
|
||||
The goal of this proposal can be split into the following sub-goals ordered by
|
||||
|
@ -40,7 +36,6 @@ their priority:
|
|||
|
||||
2. Decrease overall runtime memory usage
|
||||
|
||||
|
||||
## Status Quo
|
||||
|
||||
Instead of requesting the needed information from the Kubernetes API-Server on
|
||||
|
@ -56,7 +51,6 @@ On a scrape request by e.g. Prometheus on the /metrics endpoint
|
|||
kube-state-metrics calculates the configured time series on demand based on the
|
||||
objects in its cache and converts them to the Prometheus string representation.
|
||||
|
||||
|
||||
## Proposal
|
||||
|
||||
Instead of a full representation of all Kubernetes objects with all its
|
||||
|
@ -64,7 +58,7 @@ properties in memory via the Kubernetes client-go cache, use a map, addressable
|
|||
by the Kubernetes object uuid, containing all time series of that object as a
|
||||
single multi-line string.
|
||||
|
||||
```
|
||||
```go
|
||||
var cache = map[uuid][]byte{}
|
||||
```
|
||||
|
||||
|
@ -82,7 +76,7 @@ On a scrape request on the /metrics endpoint, kube-state-metrics iterates over
|
|||
the cache map and concatenates all time series string blobs into a single
|
||||
string, which is finally passed on as a response.
|
||||
|
||||
```
|
||||
```text
|
||||
+---------------+ +-----------+ +---------------+ +-------------------+
|
||||
| pod_reflector | | pod_store | | pod_collector | | metrics_endpoint |
|
||||
+---------------+ +-----------+ +---------------+ +-------------------+
|
||||
|
@ -122,7 +116,7 @@ string, which is finally passed on as a response.
|
|||
|
||||
Build via [text-diagram](http://weidagang.github.io/text-diagram/)
|
||||
|
||||
```
|
||||
```text
|
||||
object pod_reflector pod_store pod_collector metrics_endpoint
|
||||
|
||||
note left of pod_reflector: new pod p1
|
||||
|
@ -139,10 +133,9 @@ pod_collector -> metrics_endpoint: concat(metrics)
|
|||
|
||||
</details>
|
||||
|
||||
|
||||
## FAQ / Follow up improvements
|
||||
|
||||
- If kube-state-metrics only listens on add, update and delete events, how is it
|
||||
* If kube-state-metrics only listens on add, update and delete events, how is it
|
||||
aware of already existing Kubernetes objects created before kube-state-metrics
|
||||
was started? Leveraging Kubernetes client-go, reflectors can initialize all
|
||||
existing objects before any add, update or delete events. To ensure no events
|
||||
|
@ -151,27 +144,25 @@ pod_collector -> metrics_endpoint: concat(metrics)
|
|||
costs, as Kubernetes client-go already gives decent guarantees on event
|
||||
delivery.
|
||||
|
||||
- What about metadata (HELP and description) in the /metrics output? As a first
|
||||
* What about metadata (HELP and description) in the /metrics output? As a first
|
||||
iteration they would be skipped until we have a better idea on the design.
|
||||
|
||||
- How can the cache map be concurrently accessed? The core golang map
|
||||
* How can the cache map be concurrently accessed? The core golang map
|
||||
implementation is not thread-safe. As a first iteration a simple mutex should
|
||||
be sufficient. Golang's sync.Map might be considered.
|
||||
|
||||
- To solve the problem of out of order events send by the Kubernetes API-Server
|
||||
* To solve the problem of out of order events send by the Kubernetes API-Server
|
||||
to kube-state-metrics, to each blob of time series inside the cache map it can
|
||||
keep the Kubernetes resource version. On add and update events, first compare
|
||||
the resource version of the event with than the resource version in the cache.
|
||||
Only move forward if the former is higher than the latter.
|
||||
|
||||
- In case the memory consumption of the time series string blobs is a problem
|
||||
* In case the memory consumption of the time series string blobs is a problem
|
||||
the following optimization can be considered: Among the time series strings,
|
||||
multiple sub-strings will be heavily duplicated like the metric name. Instead
|
||||
of saving unstructured strings inside the cache map, one can structure them,
|
||||
using pointers to deduplicate e.g. metric names.
|
||||
|
||||
- ...
|
||||
|
||||
- Kube-state-metrics does not make use of all properties of all Kubernetes
|
||||
* Kube-state-metrics does not make use of all properties of all Kubernetes
|
||||
objects. Instead of unmarshalling unused properties, their json struct tags or
|
||||
their Protobuf representation could be removed.
|
||||
|
|
|
@ -19,9 +19,11 @@ spec:
|
|||
- '--apiserver=<APISERVER>'
|
||||
```
|
||||
|
||||
## Available options:
|
||||
## Available options
|
||||
|
||||
[embedmd]:# (../help.txt)
|
||||
<!-- markdownlint-disable blanks-around-fences -->
|
||||
<!-- markdownlint-disable link-image-reference-definitions -->
|
||||
[embedmd]:# (../../help.txt)
|
||||
```txt
|
||||
$ kube-state-metrics -h
|
||||
kube-state-metrics is a simple service that listens to the Kubernetes API server and generates metrics about the state of the objects.
|
||||
|
@ -39,7 +41,10 @@ Flags:
|
|||
--add_dir_header If true, adds the file directory to the header of the log messages
|
||||
--alsologtostderr log to standard error as well as files (no effect when -logtostderr=true)
|
||||
--apiserver string The URL of the apiserver to use as a master
|
||||
--config string Path to the kube-state-metrics options config file
|
||||
--auth-filter If true, requires authentication and authorization through Kubernetes API to access metrics endpoints
|
||||
--auto-gomemlimit Automatically set GOMEMLIMIT to match container or system memory limit. (experimental)
|
||||
--auto-gomemlimit-ratio float The ratio of reserved GOMEMLIMIT memory to the detected maximum container or system memory. (experimental) (default 0.9)
|
||||
--config string Path to the kube-state-metrics options config YAML file. If this flag is set, the flags defined in the file override the command line flags.
|
||||
--custom-resource-state-config string Inline Custom Resource State Metrics config YAML (experimental)
|
||||
--custom-resource-state-config-file string Path to a Custom Resource State Metrics config file (experimental)
|
||||
--custom-resource-state-only Only provide Custom Resource State metrics (experimental)
|
||||
|
@ -52,30 +57,38 @@ Flags:
|
|||
--log_file string If non-empty, use this log file (no effect when -logtostderr=true)
|
||||
--log_file_max_size uint Defines the maximum size a log file can grow to (no effect when -logtostderr=true). Unit is megabytes. If the value is 0, the maximum file size is unlimited. (default 1800)
|
||||
--logtostderr log to standard error instead of files (default true)
|
||||
--metric-allowlist string Comma-separated list of metrics to be exposed. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
|
||||
--metric-annotations-allowlist string Comma-separated list of Kubernetes annotations keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional annotations provide a list of resource names in their plural form and Kubernetes annotation keys you would like to allow for them (Example: '=namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...)'. A single '*' can be provided per resource instead to allow any annotations, but that has severe performance implications (Example: '=pods=[*]').
|
||||
--metric-denylist string Comma-separated list of metrics not to be enabled. This list comprises of exact metric names and/or regex patterns. The allowlist and denylist are mutually exclusive.
|
||||
--metric-labels-allowlist string Comma-separated list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the metric contains only name and namespace labels. To include additional labels provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'. A single '*' can be provided per resource instead to allow any labels, but that has severe performance implications (Example: '=pods=[*]'). Additionally, an asterisk (*) can be provided as a key, which will resolve to all resources, i.e., assuming '--resources=deployments,pods', '=*=[*]' will resolve to '=deployments=[*],pods=[*]'.
|
||||
--metric-allowlist string Comma-separated list of metrics to be exposed. This list comprises of exact metric names and/or *ECMAScript-based* regex patterns. The allowlist and denylist are mutually exclusive.
|
||||
--metric-annotations-allowlist string Comma-separated list of Kubernetes annotations keys that will be used in the resource' labels metric. By default the annotations metrics are not exposed. To include them, provide a list of resource names in their plural form and Kubernetes annotation keys you would like to allow for them (Example: '=namespaces=[kubernetes.io/team,...],pods=[kubernetes.io/team],...)'. A single '*' can be provided per resource instead to allow any annotations, but that has severe performance implications (Example: '=pods=[*]').
|
||||
--metric-denylist string Comma-separated list of metrics not to be enabled. This list comprises of exact metric names and/or *ECMAScript-based* regex patterns. The allowlist and denylist are mutually exclusive.
|
||||
--metric-labels-allowlist string Comma-separated list of additional Kubernetes label keys that will be used in the resource' labels metric. By default the labels metrics are not exposed. To include them, provide a list of resource names in their plural form and Kubernetes label keys you would like to allow for them (Example: '=namespaces=[k8s-label-1,k8s-label-n,...],pods=[app],...)'. A single '*' can be provided per resource instead to allow any labels, but that has severe performance implications (Example: '=pods=[*]'). Additionally, an asterisk (*) can be provided as a key, which will resolve to all resources, i.e., assuming '--resources=deployments,pods', '=*=[*]' will resolve to '=deployments=[*],pods=[*]'.
|
||||
--metric-opt-in-list string Comma-separated list of metrics which are opt-in and not enabled by default. This is in addition to the metric allow- and denylists
|
||||
--namespaces string Comma-separated list of namespaces to be enabled. Defaults to ""
|
||||
--namespaces-denylist string Comma-separated list of namespaces not to be enabled. If namespaces and namespaces-denylist are both set, only namespaces that are excluded in namespaces-denylist will be used.
|
||||
--node string Name of the node that contains the kube-state-metrics pod. Most likely it should be passed via the downward API. This is used for daemonset sharding. Only available for resources (pod metrics) that support spec.nodeName fieldSelector. This is experimental.
|
||||
--object-limit int The total number of objects to list per resource from the API Server. (experimental)
|
||||
--one_output If true, only write logs to their native severity level (vs also writing to each lower severity level; no effect when -logtostderr=true)
|
||||
--pod string Name of the pod that contains the kube-state-metrics container. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
|
||||
--pod-namespace string Name of the namespace of the pod specified by --pod. When set, it is expected that --pod and --pod-namespace are both set. Most likely this should be passed via the downward API. This is used for auto-detecting sharding. If set, this has preference over statically configured sharding. This is experimental, it may be removed without notice.
|
||||
--port int Port to expose metrics on. (default 8080)
|
||||
--resources string Comma-separated list of Resources to be enabled. Defaults to "certificatesigningrequests,configmaps,cronjobs,daemonsets,deployments,endpoints,horizontalpodautoscalers,ingresses,jobs,leases,limitranges,mutatingwebhookconfigurations,namespaces,networkpolicies,nodes,persistentvolumeclaims,persistentvolumes,poddisruptionbudgets,pods,replicasets,replicationcontrollers,resourcequotas,secrets,services,statefulsets,storageclasses,validatingwebhookconfigurations,volumeattachments"
|
||||
--server-idle-timeout duration The maximum amount of time to wait for the next request when keep-alives are enabled. Align with the idletimeout of your scrape clients. (default 5m0s)
|
||||
--server-read-header-timeout duration The maximum duration for reading the header of requests. (default 5s)
|
||||
--server-read-timeout duration The maximum duration for reading the entire request, including the body. Align with the scrape interval or timeout of scraping clients. (default 1m0s)
|
||||
--server-write-timeout duration The maximum duration before timing out writes of the response. Align with the scrape interval or timeout of scraping clients.. (default 1m0s)
|
||||
--shard int32 The instances shard nominal (zero indexed) within the total number of shards. (default 0)
|
||||
--skip_headers If true, avoid header prefixes in the log messages
|
||||
--skip_log_headers If true, avoid headers when opening log files (no effect when -logtostderr=true)
|
||||
--stderrthreshold severity logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=false) (default 2)
|
||||
--stderrthreshold severity logs at or above this threshold go to stderr when writing to files and stderr (no effect when -logtostderr=true or -alsologtostderr=true) (default 2)
|
||||
--telemetry-host string Host to expose kube-state-metrics self metrics on. (default "::")
|
||||
--telemetry-port int Port to expose kube-state-metrics self metrics on. (default 8081)
|
||||
--tls-config string Path to the TLS configuration file
|
||||
--total-shards int The total number of shards. Sharding is disabled when total shards is set to 1. (default 1)
|
||||
--track-unscheduled-pods This configuration is used in conjunction with node configuration. When this configuration is true, node configuration is empty and the metric of unscheduled pods is fetched from the Kubernetes API Server. This is experimental.
|
||||
--use-apiserver-cache Sets resourceVersion=0 for ListWatch requests, using cached resources from the apiserver instead of an etcd quorum read.
|
||||
-v, --v Level number for the log level verbosity
|
||||
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
|
||||
|
||||
Use "kube-state-metrics [command] --help" for more information about a command.
|
||||
```
|
||||
<!-- markdownlint-enable link-image-reference-definitions -->
|
||||
<!-- markdownlint-enable blanks-around-fences -->
|
|
@ -1,33 +1,32 @@
|
|||
# Developer Guide
|
||||
# Developer Guide
|
||||
|
||||
This developer guide documentation is intended to assist all contributors in various code contributions.
|
||||
Any contribution to improving this documentation will be appreciated.
|
||||
|
||||
## Table of Contents
|
||||
|
||||
- [Add New Kubernetes Resource Metric Collector](#add-new-kubernetes-resource-metric-collector)
|
||||
- [Add New Metrics](#add-new-metrics)
|
||||
* [Add New Kubernetes Resource Metric Collector](#add-new-kubernetes-resource-metric-collector)
|
||||
* [Add New Metrics](#add-new-metrics)
|
||||
|
||||
### Add New Kubernetes Resource Metric Collector
|
||||
|
||||
The following steps are needed to introduce a new resource and its respective resource metrics.
|
||||
|
||||
- Reference your new resource(s) to the [docs/README.md](https://github.com/kubernetes/kube-state-metrics/blob/main/docs/README.md#exposed-metrics).
|
||||
- Reference your new resource(s) in the [docs/cli-arguments.md](https://github.com/kubernetes/kube-state-metrics/blob/main/docs/cli-arguments.md#available-options) as part of the `--resources` flag.
|
||||
- Create a new `<name-of-resource>.md` in the [docs](https://github.com/kubernetes/kube-state-metrics/tree/main/docs) directory to provide documentation on the resource(s) and metrics you implemented. Follow the formatting of all other resources.
|
||||
- Add the resource(s) you are representing to the [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](https://github.com/kubernetes/kube-state-metrics/blob/main/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet) under the appropriate `apiGroup` using the `verbs`: `list` and `watch`.
|
||||
- Run `make examples/standard`, this should re-generate [examples/standard/cluster-role.yaml](https://github.com/kubernetes/kube-state-metrics/blob/main/examples/standard/cluster-role.yaml) with the resource(s) added to [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](https://github.com/kubernetes/kube-state-metrics/blob/main/jsonnet/kube-state-metrics/kube-state-metrics.libsonnet).
|
||||
- Reference and add build functions for the new resource(s) in [internal/store/builder.go](https://github.com/kubernetes/kube-state-metrics/blob/main/internal/store/builder.go).
|
||||
- Reference the new resource in [pkg/options/resource.go](https://github.com/kubernetes/kube-state-metrics/blob/main/pkg/options/resource.go).
|
||||
- Add a sample Kubernetes manifest to be used by tests in the [tests/manifests/](https://github.com/kubernetes/kube-state-metrics/tree/main/tests/manifests) directory.
|
||||
- Lastly, and most importantly, actually implement your new resource(s) and its test binary in [internal/store](https://github.com/kubernetes/kube-state-metrics/tree/main/internal/store). Follow the formatting and structure of other resources.
|
||||
* Reference your new resource(s) to the [docs/README.md](./../README.md#exposed-metrics).
|
||||
* Reference your new resource(s) in the [docs/developer/cli-arguments.md](./cli-arguments.md#available-options) as part of the `--resources` flag.
|
||||
* Create a new `<name-of-resource>.md` in the [docs](./../docs) directory to provide documentation on the resource(s) and metrics you implemented. Follow the formatting of all other resources.
|
||||
* Add the resource(s) you are representing to the [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](./../../jsonnet/kube-state-metrics/kube-state-metrics.libsonnet) under the appropriate `apiGroup` using the `verbs`: `list` and `watch`.
|
||||
* Run `make examples/standard`, this should re-generate [examples/standard/cluster-role.yaml](./../../examples/standard/cluster-role.yaml) with the resource(s) added to [jsonnet/kube-state-metrics/kube-state-metrics.libsonnet](./../../jsonnet/kube-state-metrics/kube-state-metrics.libsonnet).
|
||||
* Reference and add build functions for the new resource(s) in [internal/store/builder.go](./../../internal/store/builder.go).
|
||||
* Reference the new resource in [pkg/options/resource.go](./../../pkg/options/resource.go).
|
||||
* Add a sample Kubernetes manifest to be used by tests in the [tests/manifests/](./../../tests/manifests) directory.
|
||||
* Lastly, and most importantly, actually implement your new resource(s) and its test binary in [internal/store](./../../internal/store). Follow the formatting and structure of other resources.
|
||||
|
||||
### Add New Metrics
|
||||
|
||||
- Make metrics experimental first when introducing them, refer [#1910](https://github.com/kubernetes/kube-state-metrics/pull/1910) for more information.
|
||||
* Make metrics experimental first when introducing them, refer [#1910](https://github.com/kubernetes/kube-state-metrics/pull/1910) for more information.
|
||||
|
||||
| Metric stability level | |
|
||||
|------------------------|--------------------|
|
||||
| EXPERIMENTAL | basemetrics.ALPHA |
|
||||
| STABLE | basemetrics.STABLE |
|
||||
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
# Endpoint Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_endpoint_annotations | Gauge | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> <br> `annotation_ENDPOINT_ANNOTATION`=<ENDPOINT_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_endpoint_address_not_ready | Gauge | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> | DEPRECATED |
|
||||
| kube_endpoint_address_available | Gauge | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> | DEPRECATED |
|
||||
| kube_endpoint_info | Gauge | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> | STABLE |
|
||||
| kube_endpoint_labels | Gauge | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> <br> `label_ENDPOINT_LABEL`=<ENDPOINT_LABEL> | STABLE |
|
||||
| kube_endpoint_created | Gauge | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> | STABLE |
|
||||
| kube_endpoint_ports | Gauge | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> <br> `port_name`=<endpoint-port-name> <br> `port_protocol`=<endpoint-port-protocol> <br> `port_number`=<endpoint-port-number> | STABLE |
|
||||
| kube_endpoint_address | Gauge | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> <br> `ip`=<endpoint-ip> <br> `ready`=<true if available, false if unavailalbe> | STABLE |
|
|
@ -1,10 +0,0 @@
|
|||
# Endpoint Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_endpointslice_annotations | Gauge | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> <br> `annotation_ENDPOINTSLICE_ANNOTATION`=<ENDPOINTSLICE_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_endpointslice_info | Gauge | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> | EXPERIMENTAL |
|
||||
| kube_endpointslice_ports | Gauge | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> <br> `port_name`=<endpointslice-port-name> <br> `port_protocol`=<endpointslice-port-protocol> <br> `port_number`=<endpointslice-port-number> | EXPERIMENTAL |
|
||||
| kube_endpointslice_endpoints | Gauge | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> <br> `ready`=<endpointslice-ready> <br> `serving`=<endpointslice-serving> <br> `terminating`=<endpointslice-terminating> <br> `hostname`=<endpointslice-hostname> <br> `targetref_kind`=<endpointslice-targetref-kind> <br> `targetref_name`=<endpointslice-targetref-name> <br> `targetref_namespace`=<endpointslice-targetref-namespace> <br> `nodename`=<endpointslice-nodename> <br> `endpoint_zone`=<endpointslice-zone> | EXPERIMENTAL |
|
||||
| kube_endpointslice_labels | Gauge | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> <br> `label_ENDPOINTSLICE_LABEL`=<ENDPOINTSLICE_LABEL> | EXPERIMENTAL |
|
||||
| kube_endpointslice_created | Gauge | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> | EXPERIMENTAL |
|
|
@ -1,15 +0,0 @@
|
|||
# Horizontal Pod Autoscaler Metrics
|
||||
|
||||
| Metric name | Metric type | Labels/tags | Status |
|
||||
| -------------------------------- | ----------- | ------------------------------------------------------------- | ------ |
|
||||
| kube_horizontalpodautoscaler_info | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> <br> `scaletargetref_api_version`=<hpa-target-api-version> <br> `scaletargetref_kind`=<hpa-target-kind> <br> `scaletargetref_name`=<hpa-target-name> | EXPERIMENTAL |
|
||||
| kube_horizontalpodautoscaler_annotations | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | EXPERIMENTAL |
|
||||
| kube_horizontalpodautoscaler_labels | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_metadata_generation | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_spec_max_replicas | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_spec_min_replicas | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_spec_target_metric | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> <br> `metric_name`=<metric-name> <br> `metric_target_type`=<value\|utilization\|average> | EXPERIMENTAL |
|
||||
| kube_horizontalpodautoscaler_status_target_metric | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> <br> `metric_name`=<metric-name> <br> `metric_target_type`=<value\|utilization\|average> | EXPERIMENTAL |
|
||||
| kube_horizontalpodautoscaler_status_condition | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> <br> `condition`=<hpa-condition> <br> `status`=<true\|false\|unknown> | STABLE |
|
||||
| kube_horizontalpodautoscaler_status_current_replicas | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_status_desired_replicas | Gauge | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
|
@ -1,11 +0,0 @@
|
|||
# Ingress Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_ingress_annotations | Gauge | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `annotation_INGRESS_ANNOTATION`=<ANNOTATION_LABEL> | EXPERIMENTAL |
|
||||
| kube_ingress_info | Gauge | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `ingressclass`=<ingress-class> or `_default` if not set | STABLE |
|
||||
| kube_ingress_labels | Gauge | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `label_INGRESS_LABEL`=<INGRESS_LABEL> | STABLE |
|
||||
| kube_ingress_created | Gauge | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> | STABLE |
|
||||
| kube_ingress_metadata_resource_version | Gauge | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> | EXPERIMENTAL |
|
||||
| kube_ingress_path | Gauge | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `host`=<ingress-host> <br> `path`=<ingress-path> <br> `service_name`=<service name for the path> <br> `service_port`=<service port for the path> | STABLE |
|
||||
| kube_ingress_tls | Gauge | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `tls_host`=<tls hostname> <br> `secret`=<tls secret name>| STABLE |
|
|
@ -1,8 +0,0 @@
|
|||
# IngressClass Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_ingressclass_annotations | Gauge | `ingressclass`=<ingressclass-name> <br> `annotation_INGRESSCLASS_ANNOTATION`=<INGRESSCLASS_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_ingressclass_info | Gauge | `ingressclass`=<ingressclass-name> <br> `controller`=<ingress-controller-name> <br> | EXPERIMENTAL |
|
||||
| kube_ingressclass_labels | Gauge | `ingressclass`=<ingressclass-name> <br> `label_INGRESSCLASS_LABEL`=<INGRESSCLASS_LABEL> | EXPERIMENTAL|
|
||||
| kube_ingressclass_created | Gauge | `ingressclass`=<ingressclass-name> | EXPERIMENTAL|
|
|
@ -1,19 +0,0 @@
|
|||
# Job Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_job_annotations | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `annotation_JOB_ANNOTATION`=<JOB_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_job_info | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_labels | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `label_JOB_LABEL`=<JOB_LABEL> | STABLE |
|
||||
| kube_job_owner | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `owner_kind`=<owner kind> <br> `owner_name`=<owner name> <br> `owner_is_controller`=<whether owner is controller> | STABLE |
|
||||
| kube_job_spec_parallelism | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_spec_completions | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_spec_active_deadline_seconds | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_status_active | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_status_succeeded | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_status_failed | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `reason`=<failure reason> | STABLE |
|
||||
| kube_job_status_start_time | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_status_completion_time | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_complete | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `condition`=<true\|false\|unknown> | STABLE |
|
||||
| kube_job_failed | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `condition`=<true\|false\|unknown> | STABLE |
|
||||
| kube_job_created | Gauge | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
|
@ -1,6 +0,0 @@
|
|||
# Lease Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- |-------------------------------------------------------------------------------------------------------------------------------------------| ----------- |
|
||||
| kube_lease_owner | Gauge | `lease`=<lease-name> <br> `owner_kind`=<onwer kind> <br> `owner_name`=<owner name> <br> `namespace` = <namespace> <br> `lease_holder`=<lease holder name>| EXPERIMENTAL |
|
||||
| kube_lease_renew_time | Gauge | `lease`=<lease-name> | EXPERIMENTAL |
|
|
@ -1,6 +0,0 @@
|
|||
# LimitRange Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_limitrange | Gauge | `limitrange`=<limitrange-name> <br> `namespace`=<namespace> <br> `resource`=<ResourceName> <br> `type`=<Pod\|Container\|PersistentVolumeClaim> <br> `constraint`=<constraint>| STABLE |
|
||||
| kube_limitrange_created | Gauge | `limitrange`=<limitrange-name> <br> `namespace`=<namespace> | STABLE |
|
|
@ -0,0 +1,9 @@
|
|||
# CertificateSigningRequest Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_certificatesigningrequest_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name> | EXPERIMENTAL |
|
||||
| kube_certificatesigningrequest_created | Gauge | | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name> | STABLE |
|
||||
| kube_certificatesigningrequest_condition | Gauge | | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name> <br> `condition`=<approved\|denied> | STABLE |
|
||||
| kube_certificatesigningrequest_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name> | STABLE |
|
||||
| kube_certificatesigningrequest_cert_length | Gauge | | `certificatesigningrequest`=<certificatesigningrequest-name> <br> `signer_name`=<certificatesigningrequest-signer-name> | STABLE |
|
|
@ -0,0 +1,9 @@
|
|||
# Role Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ----------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------- | ------------ |
|
||||
| kube_role_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL |
|
||||
| kube_role_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL |
|
||||
| kube_role_info | Gauge | | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL |
|
||||
| kube_role_created | Gauge | | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL |
|
||||
| kube_role_metadata_resource_version | Gauge | | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL |
|
|
@ -0,0 +1,9 @@
|
|||
# RoleBinding Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_rolebinding_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> | EXPERIMENTAL |
|
||||
| kube_rolebinding_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> | EXPERIMENTAL |
|
||||
| kube_rolebinding_info | Gauge | | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> <br> `roleref_kind`=<role-kind> <br> `roleref_name`=<role-name> | EXPERIMENTAL |
|
||||
| kube_rolebinding_created | Gauge | | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> | EXPERIMENTAL |
|
||||
| kube_rolebinding_metadata_resource_version | Gauge | | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> | EXPERIMENTAL |
|
|
@ -0,0 +1,11 @@
|
|||
# ServiceAccount Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|
||||
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_serviceaccount_info | Gauge | Information about a service account | | `namespace`=<serviceaccount-namespace> <br> `serviceaccount`=<serviceaccount-name> <br> `uid`=<serviceaccount-uid> <br> `automount_token`=<serviceaccount-automount-token> | EXPERIMENTAL |
|
||||
| kube_serviceaccount_created | Gauge | Unix creation timestamp | | `namespace`=<serviceaccount-namespace> <br> `serviceaccount`=<serviceaccount-name> <br> `uid`=<serviceaccount-uid> | EXPERIMENTAL |
|
||||
| kube_serviceaccount_deleted | Gauge | Unix deletion timestamp | | `namespace`=<serviceaccount-namespace> <br> `serviceaccount`=<serviceaccount-name> <br> `uid`=<serviceaccount-uid> | EXPERIMENTAL |
|
||||
| kube_serviceaccount_secret | Gauge | Secret being referenced by a service account | | `namespace`=<serviceaccount-namespace> <br> `serviceaccount`=<serviceaccount-name> <br> `uid`=<serviceaccount-uid> <br> `name`=<secret-name> | EXPERIMENTAL |
|
||||
| kube_serviceaccount_image_pull_secret | Gauge | Secret being referenced by a service account for the purpose of pulling images | | `namespace`=<serviceaccount-namespace> <br> `serviceaccount`=<serviceaccount-name> <br> `uid`=<serviceaccount-uid> <br> `name`=<secret-name> | EXPERIMENTAL |
|
||||
| kube_serviceaccount_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `namespace`=<serviceaccount-namespace> <br> `serviceaccount`=<serviceaccount-name> <br> `uid`=<serviceaccount-uid> <br> `annotation_SERVICE_ACCOUNT_ANNOTATION`=<SERVICE_ACCOUNT_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_serviceaccount_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `namespace`=<serviceaccount-namespace> <br> `serviceaccount`=<serviceaccount-name> <br> `uid`=<serviceaccount-uid> <br> `label_SERVICE_ACCOUNT_LABEL`=<SERVICE_ACCOUNT_LABEL> | EXPERIMENTAL |
|
|
@ -0,0 +1,9 @@
|
|||
# ClusterRole Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------- | ------------ |
|
||||
| kube_clusterrole_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `clusterrole`=<clusterrole-name> | EXPERIMENTAL |
|
||||
| kube_clusterrole_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `clusterrole`=<clusterrole-name> | EXPERIMENTAL |
|
||||
| kube_clusterrole_info | Gauge | | `clusterrole`=<clusterrole-name> | EXPERIMENTAL |
|
||||
| kube_clusterrole_created | Gauge | | `clusterrole`=<clusterrole-name> | EXPERIMENTAL |
|
||||
| kube_clusterrole_metadata_resource_version | Gauge | | `clusterrole`=<clusterrole-name> | EXPERIMENTAL |
|
|
@ -0,0 +1,9 @@
|
|||
# ClusterRoleBinding Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_clusterrolebinding_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `clusterrolebinding`=<clusterrolebinding-name> | EXPERIMENTAL |
|
||||
| kube_clusterrolebinding_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `clusterrolebinding`=<clusterrolebinding-name> | EXPERIMENTAL |
|
||||
| kube_clusterrolebinding_info | Gauge | | `clusterrolebinding`=<clusterrolebinding-name> <br> `roleref_kind`=<role-kind> <br> `roleref_name`=<role-name> | EXPERIMENTAL |
|
||||
| kube_clusterrolebinding_created | Gauge | | `clusterrolebinding`=<clusterrolebinding-name> | EXPERIMENTAL |
|
||||
| kube_clusterrolebinding_metadata_resource_version | Gauge | | `clusterrolebinding`=<clusterrolebinding-name> | EXPERIMENTAL |
|
|
@ -0,0 +1,6 @@
|
|||
# Lease Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| --------------------- | ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------- |
|
||||
| kube_lease_owner | Gauge | | `lease`=<lease-name> <br> `owner_kind`=<onwer kind> <br> `owner_name`=<owner name> <br> `namespace` = <namespace> <br> `lease_holder`=<lease holder name> | EXPERIMENTAL |
|
||||
| kube_lease_renew_time | Gauge | | `lease`=<lease-name> <br> `namespace` = <namespace> | EXPERIMENTAL |
|
|
@ -0,0 +1,9 @@
|
|||
# Namespace Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_namespace_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `namespace`=<namespace-name> <br> `label_NS_ANNOTATION`=<NS_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_namespace_created | Gauge | | `namespace`=<namespace-name> | STABLE |
|
||||
| kube_namespace_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `namespace`=<namespace-name> <br> `label_NS_LABEL`=<NS_LABEL> | STABLE |
|
||||
| kube_namespace_status_condition | Gauge | | `namespace`=<namespace-name> <br> `condition`=<NamespaceDeletionDiscoveryFailure\|NamespaceDeletionContentFailure\|NamespaceDeletionGroupVersionParsingFailure> <br> `status`=<true\|false\|unknown> | EXPERIMENTAL |
|
||||
| kube_namespace_status_phase | Gauge | | `namespace`=<namespace-name> <br> `phase`=<Active\|Terminating> | STABLE |
|
|
@ -0,0 +1,16 @@
|
|||
# Node Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|
||||
| ---------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_node_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `node`=<node-address> <br> `annotation_NODE_ANNOTATION`=<NODE_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_node_info | Gauge | Information about a cluster node | | `node`=<node-address> <br> `kernel_version`=<kernel-version> <br> `os_image`=<os-image-name> <br> `container_runtime_version`=<container-runtime-and-version-combination> <br> `kubelet_version`=<kubelet-version> <br> `kubeproxy_version`=<deprecated> <br> `pod_cidr`=<pod-cidr> <br> `provider_id`=<provider-id> <br> `system_uuid`=<system-uuid> <br> `internal_ip`=<internal-ip> | STABLE |
|
||||
| kube_node_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `node`=<node-address> <br> `label_NODE_LABEL`=<NODE_LABEL> | STABLE |
|
||||
| kube_node_role | Gauge | The role of a cluster node | | `node`=<node-address> <br> `role`=<NODE_ROLE> | EXPERIMENTAL |
|
||||
| kube_node_spec_unschedulable | Gauge | Whether a node can schedule new pods | | `node`=<node-address> | STABLE |
|
||||
| kube_node_spec_taint | Gauge | The taint of a cluster node. | | `node`=<node-address> <br> `key`=<taint-key> <br> `value=`<taint-value> <br> `effect=`<taint-effect> | STABLE |
|
||||
| kube_node_status_capacity | Gauge | The total amount of resources available for a node | `cpu`=<core> <br> `ephemeral_storage`=<byte> <br> `pods`=<integer> <br> `attachable_volumes_*`=<byte> <br> `hugepages_*`=<byte> <br> `memory`=<byte> | `node`=<node-address> <br> `resource`=<resource-name> <br> `unit`=<resource-unit> | STABLE |
|
||||
| kube_node_status_addresses | Gauge | The addresses of a node | | `node`=<node-address> <br> `type`=<address-type> <br> `address`=<address-value> | EXPERIMENTAL |
|
||||
| kube_node_status_allocatable | Gauge | The amount of resources allocatable for pods (after reserving some for system daemons) | `cpu`=<core> <br> `ephemeral_storage`=<byte> <br> `pods`=<integer> <br> `attachable_volumes_*`=<byte> <br> `hugepages_*`=<byte> <br> `memory`=<byte> | `node`=<node-address> <br> `resource`=<resource-name> <br> `unit`=<resource-unit> | STABLE |
|
||||
| kube_node_status_condition | Gauge | The condition of a cluster node | | `node`=<node-address> <br> `condition`=<node-condition> <br> `status`=<true\|false\|unknown> | STABLE |
|
||||
| kube_node_created | Gauge | Unix creation timestamp | seconds | `node`=<node-address> | STABLE |
|
||||
| kube_node_deletion_timestamp | Gauge | Unix deletion timestamp | seconds | `node`=<node-address> | EXPERIMENTAL |
|
|
@ -0,0 +1,852 @@
|
|||
# Custom Resource State Metrics
|
||||
|
||||
This section describes how to add metrics based on the state of a custom resource without writing a custom resource
|
||||
registry and running your own build of KSM.
|
||||
|
||||
## Configuration
|
||||
|
||||
A YAML configuration file described below is required to define your custom resources and the fields to turn into metrics.
|
||||
|
||||
Two flags can be used:
|
||||
|
||||
* `--custom-resource-state-config "inline yaml (see example)"` or
|
||||
* `--custom-resource-state-config-file /path/to/config.yaml`
|
||||
|
||||
If both flags are provided, the inline configuration will take precedence.
|
||||
When multiple entries for the same resource exist, kube-state-metrics will exit with an error.
|
||||
This includes configuration which refers to a different API version.
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kube-state-metrics
|
||||
namespace: kube-system
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kube-state-metrics
|
||||
args:
|
||||
- --custom-resource-state-config
|
||||
# in YAML files, | allows a multi-line string to be passed as a flag value
|
||||
# see https://yaml-multiline.info
|
||||
- |
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
version: "v1"
|
||||
kind: Foo
|
||||
metrics:
|
||||
- name: active_count
|
||||
help: "Count of active Foo"
|
||||
each:
|
||||
type: Gauge
|
||||
...
|
||||
```
|
||||
|
||||
It's also possible to configure kube-state-metrics to run in a `custom-resource-mode` only. In addition to specifying one of `--custom-resource-state-config*` flags, you could set `--custom-resource-state-only` to `true`.
|
||||
With this configuration only the known custom resources configured in `--custom-resource-state-config*` will be taken into account by kube-state-metrics.
|
||||
|
||||
```yaml
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: kube-state-metrics
|
||||
namespace: kube-system
|
||||
spec:
|
||||
template:
|
||||
spec:
|
||||
containers:
|
||||
- name: kube-state-metrics
|
||||
args:
|
||||
- --custom-resource-state-config
|
||||
# in YAML files, | allows a multi-line string to be passed as a flag value
|
||||
# see https://yaml-multiline.info
|
||||
- |
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
version: "v1"
|
||||
kind: Foo
|
||||
metrics:
|
||||
- name: active_count
|
||||
help: "Count of active Foo"
|
||||
each:
|
||||
type: Gauge
|
||||
...
|
||||
- --custom-resource-state-only=true
|
||||
```
|
||||
|
||||
NOTE: The `customresource_group`, `customresource_version`, and `customresource_kind` common labels are reserved, and will be overwritten by the values from the `groupVersionKind` field.
|
||||
|
||||
### RBAC-enabled Clusters
|
||||
|
||||
Please be aware that kube-state-metrics needs list and watch permissions granted to `customresourcedefinitions.apiextensions.k8s.io` as well as to the resources you want to gather metrics from.
|
||||
|
||||
### Examples
|
||||
|
||||
The examples in this section will use the following custom resource:
|
||||
|
||||
```yaml
|
||||
kind: Foo
|
||||
apiVersion: myteam.io/vl
|
||||
metadata:
|
||||
annotations:
|
||||
bar: baz
|
||||
qux: quxx
|
||||
labels:
|
||||
foo: bar
|
||||
name: foo
|
||||
spec:
|
||||
version: v1.2.3
|
||||
order:
|
||||
- id: 1
|
||||
value: true
|
||||
- id: 3
|
||||
value: false
|
||||
replicas: 1
|
||||
refs:
|
||||
- my_other_foo
|
||||
- foo_2
|
||||
- foo_with_extensions
|
||||
status:
|
||||
phase: Pending
|
||||
active:
|
||||
type-a: 1
|
||||
type-b: 3
|
||||
conditions:
|
||||
- name: a
|
||||
value: 45
|
||||
- name: b
|
||||
value: 66
|
||||
sub:
|
||||
type-a:
|
||||
active: 1
|
||||
ready: 2
|
||||
type-b:
|
||||
active: 3
|
||||
ready: 4
|
||||
uptime: 43.21
|
||||
```
|
||||
|
||||
#### Single Values
|
||||
|
||||
The config:
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
metrics:
|
||||
- name: "uptime"
|
||||
help: "Foo uptime"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, uptime]
|
||||
```
|
||||
|
||||
Produces the metric:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
|
||||
```
|
||||
|
||||
#### Multiple Metrics/Kitchen Sink
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
# labels can be added to all metrics from a resource
|
||||
commonLabels:
|
||||
crd_type: "foo"
|
||||
labelsFromPath:
|
||||
name: [metadata, name]
|
||||
metrics:
|
||||
- name: "ready_count"
|
||||
help: "Number Foo Bars ready"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
# targeting an object or array will produce a metric for each element
|
||||
# labelsFromPath and value are relative to this path
|
||||
path: [status, sub]
|
||||
|
||||
# if path targets an object, the object key will be used as label value
|
||||
# This is not supported for StateSet type as all values will be truthy, which is redundant.
|
||||
labelFromKey: type
|
||||
# label values can be resolved specific to this path
|
||||
labelsFromPath:
|
||||
active: [active]
|
||||
# The actual field to use as metric value. Should be a number, boolean or RFC3339 timestamp string.
|
||||
valueFrom: [ready]
|
||||
commonLabels:
|
||||
custom_metric: "yes"
|
||||
labelsFromPath:
|
||||
# whole objects may be copied into labels by prefixing with "*"
|
||||
# *anything will be copied into labels, with the highest sorted * strings first
|
||||
"*": [metadata, labels]
|
||||
# a prefix before the asterisk will be used as a label prefix
|
||||
"lorem_*": [metadata, annotations]
|
||||
"**": [metadata, annotations]
|
||||
|
||||
# or specific fields may be copied. these fields will always override values from *s
|
||||
name: [metadata, name]
|
||||
foo: [metadata, labels, foo]
|
||||
```
|
||||
|
||||
Produces the following metrics:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_ready_count{customresource_group="myteam.io", customresource_kind="Foo",
|
||||
customresource_version="v1", active="1",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-a",
|
||||
lorem_bar="baz",lorem_qux="quxx",} 2
|
||||
kube_customresource_ready_count{customresource_group="myteam.io", customresource_kind="Foo",
|
||||
customresource_version="v1", active="3",custom_metric="yes",foo="bar",name="foo",bar="baz",qux="quxx",type="type-b",
|
||||
lorem_bar="baz",lorem_qux="quxx",} 4
|
||||
```
|
||||
|
||||
#### Non-map Arrays
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
labelsFromPath:
|
||||
name: [metadata, name]
|
||||
metrics:
|
||||
- name: "ref_info"
|
||||
help: "Reference to other Foo"
|
||||
each:
|
||||
type: Info
|
||||
info:
|
||||
# targeting an array will produce a metric for each element
|
||||
# labelsFromPath and value are relative to this path
|
||||
path: [spec, refs]
|
||||
|
||||
# if path targets a list of values (e.g. strings or numbers, not objects or maps), individual values can
|
||||
# referenced by a label using this syntax
|
||||
labelsFromPath:
|
||||
ref: []
|
||||
```
|
||||
|
||||
Produces the following metrics:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_ref_info{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", name="foo",ref="my_other_foo"} 1
|
||||
kube_customresource_ref_info{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", name="foo",ref="foo_2"} 1
|
||||
kube_customresource_ref_info{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", name="foo",ref="foo_with_extensions"} 1
|
||||
```
|
||||
|
||||
#### Same Metrics with Different Labels
|
||||
|
||||
```yaml
|
||||
recommendation:
|
||||
containerRecommendations:
|
||||
- containerName: consumer
|
||||
lowerBound:
|
||||
cpu: 100m
|
||||
memory: 262144k
|
||||
```
|
||||
|
||||
For example in VPA we have above attributes and we want to have a same metrics for both CPU and Memory, you can use below config:
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: autoscaling.k8s.io
|
||||
kind: "VerticalPodAutoscaler"
|
||||
version: "v1"
|
||||
labelsFromPath:
|
||||
verticalpodautoscaler: [metadata, name]
|
||||
namespace: [metadata, namespace]
|
||||
target_api_version: [apiVersion]
|
||||
target_kind: [spec, targetRef, kind]
|
||||
target_name: [spec, targetRef, name]
|
||||
metrics:
|
||||
# for memory
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound"
|
||||
help: "Minimum memory resources the container can use before the VerticalPodAutoscaler updater evicts it."
|
||||
commonLabels:
|
||||
unit: "byte"
|
||||
resource: "memory"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [lowerBound, memory]
|
||||
# for CPU
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound"
|
||||
help: "Minimum cpu resources the container can use before the VerticalPodAutoscaler updater evicts it."
|
||||
commonLabels:
|
||||
unit: "core"
|
||||
resource: "cpu"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [lowerBound, cpu]
|
||||
```
|
||||
|
||||
Produces the following metrics:
|
||||
|
||||
```prometheus
|
||||
# HELP kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound Minimum memory resources the container can use before the VerticalPodAutoscaler updater evicts it.
|
||||
# TYPE kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound gauge
|
||||
kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{container="consumer",customresource_group="autoscaling.k8s.io",customresource_kind="VerticalPodAutoscaler",customresource_version="v1",namespace="namespace-example",resource="memory",target_api_version="apps/v1",target_kind="Deployment",target_name="target-name-example",unit="byte",verticalpodautoscaler="vpa-example"} 123456
|
||||
# HELP kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound Minimum cpu resources the container can use before the VerticalPodAutoscaler updater evicts it.
|
||||
# TYPE kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound gauge
|
||||
kube_customresource_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound{container="consumer",customresource_group="autoscaling.k8s.io",customresource_kind="VerticalPodAutoscaler",customresource_version="v1",namespace="namespace-example",resource="cpu",target_api_version="apps/v1",target_kind="Deployment",target_name="target-name-example",unit="core",verticalpodautoscaler="vpa-example"} 0.1
|
||||
```
|
||||
|
||||
#### VerticalPodAutoscaler
|
||||
|
||||
In v2.9.0 the `vericalpodautoscalers` resource was removed from the list of default resources. In order to generate metrics for `verticalpodautoscalers`, you can use the following Custom Resource State config:
|
||||
|
||||
```yaml
|
||||
# Using --resource=verticalpodautoscalers, we get the following output:
|
||||
# HELP kube_verticalpodautoscaler_annotations Kubernetes annotations converted to Prometheus labels.
|
||||
# TYPE kube_verticalpodautoscaler_annotations gauge
|
||||
# kube_verticalpodautoscaler_annotations{namespace="default",verticalpodautoscaler="hamster-vpa",target_api_version="apps/v1",target_kind="Deployment",target_name="hamster"} 1
|
||||
# A similar result can be achieved by specifying the following in --custom-resource-state-config:
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: autoscaling.k8s.io
|
||||
kind: "VerticalPodAutoscaler"
|
||||
version: "v1"
|
||||
labelsFromPath:
|
||||
verticalpodautoscaler: [metadata, name]
|
||||
namespace: [metadata, namespace]
|
||||
target_api_version: [apiVersion]
|
||||
target_kind: [spec, targetRef, kind]
|
||||
target_name: [spec, targetRef, name]
|
||||
metrics:
|
||||
- name: "annotations"
|
||||
help: "Kubernetes annotations converted to Prometheus labels."
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [metadata, annotations]
|
||||
# This will output the following metric:
|
||||
# HELP kube_customresource_autoscaling_annotations Kubernetes annotations converted to Prometheus labels.
|
||||
# TYPE kube_customresource_autoscaling_annotations gauge
|
||||
# kube_customresource_autoscaling_annotations{customresource_group="autoscaling.k8s.io", customresource_kind="VerticalPodAutoscaler", customresource_version="v1", namespace="default",target_api_version="autoscaling.k8s.io/v1",target_kind="Deployment",target_name="hamster",verticalpodautoscaler="hamster-vpa"} 123
|
||||
```
|
||||
|
||||
The above configuration was tested on [this](https://github.com/kubernetes/autoscaler/blob/master/vertical-pod-autoscaler/examples/hamster.yaml) VPA configuration, with an added annotation (`foo: 123`).
|
||||
|
||||
#### All VerticalPodAutoscaler Metrics
|
||||
|
||||
As an addition for the above configuration, here's the complete `CustomResourceStateMetrics` spec to re-enable all of the VPA metrics which are removed from the list of the default resources:
|
||||
|
||||
<details>
|
||||
|
||||
<summary>VPA CustomResourceStateMetrics</summary>
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: autoscaling.k8s.io
|
||||
kind: "VerticalPodAutoscaler"
|
||||
version: "v1"
|
||||
labelsFromPath:
|
||||
namespace: [metadata, namespace]
|
||||
target_api_version: [spec, targetRef, apiVersion]
|
||||
target_kind: [spec, targetRef, kind]
|
||||
target_name: [spec, targetRef, name]
|
||||
verticalpodautoscaler: [metadata, name]
|
||||
metricNamePrefix: "kube"
|
||||
metrics:
|
||||
# kube_verticalpodautoscaler_annotations
|
||||
- name: "verticalpodautoscaler_annotations"
|
||||
help: "Kubernetes annotations converted to Prometheus labels."
|
||||
each:
|
||||
type: Info
|
||||
info:
|
||||
labelsFromPath:
|
||||
annotation_*: [metadata, annotations]
|
||||
name: [metadata, name]
|
||||
# kube_verticalpodautoscaler_labels
|
||||
- name: "verticalpodautoscaler_labels"
|
||||
help: "Kubernetes labels converted to Prometheus labels."
|
||||
each:
|
||||
type: Info
|
||||
info:
|
||||
labelsFromPath:
|
||||
label_*: [metadata, labels]
|
||||
name: [metadata, name]
|
||||
# kube_verticalpodautoscaler_spec_updatepolicy_updatemode
|
||||
- name: "verticalpodautoscaler_spec_updatepolicy_updatemode"
|
||||
help: "Update mode of the VerticalPodAutoscaler."
|
||||
each:
|
||||
type: StateSet
|
||||
stateSet:
|
||||
labelName: "update_mode"
|
||||
path: [spec, updatePolicy, updateMode]
|
||||
list: ["Auto", "Initial", "Off", "Recreate"]
|
||||
# Memory kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed_memory
|
||||
- name: "verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed_memory"
|
||||
help: "Minimum memory resources the VerticalPodAutoscaler can set for containers matching the name."
|
||||
commonLabels:
|
||||
unit: "byte"
|
||||
resource: "memory"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [spec, resourcePolicy, containerPolicies]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [minAllowed, memory]
|
||||
# CPU kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed_cpu
|
||||
- name: "verticalpodautoscaler_spec_resourcepolicy_container_policies_minallowed_cpu"
|
||||
help: "Minimum cpu resources the VerticalPodAutoscaler can set for containers matching the name."
|
||||
commonLabels:
|
||||
unit: "core"
|
||||
resource: "cpu"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [spec, resourcePolicy, containerPolicies]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [minAllowed, cpu]
|
||||
# Memory kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed_memory
|
||||
- name: "verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed_memory"
|
||||
help: "Maximum memory resources the VerticalPodAutoscaler can set for containers matching the name."
|
||||
commonLabels:
|
||||
unit: "byte"
|
||||
resource: "memory"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [spec, resourcePolicy, containerPolicies]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [maxAllowed, memory]
|
||||
# CPU kube_verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed_cpu
|
||||
- name: "verticalpodautoscaler_spec_resourcepolicy_container_policies_maxallowed_cpu"
|
||||
help: "Maximum cpu resources the VerticalPodAutoscaler can set for containers matching the name."
|
||||
commonLabels:
|
||||
unit: "core"
|
||||
resource: "cpu"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [spec, resourcePolicy, containerPolicies]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [maxAllowed, cpu]
|
||||
# Memory kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound_memory
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound_memory"
|
||||
help: "Minimum memory resources the container can use before the VerticalPodAutoscaler updater evicts it."
|
||||
commonLabels:
|
||||
unit: "byte"
|
||||
resource: "memory"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [lowerBound, memory]
|
||||
# CPU kube_verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound_cpu
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_lowerbound_cpu"
|
||||
help: "Minimum cpu resources the container can use before the VerticalPodAutoscaler updater evicts it."
|
||||
commonLabels:
|
||||
unit: "core"
|
||||
resource: "cpu"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [lowerBound, cpu]
|
||||
# Memory kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound_memory
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound_memory"
|
||||
help: "Maximum memory resources the container can use before the VerticalPodAutoscaler updater evicts it."
|
||||
commonLabels:
|
||||
unit: "byte"
|
||||
resource: "memory"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [upperBound, memory]
|
||||
# CPU kube_verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound_cpu
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_upperbound_cpu"
|
||||
help: "Maximum cpu resources the container can use before the VerticalPodAutoscaler updater evicts it."
|
||||
commonLabels:
|
||||
unit: "core"
|
||||
resource: "cpu"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [upperBound, cpu]
|
||||
# Memory kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target_memory
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_target_memory"
|
||||
help: "Target memory resources the VerticalPodAutoscaler recommends for the container."
|
||||
commonLabels:
|
||||
unit: "byte"
|
||||
resource: "memory"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [target, memory]
|
||||
# CPU kube_verticalpodautoscaler_status_recommendation_containerrecommendations_target_cpu
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_target_cpu"
|
||||
help: "Target cpu resources the VerticalPodAutoscaler recommends for the container."
|
||||
commonLabels:
|
||||
unit: "core"
|
||||
resource: "cpu"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [target, cpu]
|
||||
# Memory kube_verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget_memory
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget_memory"
|
||||
help: "Target memory resources the VerticalPodAutoscaler recommends for the container ignoring bounds."
|
||||
commonLabels:
|
||||
unit: "byte"
|
||||
resource: "memory"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [uncappedTarget, memory]
|
||||
# CPU kube_verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget_cpu
|
||||
- name: "verticalpodautoscaler_status_recommendation_containerrecommendations_uncappedtarget_cpu"
|
||||
help: "Target memory resources the VerticalPodAutoscaler recommends for the container ignoring bounds."
|
||||
commonLabels:
|
||||
unit: "core"
|
||||
resource: "cpu"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, recommendation, containerRecommendations]
|
||||
labelsFromPath:
|
||||
container: [containerName]
|
||||
valueFrom: [uncappedTarget, cpu]
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
### Metric types
|
||||
|
||||
The configuration supports three kind of metrics from the [OpenMetrics specification](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md).
|
||||
|
||||
The metric type is specified by the `type` field and its specific configuration at the types specific struct.
|
||||
|
||||
#### Gauge
|
||||
|
||||
> Gauges are current measurements, such as bytes of memory currently used or the number of items in a queue. For gauges the absolute value is what is of interest to a user. [[0]](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#gauge)
|
||||
|
||||
Example:
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
metrics:
|
||||
- name: "uptime"
|
||||
help: "Foo uptime"
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, uptime]
|
||||
```
|
||||
|
||||
Produces the metric:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
|
||||
```
|
||||
|
||||
##### Type conversion and special handling
|
||||
|
||||
Gauges produce values of type float64 but custom resources can be of all kinds of types.
|
||||
Kube-state-metrics performs implicit type conversions for a lot of type.
|
||||
Supported types are:
|
||||
|
||||
* (u)int32/64, int, float32 and byte are cast to float64
|
||||
* `nil` is generally mapped to `0.0` if NilIsZero is `true`, otherwise it will throw an error
|
||||
* for bool `true` is mapped to `1.0` and `false` is mapped to `0.0`
|
||||
* for string the following logic applies
|
||||
* `"true"` and `"yes"` are mapped to `1.0`, `"false"`, `"no"` and `"unknown"` are mapped to `0.0` (all case-insensitive)
|
||||
* RFC3339 times are parsed to float timestamp
|
||||
* Quantities like "250m" or "512Gi" are parsed to float using <https://github.com/kubernetes/apimachinery/blob/master/pkg/api/resource/quantity.go>
|
||||
* Percentages ending with a "%" are parsed to float
|
||||
* finally the string is parsed to float using <https://pkg.go.dev/strconv#ParseFloat> which should support all common number formats. If that fails an error is yielded
|
||||
|
||||
##### Example for status conditions on Kubernetes Controllers
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
labelsFromPath:
|
||||
name:
|
||||
- metadata
|
||||
- name
|
||||
namespace:
|
||||
- metadata
|
||||
- namespace
|
||||
metrics:
|
||||
- name: "foo_status"
|
||||
help: "status condition "
|
||||
each:
|
||||
type: Gauge
|
||||
gauge:
|
||||
path: [status, conditions]
|
||||
labelsFromPath:
|
||||
type: ["type"]
|
||||
valueFrom: ["status"]
|
||||
```
|
||||
|
||||
This will work for kubernetes controller CRs which expose status conditions according to the kubernetes api (<https://pkg.go.dev/k8s.io/apimachinery/pkg/apis/meta/v1#Condition>):
|
||||
|
||||
```yaml
|
||||
status:
|
||||
conditions:
|
||||
- lastTransitionTime: "2019-10-22T16:29:31Z"
|
||||
status: "True"
|
||||
type: Ready
|
||||
```
|
||||
|
||||
kube_customresource_foo_status{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", type="Ready"} 1.0
|
||||
|
||||
#### StateSet
|
||||
|
||||
> StateSets represent a series of related boolean values, also called a bitset. If ENUMs need to be encoded this MAY be done via StateSet. [[1]](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#stateset)
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
metrics:
|
||||
- name: "status_phase"
|
||||
help: "Foo status_phase"
|
||||
each:
|
||||
type: StateSet
|
||||
stateSet:
|
||||
labelName: phase
|
||||
path: [status, phase]
|
||||
list: [Pending, Bar, Baz]
|
||||
```
|
||||
|
||||
Metrics of type `StateSet` will generate a metric for each value defined in `list` for each resource.
|
||||
The value will be 1, if the value matches the one in list.
|
||||
|
||||
Produces the metric:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_status_phase{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", phase="Pending"} 1
|
||||
kube_customresource_status_phase{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", phase="Bar"} 0
|
||||
kube_customresource_status_phase{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", phase="Baz"} 0
|
||||
```
|
||||
|
||||
#### Info
|
||||
|
||||
> Info metrics are used to expose textual information which SHOULD NOT change during process lifetime. Common examples are an application's version, revision control commit, and the version of a compiler. [[2]](https://github.com/prometheus/OpenMetrics/blob/v1.0.0/specification/OpenMetrics.md#info)
|
||||
|
||||
Metrics of type `Info` will always have a value of 1.
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: myteam.io
|
||||
kind: "Foo"
|
||||
version: "v1"
|
||||
metrics:
|
||||
- name: "version"
|
||||
help: "Foo version"
|
||||
each:
|
||||
type: Info
|
||||
info:
|
||||
labelsFromPath:
|
||||
version: [spec, version]
|
||||
```
|
||||
|
||||
Produces the metric:
|
||||
|
||||
```prometheus
|
||||
kube_customresource_version{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1", version="v1.2.3"} 1
|
||||
```
|
||||
|
||||
### Naming
|
||||
|
||||
The default metric names are prefixed to avoid collisions with other metrics.
|
||||
By default, a metric prefix of `kube_` concatenated with your custom resource's group+version+kind is used.
|
||||
You can override this behavior with the `metricNamePrefix` field.
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind: ...
|
||||
metricNamePrefix: myteam_foos
|
||||
metrics:
|
||||
- name: uptime
|
||||
# ...
|
||||
```
|
||||
|
||||
Produces:
|
||||
|
||||
```prometheus
|
||||
myteam_foos_uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
|
||||
```
|
||||
|
||||
To omit namespace and/or subsystem altogether, set them to the empty string:
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind: ...
|
||||
metricNamePrefix: ""
|
||||
metrics:
|
||||
- name: uptime
|
||||
# ...
|
||||
```
|
||||
|
||||
Produces:
|
||||
|
||||
```prometheus
|
||||
uptime{customresource_group="myteam.io", customresource_kind="Foo", customresource_version="v1"} 43.21
|
||||
```
|
||||
|
||||
### Logging
|
||||
|
||||
If a metric path is registered but not found on a custom resource, an error will be logged. For some resources,
|
||||
this may produce a lot of noise. The error log [verbosity][vlog] for a metric or resource can be set with `errorLogV` on
|
||||
the resource or metric:
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind: ...
|
||||
errorLogV: 0 # 0 = default for errors
|
||||
metrics:
|
||||
- name: uptime
|
||||
errorLogV: 10 # only log at high verbosity
|
||||
```
|
||||
|
||||
[vlog]: https://github.com/go-logr/logr#why-v-levels
|
||||
|
||||
### Path Syntax
|
||||
|
||||
Paths are specified as a list of strings. Each string is a path segment, resolved dynamically against the data of the custom resource.
|
||||
If any part of a path is missing, the result is nil.
|
||||
|
||||
Examples:
|
||||
|
||||
```yaml
|
||||
# simple path lookup
|
||||
[spec, replicas] # spec.replicas == 1
|
||||
|
||||
# indexing an array
|
||||
[spec, order, "0", value] # spec.order[0].value = true
|
||||
|
||||
# finding an element in a list by key=value
|
||||
[status, conditions, "[name=a]", value] # status.conditions[0].value = 45
|
||||
|
||||
# if the value to be matched is a number or boolean, the value is compared as a number or boolean
|
||||
[status, conditions, "[value=66]", name] # status.conditions[1].name = "b"
|
||||
|
||||
# For generally matching against a field in an object schema, use the following syntax:
|
||||
[metadata, "name=foo"] # if v, ok := metadata[name]; ok && v == "foo" { return v; } else { /* ignore */ }
|
||||
```
|
||||
|
||||
### Wildcard matching of version and kind fields
|
||||
|
||||
The Custom Resource State (CRS hereon) configuration also allows you to monitor all versions and/or kinds that come under a group. It watches
|
||||
the installed CRDs for this purpose. Taking the aforementioned `Foo` object as reference, the configuration below allows
|
||||
you to monitor all objects under all versions *and* all kinds that come under the `myteam.io` group.
|
||||
|
||||
```yaml
|
||||
kind: CustomResourceStateMetrics
|
||||
spec:
|
||||
resources:
|
||||
- groupVersionKind:
|
||||
group: "myteam.io"
|
||||
version: "*" # Set to `v1 to monitor all kinds under `myteam.io/v1`. Wildcard matches all installed versions that come under this group.
|
||||
kind: "*" # Set to `Foo` to monitor all `Foo` objects under the `myteam.io` group (under all versions). Wildcard matches all installed kinds that come under this group (and version, if specified).
|
||||
metrics:
|
||||
- name: "myobject_info"
|
||||
help: "Foo Bar Baz"
|
||||
each:
|
||||
type: Info
|
||||
info:
|
||||
path: [metadata]
|
||||
labelsFromPath:
|
||||
object: [name]
|
||||
namespace: [namespace]
|
||||
```
|
||||
|
||||
The configuration above produces these metrics.
|
||||
|
||||
```yaml
|
||||
kube_customresource_myobject_info{customresource_group="myteam.io",customresource_kind="Foo",customresource_version="v1",namespace="ns",object="foo"} 1
|
||||
kube_customresource_myobject_info{customresource_group="myteam.io",customresource_kind="Bar",customresource_version="v1",namespace="ns",object="bar"} 1
|
||||
```
|
||||
|
||||
#### Note
|
||||
|
||||
* For cases where the GVKs defined in a CRD have multiple versions under a single group for the same kind, as expected, the wildcard value will resolve to *all* versions, but a query for any specific version will return all resources under all versions, in that versions' representation. This basically means that for two such versions `A` and `B`, if a resource exists under `B`, it will reflect in the metrics generated for `A` as well, in addition to any resources of itself, and vice-versa. This logic is based on the [current `list`ing behavior](https://github.com/kubernetes/client-go/issues/1251#issuecomment-1544083071) of the client-go library.
|
||||
* The introduction of this feature further discourages (and discontinues) the use of native objects in the CRS featureset, since these do not have an explicit CRD associated with them, and conflict with internal stores defined specifically for such native resources. Please consider opening an issue or raising a PR if you'd like to expand on the current metric labelsets for them. Also, any such configuration will be ignored, and no metrics will be generated for the same.
|
|
@ -0,0 +1,8 @@
|
|||
# MutatingWebhookConfiguration Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| -------------------------------------------------------------- | ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_mutatingwebhookconfiguration_info | Gauge | | `mutatingwebhookconfiguration`=<mutatingwebhookconfiguration-name> <br> `namespace`=<mutatingwebhookconfiguration-namespace> | EXPERIMENTAL |
|
||||
| kube_mutatingwebhookconfiguration_created | Gauge | | `mutatingwebhookconfiguration`=<mutatingwebhookconfiguration-name> <br> `namespace`=<mutatingwebhookconfiguration-namespace> | EXPERIMENTAL |
|
||||
| kube_mutatingwebhookconfiguration_metadata_resource_version | Gauge | | `mutatingwebhookconfiguration`=<mutatingwebhookconfiguration-name> <br> `namespace`=<mutatingwebhookconfiguration-namespace> | EXPERIMENTAL |
|
||||
| kube_mutatingwebhookconfiguration_webhook_clientconfig_service | Gauge | | `mutatingwebhookconfiguration`=<mutatingwebhookconfiguration-name> <br> `namespace`=<mutatingwebhookconfiguration-namespace> <br> `webhook_name`=<webhook-name> <br> `service_name`=<webhook-service-name> <br> `service_namespace`=<webhook-service-namespace> | EXPERIMENTAL |
|
|
@ -0,0 +1,8 @@
|
|||
# ValidatingWebhookConfiguration Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ---------------------------------------------------------------- | ----------- | ----------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_validatingwebhookconfiguration_info | Gauge | | `validatingwebhookconfiguration`=<validatingwebhookconfiguration-name> <br> `namespace`=<validatingwebhookconfiguration-namespace> | EXPERIMENTAL |
|
||||
| kube_validatingwebhookconfiguration_created | Gauge | | `validatingwebhookconfiguration`=<validatingwebhookconfiguration-name> <br> `namespace`=<validatingwebhookconfiguration-namespace> | EXPERIMENTAL |
|
||||
| kube_validatingwebhookconfiguration_metadata_resource_version | Gauge | | `validatingwebhookconfiguration`=<validatingwebhookconfiguration-name> <br> `namespace`=<validatingwebhookconfiguration-namespace> | EXPERIMENTAL |
|
||||
| kube_validatingwebhookconfiguration_webhook_clientconfig_service | Gauge | | `validatingwebhookconfiguration`=<validatingwebhookconfiguration-name> <br> `namespace`=<validatingwebhookconfiguration-namespace> <br> `webhook_name`=<webhook-name> <br> `service_name`=<webhook-service-name> <br> `service_namespace`=<webhook-service-namespace> | EXPERIMENTAL |
|
|
@ -0,0 +1,6 @@
|
|||
# LimitRange Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ----------------------- | ----------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ |
|
||||
| kube_limitrange | Gauge | | `limitrange`=<limitrange-name> <br> `namespace`=<namespace> <br> `resource`=<ResourceName> <br> `type`=<Pod\|Container\|PersistentVolumeClaim> <br> `constraint`=<constraint> | STABLE |
|
||||
| kube_limitrange_created | Gauge | | `limitrange`=<limitrange-name> <br> `namespace`=<namespace> | STABLE |
|
|
@ -0,0 +1,9 @@
|
|||
# Network Policy Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------- | ------------ |
|
||||
| kube_networkpolicy_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
||||
| kube_networkpolicy_created | Gauge | | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
||||
| kube_networkpolicy_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
||||
| kube_networkpolicy_spec_egress_rules | Gauge | | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
||||
| kube_networkpolicy_spec_ingress_rules | Gauge | | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
|
@ -0,0 +1,12 @@
|
|||
# PodDisruptionBudget Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_poddisruptionbudget_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `poddisruptionbudget`=<poddisruptionbudget-name> <br> `namespace`=<poddisruptionbudget-namespace> <br> `annotation_PODDISRUPTIONBUDGET_ANNOTATION`=<PODDISRUPTIONBUDGET_ANNOATION> | EXPERIMENTAL |
|
||||
| kube_poddisruptionbudget_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `poddisruptionbudget`=<poddisruptionbudget-name> <br> `namespace`=<poddisruptionbudget-namespace> <br> `label_PODDISRUPTIONBUDGET_LABEL`=<PODDISRUPTIONBUDGET_ANNOATION> | EXPERIMENTAL |
|
||||
| kube_poddisruptionbudget_created | Gauge | | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE |
|
||||
| kube_poddisruptionbudget_status_current_healthy | Gauge | | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE |
|
||||
| kube_poddisruptionbudget_status_desired_healthy | Gauge | | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE |
|
||||
| kube_poddisruptionbudget_status_pod_disruptions_allowed | Gauge | | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE |
|
||||
| kube_poddisruptionbudget_status_expected_pods | Gauge | | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE |
|
||||
| kube_poddisruptionbudget_status_observed_generation | Gauge | | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE |
|
|
@ -0,0 +1,8 @@
|
|||
# ResourceQuota Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_resourcequota | Gauge | | `resourcequota`=<quota-name> <br> `namespace`=<namespace> <br> `resource`=<ResourceName> <br> `type`=<quota-type> | STABLE |
|
||||
| kube_resourcequota_created | Gauge | | `resourcequota`=<quota-name> <br> `namespace`=<namespace> | STABLE |
|
||||
| kube_resourcequota_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `resourcequota`=<quota-name> <br> `namespace`=<namespace> <br> `annotation_RESOURCE_QUOTA_ANNOTATION`=<RESOURCE_QUOTA_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_resourcequota_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `resourcequota`=<quota-name> <br> `namespace`=<namespace> <br> `label_RESOURCE_QUOTA_LABEL`=<RESOURCE_QUOTA_LABEL> | EXPERIMENTAL |
|
|
@ -0,0 +1,10 @@
|
|||
# Endpoint Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_endpoint_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> <br> `annotation_ENDPOINT_ANNOTATION`=<ENDPOINT_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_endpoint_info | Gauge | | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> | STABLE |
|
||||
| kube_endpoint_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> <br> `label_ENDPOINT_LABEL`=<ENDPOINT_LABEL> | STABLE |
|
||||
| kube_endpoint_created | Gauge | | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> | STABLE |
|
||||
| kube_endpoint_ports | Gauge | | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> <br> `port_name`=<endpoint-port-name> <br> `port_protocol`=<endpoint-port-protocol> <br> `port_number`=<endpoint-port-number> | STABLE (Deprecated from 2.14.0) |
|
||||
| kube_endpoint_address | Gauge | | `endpoint`=<endpoint-name> <br> `namespace`=<endpoint-namespace> <br> `ip`=<endpoint-ip> <br> `port_name`=<endpoint-port-name> <br> `port_protocol`=<endpoint-port-protocol> <br> `port_number`=<endpoint-port-number>`ready`=<true if available, false if unavailalbe> | STABLE |
|
|
@ -0,0 +1,11 @@
|
|||
# Endpoint Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------ | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_endpointslice_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> <br> `annotation_ENDPOINTSLICE_ANNOTATION`=<ENDPOINTSLICE_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_endpointslice_info | Gauge | | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> | EXPERIMENTAL |
|
||||
| kube_endpointslice_ports | Gauge | | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> <br> `port_name`=<endpointslice-port-name> <br> `port_protocol`=<endpointslice-port-protocol> <br> `port_number`=<endpointslice-port-number> | EXPERIMENTAL |
|
||||
| kube_endpointslice_endpoints | Gauge | | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> <br> `ready`=<endpointslice-ready> <br> `serving`=<endpointslice-serving> <br> `terminating`=<endpointslice-terminating> <br> `hostname`=<endpointslice-hostname> <br> `targetref_kind`=<endpointslice-targetref-kind> <br> `targetref_name`=<endpointslice-targetref-name> <br> `targetref_namespace`=<endpointslice-targetref-namespace> <br> `nodename`=<endpointslice-nodename> <br> `endpoint_zone`=<endpointslice-zone> | EXPERIMENTAL |
|
||||
| kube_endpointslice_endpoints_hints | Gauge | Each line is a hint applied to an endpoint-slice | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> <br> `address`=<endpointslice-address[0]> <br> `for_zone`=<endpointslice-hint> | EXPERIMENTAL |
|
||||
| kube_endpointslice_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> <br> `label_ENDPOINTSLICE_LABEL`=<ENDPOINTSLICE_LABEL> | EXPERIMENTAL |
|
||||
| kube_endpointslice_created | Gauge | | `endpointslice`=<endpointslice-name> <br> `namespace`=<endpointslice-namespace> | EXPERIMENTAL |
|
|
@ -0,0 +1,11 @@
|
|||
# Ingress Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| -------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- |------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| ------------ |
|
||||
| kube_ingress_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `annotation_INGRESS_ANNOTATION`=<ANNOTATION_LABEL> | EXPERIMENTAL |
|
||||
| kube_ingress_info | Gauge | | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `ingressclass`=<ingress-class> or `_default` if not set | STABLE |
|
||||
| kube_ingress_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `label_INGRESS_LABEL`=<INGRESS_LABEL> | STABLE |
|
||||
| kube_ingress_created | Gauge | | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> | STABLE |
|
||||
| kube_ingress_metadata_resource_version | Gauge | | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> | EXPERIMENTAL |
|
||||
| kube_ingress_path | Gauge | | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `host`=<ingress-host> <br> `path`=<ingress-path> <br> `path_type`=<ingress-path type> <br> If path served by Service Backend <br> `service_name`=<service name for the path> <br> `service_port`=<service port for the path> <br> If path served by Resource Backend <br> `resource_api_group`=<resource backend api group> <br> `resource_kind`=<resource backend kind> <br> `resource_name`=<resource backend name> | STABLE |
|
||||
| kube_ingress_tls | Gauge | | `ingress`=<ingress-name> <br> `namespace`=<ingress-namespace> <br> `tls_host`=<tls hostname> <br> `secret`=<tls secret name> | STABLE |
|
|
@ -0,0 +1,8 @@
|
|||
# IngressClass Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ----------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ | ------------ |
|
||||
| kube_ingressclass_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `ingressclass`=<ingressclass-name> <br> `annotation_INGRESSCLASS_ANNOTATION`=<INGRESSCLASS_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_ingressclass_info | Gauge | | `ingressclass`=<ingressclass-name> <br> `controller`=<ingress-controller-name> <br> | EXPERIMENTAL |
|
||||
| kube_ingressclass_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `ingressclass`=<ingressclass-name> <br> `label_INGRESSCLASS_LABEL`=<INGRESSCLASS_LABEL> | EXPERIMENTAL |
|
||||
| kube_ingressclass_created | Gauge | | `ingressclass`=<ingressclass-name> | EXPERIMENTAL |
|
|
@ -0,0 +1,11 @@
|
|||
# Service Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|
||||
| ----------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_service_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `annotation_SERVICE_ANNOTATION`=<SERVICE_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_service_info | Gauge | Information about service | | `service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `cluster_ip`=<service cluster ip> <br> `external_name`=<service external name> <br> `external_traffic_policy`=<service external traffic policy> <br> `load_balancer_ip`=<service load balancer ip> | STABLE |
|
||||
| kube_service_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `label_SERVICE_LABEL`=<SERVICE_LABEL> | STABLE |
|
||||
| kube_service_created | Gauge | Unix creation timestamp | seconds | `service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> | STABLE |
|
||||
| kube_service_spec_type | Gauge | Type about service | | `service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `type`=<ClusterIP\|NodePort\|LoadBalancer\|ExternalName> | STABLE |
|
||||
| kube_service_spec_external_ip | Gauge | Service external ips. One series for each ip | | `service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `external_ip`=<external-ip> | STABLE |
|
||||
| kube_service_status_load_balancer_ingress | Gauge | Service load balancer ingress status | | `service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `ip`=<load-balancer-ingress-ip> <br> `hostname`=<load-balancer-ingress-hostname> | STABLE |
|
|
@ -0,0 +1,9 @@
|
|||
# ConfigMap Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ---------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_configmap_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> <br> `annotation_CONFIGMAP_ANNOTATION`=<CONFIGMAP_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_configmap_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> <br> `label_CONFIGMAP_LABEL`=<CONFIGMAP_LABEL> | STABLE |
|
||||
| kube_configmap_info | Gauge | | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> | STABLE |
|
||||
| kube_configmap_created | Gauge | | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> | STABLE |
|
||||
| kube_configmap_metadata_resource_version | Gauge | | `configmap`=<configmap-name> <br> `namespace`=<configmap-namespace> | EXPERIMENTAL |
|
|
@ -0,0 +1,37 @@
|
|||
# PersistentVolume Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|
||||
|------------------------------------------|-------------|---------------------------------------------------------------------------------------------------------------------------|-------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------|
|
||||
| kube_persistentvolume_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `persistentvolume`=<persistentvolume-name> <br> `annotation_PERSISTENTVOLUME_ANNOTATION`=<PERSISTENTVOLUME_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_persistentvolume_capacity_bytes | Gauge | | | `persistentvolume`=<pv-name> | STABLE |
|
||||
| kube_persistentvolume_status_phase | Gauge | | | `persistentvolume`=<pv-name> <br>`phase`=<Bound\|Failed\|Pending\|Available\|Released> | STABLE |
|
||||
| kube_persistentvolume_claim_ref | Gauge | | | `persistentvolume`=<pv-name> <br>`claim_namespace`=`<namespace>`; <br>`name`=`<name>`; | STABLE |
|
||||
| kube_persistentvolume_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `persistentvolume`=<persistentvolume-name> <br> `label_PERSISTENTVOLUME_LABEL`=<PERSISTENTVOLUME_LABEL> | STABLE |
|
||||
| kube_persistentvolume_info | Gauge | Information about Persistent Volumes | | `persistentvolume`=<pv-name> <br> `storageclass`=<storageclass-name> <br> `gce_persistent_disk_name`=<pd-name> <br> `host_path`=<path-of-a-host-volume> <br> `host_path_type`=<host-mount-type> <br> `ebs_volume_id`=<ebs-volume-id> <br> `azure_disk_name`=<azure-disk-name> <br> `fc_wwids`=<fc-wwids-comma-separated> <br> `fc_lun`=<fc-lun> <br> `fc_target_wwns`=<fc-target-wwns-comma-separated> <br> `iscsi_target_portal`=<iscsi-target-portal> <br> `iscsi_iqn`=<iscsi-iqn> <br> `iscsi_lun`=<iscsi-lun> <br> `iscsi_initiator_name`=<iscsi-initiator-name> <br> `local_path`=<path-of-a-local-volume> <br> `local_fs`=<local-volume-fs-type> <br> `nfs_server`=<nfs-server> <br> `nfs_path`=<nfs-path> <br> `csi_driver`=<csi-driver> <br> `csi_volume_handle`=<csi-volume-handle> <br> `reclaim_policy`=<reclaim-policy> | STABLE |
|
||||
| kube_persistentvolume_created | Gauge | Unix creation timestamp | seconds | `persistentvolume`=<persistentvolume-name> <br> | EXPERIMENTAL |
|
||||
| kube_persistentvolume_deletion_timestamp | Gauge | Unix deletion timestamp | seconds | `persistentvolume`=<persistentvolume-name> <br> | EXPERIMENTAL |
|
||||
| kube_persistentvolume_csi_attributes | Gauge | CSI attributes of the Persistent Volume, disabled by default, manage with [--metric-opt-in-list](../../developer/cli-arguments.md)) | | `persistentvolume`=<persistentvolume-name> <br> `csi_mounter`=<csi-mounter> <br> `csi_map_options`=<csi-map-options> | EXPERIMENTAL |
|
||||
| kube_persistentvolume_volume_mode | Gauge | Volume Mode information for the PersistentVolume. | | `persistentvolume`=<persistentvolume-name> <br>`volumemode`=<volumemode> | EXPERIMENTAL |
|
||||
|
||||
## Useful metrics queries
|
||||
|
||||
### How to retrieve non-standard PV state
|
||||
|
||||
It is not straightforward to get the PV states for certain cases like "Terminating" since it is not stored behind a field in the `PersistentVolume.Status`.
|
||||
|
||||
So to mimic the [logic](https://github.com/kubernetes/kubernetes/blob/v1.27.2/pkg/printers/internalversion/printers.go#L1838) used by the `kubectl` command line, you will need to compose multiple metrics.
|
||||
|
||||
Here is an example of a Prometheus rule that can be used to alert on a PV that has been in the `Terminating` state for more than `5m`.
|
||||
|
||||
```yaml
|
||||
groups:
|
||||
- name: PV state
|
||||
rules:
|
||||
- alert: PVBlockedInTerminatingState
|
||||
expr: kube_persistentvolume_deletion_timestamp * on(persistentvolume) group_left() (kube_persistentvolume_status_phase{phase="Bound"} == 1) > 0
|
||||
for: 5m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: PV {{$labels.persistentvolume}} blocked in Terminating state.
|
||||
```
|
|
@ -0,0 +1,40 @@
|
|||
# PersistentVolumeClaim Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|
||||
| ---------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ |
|
||||
| kube_persistentvolumeclaim_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `namespace`=<persistentvolumeclaim-namespace> <br> `annotation_PERSISTENTVOLUMECLAIM_ANNOTATION`=<PERSISTENTVOLUMECLAIM_ANNOATION> | EXPERIMENTAL |
|
||||
| kube_persistentvolumeclaim_access_mode | Gauge | | | `access_mode`=<persistentvolumeclaim-access-mode> <br>`namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> | STABLE |
|
||||
| kube_persistentvolumeclaim_info | Gauge | | | `namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `storageclass`=<persistentvolumeclaim-storageclassname><br>`volumename`=<volumename><br>`volumemode`=<volumemode> | STABLE |
|
||||
| kube_persistentvolumeclaim_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `namespace`=<persistentvolumeclaim-namespace> <br> `label_PERSISTENTVOLUMECLAIM_LABEL`=<PERSISTENTVOLUMECLAIM_LABEL> | STABLE |
|
||||
| kube_persistentvolumeclaim_resource_requests_storage_bytes | Gauge | | | `namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> | STABLE |
|
||||
| kube_persistentvolumeclaim_status_condition | Gauge | | | `namespace` =<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `type`=<persistentvolumeclaim-condition-type> <br> `status`=<true\false\unknown> | EXPERIMENTAL |
|
||||
| kube_persistentvolumeclaim_status_phase | Gauge | | | `namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `phase`=<Pending\Bound\Lost> | STABLE |
|
||||
| kube_persistentvolumeclaim_created | Gauge | Unix creation timestamp | seconds | `namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> | EXPERIMENTAL |
|
||||
| kube_persistentvolumeclaim_deletion_timestamp | Gauge | Unix deletion timestamp | seconds | `namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> | EXPERIMENTAL |
|
||||
|
||||
Note:
|
||||
|
||||
* An empty string will be used if PVC has no storage class.
|
||||
|
||||
## Useful metrics queries
|
||||
|
||||
### How to retrieve non-standard PVC state
|
||||
|
||||
It is not straightforward to get the PVC states for certain cases like "Terminating" since it is not stored behind a field in the `PersistentVolumeClaim.Status`.
|
||||
|
||||
So to mimic the [logic](https://github.com/kubernetes/kubernetes/blob/v1.27.2/pkg/printers/internalversion/printers.go#L1883) used by the `kubectl` command line, you will need to compose multiple metrics.
|
||||
|
||||
Here is an example of a Prometheus rule that can be used to alert on a PVC that has been in the `Terminating` state for more than `5m`.
|
||||
|
||||
```yaml
|
||||
groups:
|
||||
- name: PVC state
|
||||
rules:
|
||||
- alert: PVCBlockedInTerminatingState
|
||||
expr: kube_persistentvolumeclaim_deletion_timestamp * on(namespace, persistentvolumeclaim) group_left() (kube_persistentvolumeclaim_status_phase{phase="Bound"} == 1) > 0
|
||||
for: 5m
|
||||
labels:
|
||||
severity: warning
|
||||
annotations:
|
||||
summary: PVC {{$labels.namespace}}/{{$labels.persistentvolumeclaim}} blocked in Terminating state.
|
||||
```
|
|
@ -0,0 +1,11 @@
|
|||
# Secret Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_secret_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `secret`=<secret-name> <br> `namespace`=<secret-namespace> <br> `annotations_SECRET_ANNOTATION`=<SECRET_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_secret_info | Gauge | | `secret`=<secret-name> <br> `namespace`=<secret-namespace> | STABLE |
|
||||
| kube_secret_type | Gauge | | `secret`=<secret-name> <br> `namespace`=<secret-namespace> <br> `type`=<secret-type> | STABLE |
|
||||
| kube_secret_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `secret`=<secret-name> <br> `namespace`=<secret-namespace> <br> `label_SECRET_LABEL`=<SECRET_LABEL> | STABLE |
|
||||
| kube_secret_created | Gauge | | `secret`=<secret-name> <br> `namespace`=<secret-namespace> | STABLE |
|
||||
| kube_secret_metadata_resource_version | Gauge | | `secret`=<secret-name> <br> `namespace`=<secret-namespace> | EXPERIMENTAL |
|
||||
| kube_secret_owner | Gauge | | `secret`=<secret-name> <br> `namespace`=<secret-namespace> <br> `owner_kind`=<owner kind> <br> `owner_name`=<owner name> <br> `owner_is_controller`=<whether owner is controller> | EXPERIMENTAL |
|
|
@ -0,0 +1,8 @@
|
|||
# StorageClass Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ----------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_storageclass_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `storageclass`=<storageclass-name> <br> `annotation_STORAGECLASS_ANNOTATION`=<STORAGECLASS_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_storageclass_info | Gauge | | `storageclass`=<storageclass-name> <br> `provisioner`=<storageclass-provisioner> <br> `reclaim_policy`=<storageclass-reclaimPolicy> <br> `volume_binding_mode`=<storageclass-volumeBindingMode> | STABLE |
|
||||
| kube_storageclass_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `storageclass`=<storageclass-name> <br> `label_STORAGECLASS_LABEL`=<STORAGECLASS_LABEL> | STABLE |
|
||||
| kube_storageclass_created | Gauge | | `storageclass`=<storageclass-name> | STABLE |
|
|
@ -0,0 +1,10 @@
|
|||
# VolumeAttachment Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| -------------------------------------------------- | ----------- | --------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_volumeattachment_info | Gauge | | `volumeattachment`=<volumeattachment-name> <br> `attacher`=<attacher-name> <br> `node`=<node-name> | EXPERIMENTAL |
|
||||
| kube_volumeattachment_created | Gauge | | `volumeattachment`=<volumeattachment-name> | EXPERIMENTAL |
|
||||
| kube_volumeattachment_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `volumeattachment`=<volumeattachment-name> <br> `label_VOLUMEATTACHMENT_LABEL`=<VOLUMEATTACHMENT_LABEL> | EXPERIMENTAL |
|
||||
| kube_volumeattachment_spec_source_persistentvolume | Gauge | | `volumeattachment`=<volumeattachment-name> <br> `volumename`=<persistentvolume-name> | EXPERIMENTAL |
|
||||
| kube_volumeattachment_status_attached | Gauge | | `volumeattachment`=<volumeattachment-name> | EXPERIMENTAL |
|
||||
| kube_volumeattachment_status_attachment_metadata | Gauge | | `volumeattachment`=<volumeattachment-name> <br> `metadata_METADATA_KEY`=<METADATA_VALUE> | EXPERIMENTAL |
|
|
@ -0,0 +1,17 @@
|
|||
# CronJob Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_cronjob_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> <br> `annotation_CRONJOB_ANNOTATION`=<CRONJOB_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_cronjob_info | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> <br> `schedule`=<schedule> <br> `concurrency_policy`=<concurrency-policy> <br> `timezone`=<timezone> | STABLE |
|
||||
| kube_cronjob_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> <br> `label_CRONJOB_LABEL`=<CRONJOB_LABEL> | STABLE |
|
||||
| kube_cronjob_created | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE |
|
||||
| kube_cronjob_next_schedule_time | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE |
|
||||
| kube_cronjob_status_active | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE |
|
||||
| kube_cronjob_status_last_schedule_time | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE |
|
||||
| kube_cronjob_status_last_successful_time | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | EXPERIMENTAL |
|
||||
| kube_cronjob_spec_suspend | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE |
|
||||
| kube_cronjob_spec_starting_deadline_seconds | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE |
|
||||
| kube_cronjob_metadata_resource_version | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | STABLE |
|
||||
| kube_cronjob_spec_successful_job_history_limit | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | EXPERIMENTAL |
|
||||
| kube_cronjob_spec_failed_job_history_limit | Gauge | | `cronjob`=<cronjob-name> <br> `namespace`=<cronjob-namespace> | EXPERIMENTAL |
|
|
@ -0,0 +1,16 @@
|
|||
# DaemonSet Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ---------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_daemonset_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> <br> `annotation_DAEMONSET_ANNOTATION`=<DAEMONSET_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_daemonset_created | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_current_number_scheduled | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_desired_number_scheduled | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_number_available | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_number_misscheduled | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_number_ready | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_number_unavailable | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_observed_generation | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_status_updated_number_scheduled | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_metadata_generation | Gauge | | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> | STABLE |
|
||||
| kube_daemonset_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `daemonset`=<daemonset-name> <br> `namespace`=<daemonset-namespace> <br> `label_DAEMONSET_LABEL`=<DAEMONSET_LABEL> | STABLE |
|
|
@ -0,0 +1,19 @@
|
|||
# Deployment Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ----------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_deployment_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> <br> `annotation_DEPLOYMENT_ANNOTATION`=<DEPLOYMENT_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_deployment_status_replicas | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_replicas_ready | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_replicas_available | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_replicas_unavailable | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_replicas_updated | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_observed_generation | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_status_condition | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> <br> `reason`=<deployment-transition-reason> <br> `condition`=<deployment-condition> <br> `status`=<true\|false\|unknown> | STABLE |
|
||||
| kube_deployment_spec_replicas | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_spec_paused | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_spec_strategy_rollingupdate_max_unavailable | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_spec_strategy_rollingupdate_max_surge | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_metadata_generation | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
||||
| kube_deployment_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> <br> `label_DEPLOYMENT_LABEL`=<DEPLOYMENT_LABEL> | STABLE |
|
||||
| kube_deployment_created | Gauge | | `deployment`=<deployment-name> <br> `namespace`=<deployment-namespace> | STABLE |
|
|
@ -0,0 +1,15 @@
|
|||
# Horizontal Pod Autoscaler Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ---------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_horizontalpodautoscaler_info | Gauge | | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> <br> `scaletargetref_api_version`=<hpa-target-api-version> <br> `scaletargetref_kind`=<hpa-target-kind> <br> `scaletargetref_name`=<hpa-target-name> | EXPERIMENTAL |
|
||||
| kube_horizontalpodautoscaler_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | EXPERIMENTAL |
|
||||
| kube_horizontalpodautoscaler_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_metadata_generation | Gauge | | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_spec_max_replicas | Gauge | | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_spec_min_replicas | Gauge | | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_spec_target_metric | Gauge | | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> <br> `metric_name`=<metric-name> <br> `metric_target_type`=<value\|utilization\|average> | EXPERIMENTAL |
|
||||
| kube_horizontalpodautoscaler_status_target_metric | Gauge | | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> <br> `metric_name`=<metric-name> <br> `metric_target_type`=<value\|utilization\|average> | EXPERIMENTAL |
|
||||
| kube_horizontalpodautoscaler_status_condition | Gauge | | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> <br> `condition`=<hpa-condition> <br> `status`=<true\|false\|unknown> | STABLE |
|
||||
| kube_horizontalpodautoscaler_status_current_replicas | Gauge | | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
||||
| kube_horizontalpodautoscaler_status_desired_replicas | Gauge | | `horizontalpodautoscaler`=<hpa-name> <br> `namespace`=<hpa-namespace> | STABLE |
|
|
@ -0,0 +1,20 @@
|
|||
# Job Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_job_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `annotation_JOB_ANNOTATION`=<JOB_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_job_info | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `label_JOB_LABEL`=<JOB_LABEL> | STABLE |
|
||||
| kube_job_owner | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `owner_kind`=<owner kind> <br> `owner_name`=<owner name> <br> `owner_is_controller`=<whether owner is controller> | STABLE |
|
||||
| kube_job_spec_parallelism | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_spec_completions | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_spec_active_deadline_seconds | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_status_active | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_status_succeeded | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_status_failed | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `reason`=<failure reason> | STABLE |
|
||||
| kube_job_status_start_time | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_status_completion_time | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_complete | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `condition`=<true\|false\|unknown> | STABLE |
|
||||
| kube_job_failed | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> <br> `condition`=<true\|false\|unknown> | STABLE |
|
||||
| kube_job_created | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | STABLE |
|
||||
| kube_job_status_suspended | Gauge | | `job_name`=<job-name> <br> `namespace`=<job-namespace> | EXPERIMENTAL |
|
|
@ -0,0 +1,88 @@
|
|||
# Pod Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status | Opt-in |
|
||||
| ----------------------------------------------------- | ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | ------ |
|
||||
| kube_pod_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `annotation_POD_ANNOTATION`=<POD_ANNOTATION> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_info | Gauge | Information about pod | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `host_ip`=<host-ip> <br> `pod_ip`=<pod-ip> <br> `node`=<node-name><br> `created_by_kind`=<created_by_kind><br> `created_by_name`=<created_by_name><br> `uid`=<pod-uid><br> `priority_class`=<priority_class><br> `host_network`=<host_network> | STABLE | - |
|
||||
| kube_pod_ips | Gauge | Pod IP addresses | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `ip`=<pod-ip-address> <br> `ip_family`=<4 OR 6> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_start_time | Gauge | Start time in unix timestamp for a pod | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_completion_time | Gauge | Completion time in unix timestamp for a pod | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_owner | Gauge | Information about the Pod's owner | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `owner_kind`=<owner kind> <br> `owner_name`=<owner name> <br> `owner_is_controller`=<whether owner is controller> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `label_POD_LABEL`=<POD_LABEL> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_nodeselectors | Gauge | Describes the Pod nodeSelectors | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `nodeselector_NODE_SELECTOR`=<NODE_SELECTOR> <br> `uid`=<pod-uid> | EXPERIMENTAL | Opt-in |
|
||||
| kube_pod_status_phase | Gauge | The pods current phase | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `phase`=<Pending\|Running\|Succeeded\|Failed\|Unknown> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_qos_class | Gauge | The pods current qosClass | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `qos_class`=<BestEffort\|Burstable\|Guaranteed> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_status_ready | Gauge | Describes whether the pod is ready to serve requests | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `condition`=<true\|false\|unknown> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_scheduled | Gauge | Describes the status of the scheduling process for the pod | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `condition`=<true\|false\|unknown> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_info | Gauge | Information about a container in a pod | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `image`=<image-name> <br> `image_id`=<image-id> <br> `image_spec`=<image-spec> <br> `container_id`=<containerid> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_waiting | Gauge | Describes whether the container is currently in waiting state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_waiting_reason | Gauge | Describes the reason the container is currently in waiting state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<container-waiting-reason> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_running | Gauge | Describes whether the container is currently in running state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_state_started | Gauge | Start time in unix timestamp for a pod container | seconds | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_terminated | Gauge | Describes whether the container is currently in terminated state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_terminated_reason | Gauge | Describes the reason the container is currently in terminated state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<container-terminated-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_status_last_terminated_reason | Gauge | Describes the last reason the container was in terminated state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<last-terminated-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_status_last_terminated_exitcode | Gauge | Describes the exit code for the last container in terminated state. | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_status_last_terminated_timestamp | Gauge | Last terminated time for a pod container in unix timestamp. | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_status_ready | Gauge | Describes whether the containers readiness check succeeded | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_initialized_time | Gauge | Time when the pod is initialized. | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_status_ready_time | Gauge | Time when pod passed readiness probes. | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_status_container_ready_time | Gauge | Time when the container of the pod entered Ready state. | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_status_restarts_total | Counter | The number of container restarts per container | | `container`=<container-name> <br> `namespace`=<pod-namespace> <br> `pod`=<pod-name> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_resource_requests | Gauge | The number of requested request resource by a container. It is recommended to use the `kube_pod_resource_requests` metric exposed by kube-scheduler instead, as it is more precise. | `cpu`=<core> <br> `memory`=<bytes> | `resource`=<resource-name> <br> `unit`=<resource-unit> <br> `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `node`=< node-name> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_resource_limits | Gauge | The number of requested limit resource by a container. It is recommended to use the `kube_pod_resource_limits` metric exposed by kube-scheduler instead, as it is more precise. | `cpu`=<core> <br> `memory`=<bytes> | `resource`=<resource-name> <br> `unit`=<resource-unit> <br> `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `node`=< node-name> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_overhead_cpu_cores | Gauge | The pod overhead in regards to cpu cores associated with running a pod | core | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_overhead_memory_bytes | Gauge | The pod overhead in regards to memory associated with running a pod | bytes | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_runtimeclass_name_info | Gauge | The runtimeclass associated with the pod | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_created | Gauge | Unix creation timestamp | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_deletion_timestamp | Gauge | Unix deletion timestamp | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_restart_policy | Gauge | Describes the restart policy in use by this pod | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `type`=<Always\|Never\|OnFailure> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_info | Gauge | Information about an init container in a pod | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `image`=<image-name> <br> `image_id`=<image-id> <br> `image_spec`=<image-spec> <br> `container_id`=<containerid> <br> `uid`=<pod-uid> <br> `restart_policy`=<restart-policy> | STABLE | - |
|
||||
| kube_pod_init_container_status_waiting | Gauge | Describes whether the init container is currently in waiting state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_status_waiting_reason | Gauge | Describes the reason the init container is currently in waiting state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<container-waiting-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_init_container_status_running | Gauge | Describes whether the init container is currently in running state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_status_terminated | Gauge | Describes whether the init container is currently in terminated state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_status_terminated_reason | Gauge | Describes the reason the init container is currently in terminated state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<container-terminated-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_init_container_status_last_terminated_reason | Gauge | Describes the last reason the init container was in terminated state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<last-terminated-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_init_container_status_ready | Gauge | Describes whether the init containers readiness check succeeded | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_status_restarts_total | Counter | The number of restarts for the init container | integer | `container`=<container-name> <br> `namespace`=<pod-namespace> <br> `pod`=<pod-name> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_resource_limits | Gauge | The number of CPU cores requested limit by an init container | `cpu`=<core> <br> `memory`=<bytes> | `resource`=<resource-name> <br> `unit`=<resource-unit> <br> `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `node`=< node-name> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_init_container_resource_requests | Gauge | The number of CPU cores requested by an init container | `cpu`=<core> <br> `memory`=<bytes> | `resource`=<resource-name> <br> `unit`=<resource-unit> <br> `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `node`=< node-name> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_spec_volumes_persistentvolumeclaims_info | Gauge | Information about persistentvolumeclaim volumes in a pod | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `volume`=<volume-name> <br> `persistentvolumeclaim`=<persistentvolumeclaim-claimname> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_spec_volumes_persistentvolumeclaims_readonly | Gauge | Describes whether a persistentvolumeclaim is mounted read only | bool | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `volume`=<volume-name> <br> `persistentvolumeclaim`=<persistentvolumeclaim-claimname> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_reason | Gauge | The pod status reasons | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<Evicted\|NodeAffinity\|NodeLost\|Shutdown\|UnexpectedAdmissionError> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_status_scheduled_time | Gauge | Unix timestamp when pod moved into scheduled status | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_unschedulable | Gauge | Describes the unschedulable status for the pod | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_unscheduled_time | Gauge | Unix timestamp when pod moved into unscheduled status | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_tolerations | Gauge | Information about the pod tolerations | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> <br> `key`=<toleration-key> <br> `operator`=<toleration-operator> <br> `value`=<toleration-value> <br> `effect`=<toleration-effect> `toleration_seconds`=<toleration-seconds> | EXPERIMENTAL | - |
|
||||
| kube_pod_service_account | Gauge | The service account for a pod | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> <br> `service_account`=<service_account> | EXPERIMENTAL | - |
|
||||
| kube_pod_scheduler | Gauge | The scheduler for a pod | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> <br> `name`=<scheduler-name> | EXPERIMENTAL | - |
|
||||
|
||||
## Useful metrics queries
|
||||
|
||||
### How to retrieve non-standard Pod state
|
||||
|
||||
It is not straightforward to get the Pod states for certain cases like "Terminating" and "Unknown" since it is not stored behind a field in the `Pod.Status`.
|
||||
|
||||
So to mimic the [logic](https://github.com/kubernetes/kubernetes/blob/v1.17.3/pkg/printers/internalversion/printers.go#L624) used by the `kubectl` command line, you will need to compose multiple metrics.
|
||||
|
||||
For example:
|
||||
|
||||
* To get the list of pods that are in the `Unknown` state, you can run the following PromQL query: `sum(kube_pod_status_phase{phase="Unknown"}) by (namespace, pod) or (count(kube_pod_deletion_timestamp) by (namespace, pod) * sum(kube_pod_status_reason{reason="NodeLost"}) by(namespace, pod))`
|
||||
|
||||
* For Pods in `Terminating` state: `count(kube_pod_deletion_timestamp) by (namespace, pod) * count(kube_pod_status_reason{reason="NodeLost"} == 0) by (namespace, pod)`
|
||||
|
||||
Here is an example of a Prometheus rule that can be used to alert on a Pod that has been in the `Terminating` state for more than `5m`.
|
||||
|
||||
```yaml
|
||||
groups:
|
||||
- name: Pod state
|
||||
rules:
|
||||
- alert: PodsBlockedInTerminatingState
|
||||
expr: count(kube_pod_deletion_timestamp) by (namespace, pod) * count(kube_pod_status_reason{reason="NodeLost"} == 0) by (namespace, pod) > 0
|
||||
for: 5m
|
||||
labels:
|
||||
severity: page
|
||||
annotations:
|
||||
summary: Pod {{$labels.namespace}}/{{$labels.pod}} blocked in Terminating state.
|
||||
```
|
|
@ -0,0 +1,14 @@
|
|||
# ReplicaSet metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| --------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_replicaset_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> <br> `annotation_REPLICASET_ANNOTATION`=<REPLICASET_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_replicaset_status_replicas | Gauge | | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_status_fully_labeled_replicas | Gauge | | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_status_ready_replicas | Gauge | | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_status_observed_generation | Gauge | | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_spec_replicas | Gauge | | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_metadata_generation | Gauge | | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> <br> `label_REPLICASET_LABEL`=<REPLICASET_LABEL> | STABLE |
|
||||
| kube_replicaset_created | Gauge | | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_owner | Gauge | | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> <br> `owner_kind`=<owner kind> <br> `owner_name`=<owner name> <br> `owner_is_controller`=<whether owner is controller> | STABLE |
|
|
@ -0,0 +1,13 @@
|
|||
# ReplicationController metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| -------------------------------------------------------- | ----------- | ----------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------ |
|
||||
| kube_replicationcontroller_status_replicas | Gauge | | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_status_fully_labeled_replicas | Gauge | | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_status_ready_replicas | Gauge | | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_status_available_replicas | Gauge | | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_status_observed_generation | Gauge | | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_spec_replicas | Gauge | | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_metadata_generation | Gauge | | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_created | Gauge | | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_owner | Gauge | | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> <br> `owner_kind`=<owner kind> <br> `owner_name`=<owner name> <br> `owner_is_controller`=<whether owner is controller> | EXPERIMENTAL |
|
|
@ -0,0 +1,19 @@
|
|||
# Stateful Set Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Labels/tags | Status |
|
||||
| ------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ |
|
||||
| kube_statefulset_annotations | Gauge | Kubernetes annotations converted to Prometheus labels controlled via [--metric-annotations-allowlist](../../developer/cli-arguments.md) | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> <br> `annotation_STATEFULSET_ANNOTATION`=<STATEFULSET_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_statefulset_status_replicas | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | STABLE |
|
||||
| kube_statefulset_status_replicas_current | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | STABLE |
|
||||
| kube_statefulset_status_replicas_ready | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | STABLE |
|
||||
| kube_statefulset_status_replicas_available | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | EXPERIMENTAL |
|
||||
| kube_statefulset_status_replicas_updated | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | STABLE |
|
||||
| kube_statefulset_status_observed_generation | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | STABLE |
|
||||
| kube_statefulset_replicas | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | STABLE |
|
||||
| kube_statefulset_ordinals_start | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | STABLE |
|
||||
| kube_statefulset_metadata_generation | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | STABLE |
|
||||
| kube_statefulset_persistentvolumeclaim_retention_policy | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> <br> `when_deleted`=<statefulset-when-deleted-pvc-policy> <br> `when_scaled`=<statefulset-when-scaled-pvc-policy> | EXPERIMENTAL |
|
||||
| kube_statefulset_created | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> | STABLE |
|
||||
| kube_statefulset_labels | Gauge | Kubernetes labels converted to Prometheus labels controlled via [--metric-labels-allowlist](../../developer/cli-arguments.md) | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> <br> `label_STATEFULSET_LABEL`=<STATEFULSET_LABEL> | STABLE |
|
||||
| kube_statefulset_status_current_revision | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> <br> `revision`=<statefulset-current-revision> | STABLE |
|
||||
| kube_statefulset_status_update_revision | Gauge | | `statefulset`=<statefulset-name> <br> `namespace`=<statefulset-namespace> <br> `revision`=<statefulset-update-revision> | STABLE |
|
|
@ -1,7 +0,0 @@
|
|||
# MutatingWebhookConfiguration Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_mutatingwebhookconfiguration_info | Gauge | `mutatingwebhookconfiguration`=<mutatingwebhookconfiguration-name> <br> `namespace`=<mutatingwebhookconfiguration-namespace> | EXPERIMENTAL |
|
||||
| kube_mutatingwebhookconfiguration_created | Gauge | `mutatingwebhookconfiguration`=<mutatingwebhookconfiguration-name> <br> `namespace`=<mutatingwebhookconfiguration-namespace> | EXPERIMENTAL |
|
||||
| kube_mutatingwebhookconfiguration_metadata_resource_version | Gauge | `mutatingwebhookconfiguration`=<mutatingwebhookconfiguration-name> <br> `namespace`=<mutatingwebhookconfiguration-namespace> | EXPERIMENTAL |
|
|
@ -1,9 +0,0 @@
|
|||
# Namespace Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_namespace_annotations | Gauge | `namespace`=<namespace-name> <br> `label_NS_ANNOTATION`=<NS_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_namespace_created | Gauge | `namespace`=<namespace-name> | STABLE |
|
||||
| kube_namespace_labels | Gauge | `namespace`=<namespace-name> <br> `label_NS_LABEL`=<NS_LABEL> | STABLE |
|
||||
| kube_namespace_status_condition | Gauge | `namespace`=<namespace-name> <br> `condition`=<NamespaceDeletionDiscoveryFailure\|NamespaceDeletionContentFailure\|NamespaceDeletionGroupVersionParsingFailure> <br> `status`=<true\|false\|unknown> | EXPERIMENTAL |
|
||||
| kube_namespace_status_phase| Gauge | `namespace`=<namespace-name> <br> `phase`=<Active\|Terminating> | STABLE |
|
|
@ -1,10 +0,0 @@
|
|||
# Network Policy Metrics
|
||||
|
||||
|
||||
| Metric name | Metric type | Labels/tags | Status |
|
||||
| ------------------------------------- | ----------- | ------------------------------------------------------------------------------ | ------------ |
|
||||
| kube_networkpolicy_annotations | Gauge | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
||||
| kube_networkpolicy_created | Gauge | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
||||
| kube_networkpolicy_labels | Gauge | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
||||
| kube_networkpolicy_spec_egress_rules | Gauge | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
||||
| kube_networkpolicy_spec_ingress_rules | Gauge | `namespace`=<namespace name> `networkpolicy`=<networkpolicy name> | EXPERIMENTAL |
|
|
@ -1,15 +0,0 @@
|
|||
# Node Metrics
|
||||
|
||||
| Metric name| Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------------------- | ----------- | ------ |
|
||||
| kube_node_annotations | Gauge | Kubernetes annotations converted to Prometheus labels | | `node`=<node-address> <br> `annotation_NODE_ANNOTATION`=<NODE_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_node_info | Gauge | Information about a cluster node| |`node`=<node-address> <br> `kernel_version`=<kernel-version> <br> `os_image`=<os-image-name> <br> `container_runtime_version`=<container-runtime-and-version-combination> <br> `kubelet_version`=<kubelet-version> <br> `kubeproxy_version`=<kubeproxy-version> <br> `pod_cidr`=<pod-cidr> <br> `provider_id`=<provider-id> <br> `system_uuid`=<system-uuid> <br> `internal_ip`=<internal-ip> | STABLE |
|
||||
| kube_node_labels | Gauge | Kubernetes labels converted to Prometheus labels | | `node`=<node-address> <br> `label_NODE_LABEL`=<NODE_LABEL> | STABLE |
|
||||
| kube_node_role | Gauge | The role of a cluster node | | `node`=<node-address> <br> `role`=<NODE_ROLE> | EXPERIMENTAL |
|
||||
| kube_node_spec_unschedulable | Gauge | Whether a node can schedule new pods | | `node`=<node-address>| STABLE |
|
||||
| kube_node_spec_taint | Gauge | The taint of a cluster node. | |`node`=<node-address> <br> `key`=<taint-key> <br> `value=`<taint-value> <br> `effect=`<taint-effect> | STABLE |
|
||||
| kube_node_status_capacity | Gauge | The total amount of resources available for a node | `cpu`=<core> <br> `ephemeral_storage`=<byte> <br> `pods`=<integer> <br> `attachable_volumes_*`=<byte> <br> `hugepages_*`=<byte> <br> `memory`=<byte> |`node`=<node-address> <br> `resource`=<resource-name> <br> `unit`=<resource-unit>| STABLE |
|
||||
| kube_node_status_allocatable | Gauge | The amount of resources allocatable for pods (after reserving some for system daemons) | `cpu`=<core> <br> `ephemeral_storage`=<byte> <br> `pods`=<integer> <br> `attachable_volumes_*`=<byte> <br> `hugepages_*`=<byte> <br> `memory`=<byte> |`node`=<node-address> <br> `resource`=<resource-name> <br> `unit`=<resource-unit>| STABLE |
|
||||
| kube_node_status_condition | Gauge | The condition of a cluster node | |`node`=<node-address> <br> `condition`=<node-condition> <br> `status`=<true\|false\|unknown> | STABLE |
|
||||
| kube_node_created | Gauge | Unix creation timestamp | seconds |`node`=<node-address>| STABLE |
|
||||
| kube_node_deletion_timestamp | Gauge | Unix deletion timestamp | seconds |`node`=<node-address>| EXPERIMENTAL |
|
|
@ -1,12 +0,0 @@
|
|||
# PersistentVolume Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|
||||
| ----------- | ----------- | ----------- | ----------- | ----------- | ------------ |
|
||||
| kube_persistentvolume_annotations | Gauge | | | `persistentvolume`=<persistentvolume-name> <br> `annotation_PERSISTENTVOLUME_ANNOTATION`=<PERSISTENTVOLUME_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_persistentvolume_capacity_bytes | Gauge | | | `persistentvolume`=<pv-name> | STABLE |
|
||||
| kube_persistentvolume_status_phase | Gauge | | | `persistentvolume`=<pv-name> <br>`phase`=<Bound\|Failed\|Pending\|Available\|Released> | STABLE |
|
||||
| kube_persistentvolume_claim_ref | Gauge | | | `persistentvolume`=<pv-name> <br>`claim_namespace`=<<namespace>> <br>`name`=<<name>> | STABLE |
|
||||
| kube_persistentvolume_labels | Gauge | | | `persistentvolume`=<persistentvolume-name> <br> `label_PERSISTENTVOLUME_LABEL`=<PERSISTENTVOLUME_LABEL> | STABLE |
|
||||
| kube_persistentvolume_info | Gauge | | | `persistentvolume`=<pv-name> <br> `storageclass`=<storageclass-name> <br> `gce_persistent_disk_name`=<pd-name> <br> `host_path`=<path-of-a-host-volume> <br> `host_path_type`=<host-mount-type> <br> `ebs_volume_id`=<ebs-volume-id> <br> `azure_disk_name`=<azure-disk-name> <br> `fc_wwids`=<fc-wwids-comma-separated> <br> `fc_lun`=<fc-lun> <br> `fc_target_wwns`=<fc-target-wwns-comma-separated> <br> `iscsi_target_portal`=<iscsi-target-portal> <br> `iscsi_iqn`=<iscsi-iqn> <br> `iscsi_lun`=<iscsi-lun> <br> `iscsi_initiator_name`=<iscsi-initiator-name> <br> `local_path`=<path-of-a-local-volume> <br> `local_fs`=<local-volume-fs-type> <br> `nfs_server`=<nfs-server> <br> `nfs_path`=<nfs-path> <br> `csi_driver`=<csi-driver> <br> `csi_volume_handle`=<csi-volume-handle> | STABLE |
|
||||
| kube_persistentvolume_created | Gauge | Unix Creation Timestamp | seconds | `persistentvolume`=<persistentvolume-name> <br> | EXPERIMENTAL |
|
||||
|
|
@ -1,16 +0,0 @@
|
|||
# PersistentVolumeClaim Metrics
|
||||
|
||||
| Metric name | Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|
||||
| ----------- | ------------- | ----------- | ----------- | ----------- | ----------- |
|
||||
| kube_persistentvolumeclaim_annotations | Gauge | | | `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `namespace`=<persistentvolumeclaim-namespace> <br> `annotation_PERSISTENTVOLUMECLAIM_ANNOTATION`=<PERSISTENTVOLUMECLAIM_ANNOATION> | EXPERIMENTAL |
|
||||
| kube_persistentvolumeclaim_access_mode | Gauge | | | `access_mode`=<persistentvolumeclaim-access-mode> <br>`namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> | STABLE |
|
||||
| kube_persistentvolumeclaim_info | Gauge | | | `namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `storageclass`=<persistentvolumeclaim-storageclassname><br>`volumename`=<volumename> | STABLE |
|
||||
| kube_persistentvolumeclaim_labels | Gauge | | | `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `namespace`=<persistentvolumeclaim-namespace> <br> `label_PERSISTENTVOLUMECLAIM_LABEL`=<PERSISTENTVOLUMECLAIM_LABEL> | STABLE |
|
||||
| kube_persistentvolumeclaim_resource_requests_storage_bytes | Gauge | | | `namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> | STABLE |
|
||||
| kube_persistentvolumeclaim_status_condition | Gauge | | | `namespace` =<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `type`=<persistentvolumeclaim-condition-type> <br> `status`=<true\false\unknown> | EXPERIMENTAL |
|
||||
| kube_persistentvolumeclaim_status_phase | Gauge | | | `namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> <br> `phase`=<Pending\Bound\Lost> | STABLE |
|
||||
| kube_persistentvolumeclaim_created | Gauge | Unix Creation Timestamp | seconds | `namespace`=<persistentvolumeclaim-namespace> <br> `persistentvolumeclaim`=<persistentvolumeclaim-name> | EXPERIMENTAL |
|
||||
|
||||
Note:
|
||||
|
||||
- An empty string will be used if PVC has no storage class.
|
|
@ -1,83 +0,0 @@
|
|||
# Pod Metrics
|
||||
|
||||
| Metric name| Metric type | Description | Unit (where applicable) | Labels/tags | Status | Opt-in |
|
||||
| ---------- | ----------- |-----------------------------------------------------------------------| ----------------------- | ----------- | ------ | ------ |
|
||||
| kube_pod_annotations | Gauge | Kubernetes annotations converted to Prometheus labels | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `annotation_POD_ANNOTATION`=<POD_ANNOTATION> <br> `uid`=<pod-uid> | EXPERIMENTAL | -
|
||||
| kube_pod_info | Gauge | Information about pod | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `host_ip`=<host-ip> <br> `pod_ip`=<pod-ip> <br> `node`=<node-name><br> `created_by_kind`=<created_by_kind><br> `created_by_name`=<created_by_name><br> `uid`=<pod-uid><br> `priority_class`=<priority_class><br> `host_network`=<host_network>| STABLE | - |
|
||||
| kube_pod_ips | Gauge | Pod IP addresses | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `ip`=<pod-ip-address> <br> `ip_family`=<4 OR 6> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_start_time | Gauge | Start time in unix timestamp for a pod | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_completion_time | Gauge | Completion time in unix timestamp for a pod | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_owner | Gauge | Information about the Pod's owner | |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `owner_kind`=<owner kind> <br> `owner_name`=<owner name> <br> `owner_is_controller`=<whether owner is controller> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_labels | Gauge | Kubernetes labels converted to Prometheus labels | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `label_POD_LABEL`=<POD_LABEL> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_nodeselectors| Gauge | Describes the Pod nodeSelectors | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `nodeselector_NODE_SELECTOR`=<NODE_SELECTOR> <br> `uid`=<pod-uid> | EXPERIMENTAL | Opt-in |
|
||||
| kube_pod_status_phase | Gauge | The pods current phase | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `phase`=<Pending\|Running\|Succeeded\|Failed\|Unknown> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_qos_class | Gauge | The pods current qosClass | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `qos_class`=<BestEffort\|Burstable\|Guaranteed> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_status_ready | Gauge | Describes whether the pod is ready to serve requests | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `condition`=<true\|false\|unknown> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_scheduled | Gauge | Describes the status of the scheduling process for the pod | |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `condition`=<true\|false\|unknown> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_info | Gauge | Information about a container in a pod | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `image`=<image-name> <br> `image_id`=<image-id> <br> `image_spec`=<image-spec> <br> `container_id`=<containerid> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_waiting | Gauge | Describes whether the container is currently in waiting state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_waiting_reason | Gauge | Describes the reason the container is currently in waiting state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<container-waiting-reason> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_running | Gauge | Describes whether the container is currently in running state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_state_started | Gauge | Start time in unix timestamp for a pod container | seconds |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_terminated | Gauge | Describes whether the container is currently in terminated state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_status_terminated_reason | Gauge | Describes the reason the container is currently in terminated state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<container-terminated-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_status_last_terminated_reason | Gauge | Describes the last reason the container was in terminated state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<last-terminated-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_status_last_terminated_exitcode | Gauge | Describes the exit code for the last container in terminated state. | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_status_ready | Gauge | Describes whether the containers readiness check succeeded | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_ready_time | Gauge | Time when pod passed readiness probes. | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL |
|
||||
| kube_pod_status_container_ready_time | Gauge | Time when the container of the pod entered Ready state. | seconds | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL |
|
||||
| kube_pod_container_status_restarts_total | Counter | The number of container restarts per container | | `container`=<container-name> <br> `namespace`=<pod-namespace> <br> `pod`=<pod-name> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_container_resource_requests | Gauge | The number of requested request resource by a container. It is recommended to use the `kube_pod_resource_requests` metric exposed by kube-scheduler instead, as it is more precise. | `cpu`=<core> <br> `memory`=<bytes> |`resource`=<resource-name> <br> `unit`=<resource-unit> <br> `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `node`=< node-name> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_container_resource_limits | Gauge | The number of requested limit resource by a container. It is recommended to use the `kube_pod_resource_limits` metric exposed by kube-scheduler instead, as it is more precise. | `cpu`=<core> <br> `memory`=<bytes> |`resource`=<resource-name> <br> `unit`=<resource-unit> <br> `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `node`=< node-name> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_overhead_cpu_cores | Gauge | The pod overhead in regards to cpu cores associated with running a pod | core |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_overhead_memory_bytes | Gauge | The pod overhead in regards to memory associated with running a pod | bytes |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_runtimeclass_name_info | Gauge | The runtimeclass associated with the pod | |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_created | Gauge | Unix creation timestamp | seconds |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_deletion_timestamp | Gauge | Unix deletion timestamp | seconds |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_restart_policy | Gauge | Describes the restart policy in use by this pod | |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `type`=<Always\|Never\|OnFailure> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_info | Gauge | Information about an init container in a pod | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `image`=<image-name> <br> `image_id`=<image-id> <br> `image_spec`=<image-spec> <br> `container_id`=<containerid> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_status_waiting | Gauge | Describes whether the init container is currently in waiting state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_status_waiting_reason | Gauge | Describes the reason the init container is currently in waiting state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<container-waiting-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_init_container_status_running | Gauge | Describes whether the init container is currently in running state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_status_terminated | Gauge | Describes whether the init container is currently in terminated state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_status_terminated_reason | Gauge | Describes the reason the init container is currently in terminated state | | `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<container-terminated-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_init_container_status_last_terminated_reason | Gauge | Describes the last reason the init container was in terminated state | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<last-terminated-reason> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_init_container_status_ready | Gauge | Describes whether the init containers readiness check succeeded | |`container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_status_restarts_total | Counter | The number of restarts for the init container | integer |`container`=<container-name> <br> `namespace`=<pod-namespace> <br> `pod`=<pod-name> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_init_container_resource_limits | Gauge | The number of CPU cores requested limit by an init container | `cpu`=<core> <br> `memory`=<bytes> |`resource`=<resource-name> <br> `unit`=<resource-unit> <br> `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `node`=< node-name> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_init_container_resource_requests | Gauge | The number of CPU cores requested by an init container | `cpu`=<core> <br> `memory`=<bytes> |`resource`=<resource-name> <br> `unit`=<resource-unit> <br> `container`=<container-name> <br> `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `node`=< node-name> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_spec_volumes_persistentvolumeclaims_info | Gauge | Information about persistentvolumeclaim volumes in a pod | |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `volume`=<volume-name> <br> `persistentvolumeclaim`=<persistentvolumeclaim-claimname> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_spec_volumes_persistentvolumeclaims_readonly | Gauge | Describes whether a persistentvolumeclaim is mounted read only | bool |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `volume`=<volume-name> <br> `persistentvolumeclaim`=<persistentvolumeclaim-claimname> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_reason | Gauge | The pod status reasons | |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `reason`=<Evicted\|NodeAffinity\|NodeLost\|Shutdown\|UnexpectedAdmissionError> <br> `uid`=<pod-uid> | EXPERIMENTAL | - |
|
||||
| kube_pod_status_scheduled_time | Gauge | Unix timestamp when pod moved into scheduled status | seconds |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_status_unschedulable | Gauge | Describes the unschedulable status for the pod | |`pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> | STABLE | - |
|
||||
| kube_pod_tolerations | Gauge | Information about the pod tolerations | | `pod`=<pod-name> <br> `namespace`=<pod-namespace> <br> `uid`=<pod-uid> <br> `key`=<toleration-key> <br> `operator`=<toleration-operator> <br> `value`=<toleration-value> <br> `effect`=<toleration-effect> `toleration_seconds`=<toleration-seconds> | EXPERIMENTAL | - |
|
||||
|
||||
## Useful metrics queries
|
||||
|
||||
### How to retrieve non-standard Pod state
|
||||
|
||||
It is not straightforward to get the Pod states for certain cases like "Terminating" and "Unknown" since it is not stored behind a field in the `Pod.Status`.
|
||||
|
||||
So to mimic the [logic](https://github.com/kubernetes/kubernetes/blob/v1.17.3/pkg/printers/internalversion/printers.go#L624) used by the `kubectl` command line, you will need to compose multiple metrics.
|
||||
|
||||
For example:
|
||||
|
||||
* To get the list of pods that are in the `Unknown` state, you can run the following PromQL query: `sum(kube_pod_status_phase{phase="Unknown"}) by (namespace, pod) or (count(kube_pod_deletion_timestamp) by (namespace, pod) * sum(kube_pod_status_reason{reason="NodeLost"}) by(namespace, pod))`
|
||||
|
||||
* For Pods in `Terminating` state: `count(kube_pod_deletion_timestamp) by (namespace, pod) * count(kube_pod_status_reason{reason="NodeLost"} == 0) by (namespace, pod)`
|
||||
|
||||
Here is an example of a Prometheus rule that can be used to alert on a Pod that has been in the `Terminated` state for more than `5m`.
|
||||
|
||||
```yaml
|
||||
groups:
|
||||
- name: Pod state
|
||||
rules:
|
||||
- alert: PodsBlockInTerminatingState
|
||||
expr: count(kube_pod_deletion_timestamp) by (namespace, pod) * count(kube_pod_status_reason{reason="NodeLost"} == 0) by (namespace, pod) > 0
|
||||
for: 5m
|
||||
labels:
|
||||
severity: page
|
||||
annotations:
|
||||
summary: Pod {{$labels.namespace}}/{{$labels.pod}} block in Terminating state.
|
||||
```
|
|
@ -1,12 +0,0 @@
|
|||
# PodDisruptionBudget Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_poddisruptionbudget_annotations | Gauge | `poddisruptionbudget`=<poddisruptionbudget-name> <br> `namespace`=<poddisruptionbudget-namespace> <br> `annotation_PODDISRUPTIONBUDGET_ANNOTATION`=<PODDISRUPTIONBUDGET_ANNOATION> | EXPERIMENTAL |
|
||||
| kube_poddisruptionbudget_labels | Gauge | `poddisruptionbudget`=<poddisruptionbudget-name> <br> `namespace`=<poddisruptionbudget-namespace> <br> `label_PODDISRUPTIONBUDGET_LABEL`=<PODDISRUPTIONBUDGET_ANNOATION> | EXPERIMENTAL |
|
||||
| kube_poddisruptionbudget_created | Gauge | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE
|
||||
| kube_poddisruptionbudget_status_current_healthy | Gauge | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE
|
||||
| kube_poddisruptionbudget_status_desired_healthy | Gauge | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE
|
||||
| kube_poddisruptionbudget_status_pod_disruptions_allowed | Gauge | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE
|
||||
| kube_poddisruptionbudget_status_expected_pods | Gauge | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE
|
||||
| kube_poddisruptionbudget_status_observed_generation | Gauge | `poddisruptionbudget`=<pdb-name> <br> `namespace`=<pdb-namespace> | STABLE
|
|
@ -1,14 +0,0 @@
|
|||
# ReplicaSet metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_replicaset_annotations | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> <br> `annotation_REPLICASET_ANNOTATION`=<REPLICASET_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_replicaset_status_replicas | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_status_fully_labeled_replicas | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_status_ready_replicas | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_status_observed_generation | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_spec_replicas | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_metadata_generation | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_labels | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> <br> `label_REPLICASET_LABEL`=<REPLICASET_LABEL> | STABLE |
|
||||
| kube_replicaset_created | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> | STABLE |
|
||||
| kube_replicaset_owner | Gauge | `replicaset`=<replicaset-name> <br> `namespace`=<replicaset-namespace> <br> `owner_kind`=<owner kind> <br> `owner_name`=<owner name> <br> `owner_is_controller`=<whether owner is controller> | STABLE |
|
|
@ -1,13 +0,0 @@
|
|||
# ReplicationController metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_replicationcontroller_status_replicas | Gauge | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_status_fully_labeled_replicas | Gauge | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_status_ready_replicas | Gauge | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_status_available_replicas | Gauge | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_status_observed_generation | Gauge | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_spec_replicas | Gauge | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_metadata_generation | Gauge | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_created | Gauge | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> | STABLE |
|
||||
| kube_replicationcontroller_owner | Gauge | `replicationcontroller`=<replicationcontroller-name> <br> `namespace`=<replicationcontroller-namespace> <br> `owner_kind`=<owner kind> <br> `owner_name`=<owner name> <br> `owner_is_controller`=<whether owner is controller> | EXPERIMENTAL |
|
|
@ -1,6 +0,0 @@
|
|||
# ResourceQuota Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_resourcequota | Gauge | `resourcequota`=<quota-name> <br> `namespace`=<namespace> <br> `resource`=<ResourceName> <br> `type`=<quota-type> | STABLE |
|
||||
| kube_resourcequota_created | Gauge | `resourcequota`=<quota-name> <br> `namespace`=<namespace> | STABLE |
|
|
@ -1,9 +0,0 @@
|
|||
# Role Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_role_annotations | Gauge | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL
|
||||
| kube_role_labels | Gauge | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL
|
||||
| kube_role_info | Gauge | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL
|
||||
| kube_role_created | Gauge | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL |
|
||||
| kube_role_metadata_resource_version | Gauge | `role`=<role-name> <br> `namespace`=<role-namespace> | EXPERIMENTAL |
|
|
@ -1,9 +0,0 @@
|
|||
# RoleBinding Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_rolebinding_annotations | Gauge | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> | EXPERIMENTAL
|
||||
| kube_rolebinding_labels | Gauge | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> | EXPERIMENTAL
|
||||
| kube_rolebinding_info | Gauge | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> <br> `roleref_kind`=<role-kind> <br> `roleref_name`=<role-name>| EXPERIMENTAL
|
||||
| kube_rolebinding_created | Gauge | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> | EXPERIMENTAL |
|
||||
| kube_rolebinding_metadata_resource_version | Gauge | `rolebinding`=<rolebinding-name> <br> `namespace`=<rolebinding-namespace> | EXPERIMENTAL |
|
|
@ -1,10 +0,0 @@
|
|||
# Secret Metrics
|
||||
|
||||
| Metric name| Metric type | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------- |
|
||||
| kube_secret_annotations | Gauge | `secret`=<secret-name> <br> `namespace`=<secret-namespace> <br> `annotations_SECRET_ANNOTATION`=<SECRET_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_secret_info | Gauge | `secret`=<secret-name> <br> `namespace`=<secret-namespace> | STABLE |
|
||||
| kube_secret_type | Gauge | `secret`=<secret-name> <br> `namespace`=<secret-namespace> <br> `type`=<secret-type> | STABLE |
|
||||
| kube_secret_labels | Gauge | `secret`=<secret-name> <br> `namespace`=<secret-namespace> <br> `label_SECRET_LABEL`=<SECRET_LABEL> | STABLE |
|
||||
| kube_secret_created | Gauge | `secret`=<secret-name> <br> `namespace`=<secret-namespace> | STABLE |
|
||||
| kube_secret_metadata_resource_version | Gauge | `secret`=<secret-name> <br> `namespace`=<secret-namespace> | EXPERIMENTAL |
|
|
@ -1,11 +0,0 @@
|
|||
# Service Metrics
|
||||
|
||||
| Metric name| Metric type | Description | Unit (where applicable) | Labels/tags | Status |
|
||||
| ---------- | ----------- | ----------- | ----------------------- | ----------- | ------ |
|
||||
| kube_service_annotations | Gauge | Kubernetes annotations converted to Prometheus labels | |`service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `annotation_SERVICE_ANNOTATION`=<SERVICE_ANNOTATION> | EXPERIMENTAL |
|
||||
| kube_service_info | Gauge | Information about service | |`service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `cluster_ip`=<service cluster ip> <br> `external_name`=<service external name> <br> `load_balancer_ip`=<service load balancer ip> | STABLE |
|
||||
| kube_service_labels | Gauge | Kubernetes labels converted to Prometheus labels | |`service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `label_SERVICE_LABEL`=<SERVICE_LABEL> | STABLE |
|
||||
| kube_service_created | Gauge | Unix creation timestamp | seconds |`service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> | STABLE |
|
||||
| kube_service_spec_type | Gauge | Type about service | |`service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `type`=<ClusterIP\|NodePort\|LoadBalancer\|ExternalName> | STABLE |
|
||||
| kube_service_spec_external_ip | Gauge | Service external ips. One series for each ip | |`service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `external_ip`=<external-ip> | STABLE |
|
||||
| kube_service_status_load_balancer_ingress | Gauge | Service load balancer ingress status | |`service`=<service-name> <br> `namespace`=<service-namespace> <br> `uid`=<service-uid> <br> `ip`=<load-balancer-ingress-ip> <br> `hostname`=<load-balancer-ingress-hostname> | STABLE |
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue