{"id":11562,"date":"2023-02-20T12:04:21","date_gmt":"2023-02-20T04:04:21","guid":{"rendered":"https:\/\/blog.ywdevops.cn\/?p=11562"},"modified":"2023-02-22T08:58:27","modified_gmt":"2023-02-22T00:58:27","slug":"loki","status":"publish","type":"post","link":"https:\/\/blog.ywdevops.cn\/index.php\/2023\/02\/20\/loki\/","title":{"rendered":"k8s\u65e5\u5fd7\u6536\u96c6\u5de5\u5177"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u5e38\u7528\u7684\u65e5\u5fd7\u6536\u96c6\u5de5\u5177\u6709\u4e24\u79cd\uff1a ELK\u548cLoki<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u533a\u522b\uff1aELK\u91cd\u91cf\u7ea7\uff0cLoki\u8f7b\u91cf\u7ea7<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>\u4e00\u3001Loki<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Loki\u662fGrafana Labs\u5f00\u6e90\u7684\u4e00\u4e2a\u652f\u6301\u6c34\u5e73\u6269\u5c55\u3001\u9ad8\u53ef\u7528\u3001\u591a\u79df\u6237\u7684\u65e5\u5fd7\u805a\u5408\u7cfb\u7edf\uff0c\u4e5f\u662f\u57fa\u4e8e\u4e8eKubernetes\u5e73\u53f0\u7684\u539f\u751f\u65e5\u5fd7\u6536\u96c6\u5e73\u53f0\uff0c\u6587\u6863\u5730\u5740\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>https:&#47;&#47;grafana.com\/docs\/loki\/v2.7.x\/fundamentals\/overview\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u67b6\u6784\u56fe\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"305\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/02\/7-4.png\" alt=\"\" class=\"wp-image-11567\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/02\/7-4.png 709w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/02\/7-4-300x129.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/02\/7-4-600x258.png 600w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li>Loki\uff1a\u4e3b\u670d\u52a1\u5668\uff0c\u8d1f\u8d23\u65e5\u5fd7\u7684\u5b58\u50a8\u548c\u67e5\u8be2\uff0c\u53c2\u8003\u4e86Prometheus\u7684\u670d\u52a1\u53d1\u73b0\u673a\u5236\uff0c\u5c06\u6807\u7b7e\u6dfb\u52a0\u5230\u65e5\u5fd7\u6d41\uff0c\u800c\u4e0d\u662f\u50cf\u5176\u4ed6\u5e73\u53f0\u4e00\u6837\u8fdb\u884c\u5168\u6587\u7d22\u5f15<\/li><li>Promtail\uff1a\u8d1f\u8d23\u6536\u96c6\u65e5\u5fd7\u5e76\u5c06\u5176\u53d1\u9001\u7ed9Loki\uff0c\u4e3b\u8981\u7528\u4e8e\u53d1\u73b0\u91c7\u96c6\u76ee\u6807\u4ee5\u53ca\u6dfb\u52a0\u5bf9\u5e94Label\uff0c\u6700\u7ec8\u53d1\u9001\u7ed9Loki<\/li><li>Grafana\uff1a\u7528\u6765\u5c55\u793a\u6216\u67e5\u8be2\u76f8\u5173\u65e5\u5fd7\uff0c\u53ef\u4ee5\u5728\u9875\u9762\u67e5\u8be2\u6307\u5b9a\u6807\u7b7ePod\u7684\u65e5\u5fd7<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u4f8b\u5b50\u6f14\u793a\u5728Kubernetes\u96c6\u7fa4\u4e2d\u642d\u5efa\u4e00\u4e2aLoki Stack\uff0c\u7528\u4e8e\u6536\u96c6\u96c6\u7fa4\u5185Pod\u7684\u65e5\u5fd7<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">1\u3001\u5b89\u88c5Loki Stack<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\u6dfb\u52a0\u5e76\u66f4\u65b0Loki\u7684Helm\u4ed3\u5e93\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>helm repo add grafana https:\/\/grafana.github.io\/helm-charts\nhelm repo update<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2\u3001\u641c\u7d22\u4ed3\u5e93\u4e2d\u7684loki\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"709\" height=\"188\" src=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/02\/1-5.png\" alt=\"\" class=\"wp-image-11575\" srcset=\"https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/02\/1-5.png 709w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/02\/1-5-300x80.png 300w, https:\/\/blog.ywdevops.cn\/wp-content\/uploads\/2023\/02\/1-5-600x159.png 600w\" sizes=\"auto, (max-width: 709px) 100vw, 709px\" \/><\/figure>\n\n\n\n<ul class=\"wp-block-list\"><li><code>grafana\/loki<\/code>\u00a0\u53ea\u6709\u5355\u72ec\u7684 loki \u7ec4\u4ef6<\/li><li><code>grafana\/loki-canary<\/code>\u00a0loki \u7684\u53e6\u5916\u4e00\u4e2a\u7ec4\u4ef6\uff0c\u4e3b\u8981\u7ed9 loki \u505a\u6027\u80fd\u5206\u6790<\/li><li><code>grafana\/loki-distributed<\/code>\u00a0\u5206\u5e03\u5f0f\uff08\u5fae\u670d\u52a1\uff09\u6a21\u5f0f<\/li><li><code>grafana\/loki-stack<\/code>\u00a0loki \u7684\u5de5\u5177\u6808<\/li><li><code>grafana\/fluent-bit<\/code>\u00a0\u65e5\u5fd7\u6536\u96c6\u5ba2\u6237\u7aef<\/li><li><code>grafana\/promtail<\/code>\u00a0loki \u81ea\u5e26\u7684\u65e5\u5fd7\u6536\u96c6\u5ba2\u6237\u7aef<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">3\u3001\u83b7\u53d6loki-stack\u5305\uff0c\u6267\u884c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>helm pull grafana\/loki-stack --untar --version 2.9.9<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">4\u3001<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5e38\u7528\u7684\u65e5\u5fd7\u6536\u96c6\u5de5\u5177\u6709\u4e24\u79cd\uff1a ELK\u548cLoki \u533a\u522b\uff1aELK\u91cd\u91cf\u7ea7\uff0cLoki\u8f7b\u91cf\u7ea7 \u4e00\u3001Loki Loki\u662fGr [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":11563,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[93,23],"tags":[],"class_list":["post-11562","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-kubernetes","category-rong"],"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\/11562","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=11562"}],"version-history":[{"count":8,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/11562\/revisions"}],"predecessor-version":[{"id":11577,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/posts\/11562\/revisions\/11577"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media\/11563"}],"wp:attachment":[{"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/media?parent=11562"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/categories?post=11562"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.ywdevops.cn\/index.php\/wp-json\/wp\/v2\/tags?post=11562"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}