{"id":12105,"date":"2023-03-14T15:43:02","date_gmt":"2023-03-14T07:43:02","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=12105"},"modified":"2023-03-16T16:46:04","modified_gmt":"2023-03-16T08:46:04","slug":"kube-proxy","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2023\/03\/14\/kube-proxy\/","title":{"rendered":"\u901a\u8fc7categrfa\u76d1\u63a7kube-proxy"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Kube-Proxy \u9ed8\u8ba4\u66b4\u9732\u4e24\u4e2a\u7aef\u53e3\uff0c10249\u7528\u4e8e\u66b4\u9732\u76d1\u63a7\u6307\u6807\uff0c\u5728\/metrics\u63a5\u53e3\u83b7\u53d6\u9075\u5faaPrometheus\u534f\u8bae\u7684\u76d1\u63a7\u6570\u636e\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"214\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/7-5.png\" alt=\"\" class=\"wp-image-12106\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/7-5.png 708w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/7-5-300x91.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/7-5-600x181.png 600w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">10256\u7aef\u53e3\u7528\u6765\u68c0\u67e5kube-proxy\u7684\u5065\u5eb7\u72b6\u6001\uff0c\u901a\u8fc7\u63a5\u53e3\/healthz\u6765\u68c0\u67e5\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"707\" height=\"60\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/8-5.png\" alt=\"\" class=\"wp-image-12107\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/8-5.png 707w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/8-5-300x25.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/8-5-600x51.png 600w\" sizes=\"auto, (max-width: 707px) 100vw, 707px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u914d\u7f6ecategraf\u4e2d\u7684prometheus\u63d2\u4ef6\uff0c\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>vim conf\/input.prometheus\/prometheus.yml<\/code><\/pre>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"223\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/9-5.png\" alt=\"\" class=\"wp-image-12111\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/9-5.png 708w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/9-5-300x94.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/9-5-600x189.png 600w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u91cd\u542fcategraf\uff0c\u67e5\u770b\u76d1\u63a7\u6307\u6807\uff0c\u5982\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"708\" height=\"337\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/10-4.png\" alt=\"\" class=\"wp-image-12112\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/10-4.png 708w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/10-4-300x143.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/03\/10-4-600x286.png 600w\" sizes=\"auto, (max-width: 708px) 100vw, 708px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u901a\u8fc7\u5982\u4e0b\u547d\u4ee4\u4e5f\u53ef\u4ee5\u6d4b\u8bd5\u76d1\u63a7\u6307\u6807\u662f\u5426\u5b58\u5728\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>.\/categraf --test --inputs prometheus | grep kubeproxy_sync_proxy_rules<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e0a\u8ff0\u4e8c\u8fdb\u5236\u90e8\u7f72\u65b9\u5f0f\u6709\u4e2a\u95ee\u9898\u5c31\u662f\u6709\u51e0\u4e2a\u8282\u70b9\uff0c\u5c31\u8981\u53bb\u5206\u522b\u4fee\u6539categraf\u7684\u914d\u7f6e\uff0c\u5982\u679c\u540e\u671f\u6269\u5bb9\u8282\u70b9\uff0c\u4e5f\u8981\u4e00\u4e2a\u4e2a\u4fee\u6539\uff0c\u7565\u5fae\u9ebb\u70e6\uff0c\u8fd8\u6709\u4e00\u79cd\u529e\u6cd5\u5c31\u662f\u5c06categraf\u505a\u6210Daemonset\uff0c\u8fd9\u6837\u65e0\u9700\u62c5\u5fc3\u6269\u5bb9\u540e\u624b\u52a8\u4fee\u6539\u7684\u95ee\u9898<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-purple-color\">Daemonset\u65b9\u5f0f\u90e8\u7f72categraf<\/mark><\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">kube-proxy\u68c0\u6d4b\u5173\u952e\u6307\u6807\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># HELP go_gc_duration_seconds A summary of the pause duration of garbage collection cycles.\r\n# TYPE go_gc_duration_seconds summary\r\ngc\u65f6\u95f4\r\n\r\n# HELP go_goroutines Number of goroutines that currently exist.\r\n# TYPE go_goroutines gauge\r\ngoroutine\u6570\u91cf\r\n\r\n# HELP go_threads Number of OS threads created.\r\n# TYPE go_threads gauge\r\n\u7ebf\u7a0b\u6570\u91cf\r\n\r\n# HELP kubeproxy_network_programming_duration_seconds &#91;ALPHA] In Cluster Network Programming Latency in seconds\r\n# TYPE kubeproxy_network_programming_duration_seconds histogram\r\nservice\u6216\u8005pod\u53d1\u751f\u53d8\u5316\u5230kube-proxy\u89c4\u5219\u540c\u6b65\u5b8c\u6210\u65f6\u95f4\u6307\u6807\u542b\u4e49\u8f83\u590d\u6742\uff0c\u53c2\u7167https:\/\/github.com\/kubernetes\/community\/blob\/master\/sig-scalability\/slos\/network_programming_latency.md\r\n\r\n# HELP kubeproxy_sync_proxy_rules_duration_seconds &#91;ALPHA] SyncProxyRules latency in seconds\r\n# TYPE kubeproxy_sync_proxy_rules_duration_seconds histogram\r\n\u89c4\u5219\u540c\u6b65\u8017\u65f6\r\n\r\n# HELP kubeproxy_sync_proxy_rules_endpoint_changes_pending &#91;ALPHA] Pending proxy rules Endpoint changes\r\n# TYPE kubeproxy_sync_proxy_rules_endpoint_changes_pending gauge\r\nendpoint \u53d1\u751f\u53d8\u5316\u540e\u89c4\u5219\u540c\u6b65pending\u7684\u6b21\u6570\r\n\r\n# HELP kubeproxy_sync_proxy_rules_endpoint_changes_total &#91;ALPHA] Cumulative proxy rules Endpoint changes\r\n# TYPE kubeproxy_sync_proxy_rules_endpoint_changes_total counter\r\nendpoint \u53d1\u751f\u53d8\u5316\u540e\u89c4\u5219\u540c\u6b65\u7684\u603b\u6b21\u6570\r\n\r\n# HELP kubeproxy_sync_proxy_rules_iptables_restore_failures_total &#91;ALPHA] Cumulative proxy iptables restore failures\r\n# TYPE kubeproxy_sync_proxy_rules_iptables_restore_failures_total counter\r\n\u672c\u673a\u4e0a iptables restore \u5931\u8d25\u7684\u603b\u6b21\u6570\r\n\r\n# HELP kubeproxy_sync_proxy_rules_last_queued_timestamp_seconds &#91;ALPHA] The last time a sync of proxy rules was queued\r\n# TYPE kubeproxy_sync_proxy_rules_last_queued_timestamp_seconds gauge\r\n\u6700\u8fd1\u4e00\u6b21\u89c4\u5219\u540c\u6b65\u7684\u8bf7\u6c42\u65f6\u95f4\u6233\uff0c\u5982\u679c\u6bd4\u4e0b\u4e00\u4e2a\u6307\u6807 kubeproxy_sync_proxy_rules_last_timestamp_seconds \u5927\u5f88\u591a\uff0c\u90a3\u8bf4\u660e\u540c\u6b65 hung \u4f4f\u4e86\r\n\r\n# HELP kubeproxy_sync_proxy_rules_last_timestamp_seconds &#91;ALPHA] The last time proxy rules were successfully synced\r\n# TYPE kubeproxy_sync_proxy_rules_last_timestamp_seconds gauge\r\n\u6700\u8fd1\u4e00\u6b21\u89c4\u5219\u540c\u6b65\u7684\u5b8c\u6210\u65f6\u95f4\u6233\r\n\r\n# HELP kubeproxy_sync_proxy_rules_service_changes_pending &#91;ALPHA] Pending proxy rules Service changes\r\n# TYPE kubeproxy_sync_proxy_rules_service_changes_pending gauge\r\nservice\u53d8\u5316\u5f15\u8d77\u7684\u89c4\u5219\u540c\u6b65pending\u6570\u91cf\r\n\r\n# HELP kubeproxy_sync_proxy_rules_service_changes_total &#91;ALPHA] Cumulative proxy rules Service changes\r\n# TYPE kubeproxy_sync_proxy_rules_service_changes_total counter\r\nservice\u53d8\u5316\u5f15\u8d77\u7684\u89c4\u5219\u540c\u6b65\u603b\u6570\r\n\r\n# HELP process_cpu_seconds_total Total user and system CPU time spent in seconds.\r\n# TYPE process_cpu_seconds_total counter\r\n\u5229\u7528\u8fd9\u4e2a\u6307\u6807\u7edf\u8ba1cpu\u4f7f\u7528\u7387\r\n\r\n# HELP process_max_fds Maximum number of open file descriptors.\r\n# TYPE process_max_fds gauge\r\n\u8fdb\u7a0b\u53ef\u4ee5\u6253\u5f00\u7684\u6700\u5927fd\u6570\r\n\r\n# HELP process_open_fds Number of open file descriptors.\r\n# TYPE process_open_fds gauge\r\n\u8fdb\u7a0b\u5f53\u524d\u6253\u5f00\u7684fd\u6570\r\n\r\n# HELP process_resident_memory_bytes Resident memory size in bytes.\r\n# TYPE process_resident_memory_bytes gauge\r\n\u7edf\u8ba1\u5185\u5b58\u4f7f\u7528\u5927\u5c0f\r\n\r\n# HELP process_start_time_seconds Start time of the process since unix epoch in seconds.\r\n# TYPE process_start_time_seconds gauge\r\n\u8fdb\u7a0b\u542f\u52a8\u65f6\u95f4\u6233\r\n\r\n# HELP rest_client_request_duration_seconds &#91;ALPHA] Request latency in seconds. Broken down by verb and URL.\r\n# TYPE rest_client_request_duration_seconds histogram\r\n\u8bf7\u6c42 apiserver \u7684\u8017\u65f6(\u6309\u7167url\u548cverb\u7edf\u8ba1)\r\n\r\n# HELP rest_client_requests_total &#91;ALPHA] Number of HTTP requests, partitioned by status code, method, and host.\r\n# TYPE rest_client_requests_total counter\r\n\u8bf7\u6c42 apiserver \u7684\u603b\u6570(\u6309\u7167code method host\u7edf\u8ba1)<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Kube-Proxy \u9ed8\u8ba4\u66b4\u9732\u4e24\u4e2a\u7aef\u53e3\uff0c10249\u7528\u4e8e\u66b4\u9732\u76d1\u63a7\u6307\u6807\uff0c\u5728\/metrics\u63a5\u53e3\u83b7\u53d6\u9075\u5faaPromet [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":12110,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93,109],"tags":[],"class_list":["post-12105","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kubernetes","category-didi"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":8}},"_links":{"self":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/12105","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/comments?post=12105"}],"version-history":[{"count":7,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/12105\/revisions"}],"predecessor-version":[{"id":12201,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/12105\/revisions\/12201"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/12110"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=12105"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=12105"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=12105"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}