{"id":1448,"date":"2023-03-23T22:15:18","date_gmt":"2023-03-23T14:15:18","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1448"},"modified":"2023-04-28T20:49:47","modified_gmt":"2023-04-28T12:49:47","slug":"kubernetes-1-15-installation-and-deployment-of-efk-log-collection-system","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/23\/kubernetes-1-15-installation-and-deployment-of-efk-log-collection-system\/","title":{"rendered":"Kubernetes 1.15\u5b89\u88c5\u90e8\u7f72EFK\u65e5\u5fd7\u6536\u96c6\u7cfb\u7edf"},"content":{"rendered":"<h2>\u7b80\u5355\u4ecb\u7ecd<\/h2>\n<p>EFK \u7ec4\u5408\u63d2\u4ef6\u662fk8s\u9879\u76ee\u7684\u4e00\u4e2a\u65e5\u5fd7\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u5305\u62ec\u4e09\u4e2a\u7ec4\u4ef6\uff1aElasticsearch, Fluentd, Kibana\u3002\u76f8\u5bf9\u4e8eELK\u8fd9\u6837\u7684\u67b6\u6784\uff0ck8s\u5b98\u65b9\u63a8\u884c\u4e86EFK\uff0c\u53ef\u80fdFluentd\u76f8\u5bf9\u4e8eLogstash\u66f4\u52a0\u8f7b\u91cf\u7ea7\u5427\u3002<\/p>\n<p>Elasticsearch \u662f\u65e5\u5fd7\u5b58\u50a8\u548c\u65e5\u5fd7\u641c\u7d22\u5f15\u64ce\uff0cFluentd \u8d1f\u8d23\u628ak8s\u96c6\u7fa4\u7684\u65e5\u5fd7\u53d1\u9001\u7ed9 Elasticsearch, Kibana \u5219\u662f\u53ef\u89c6\u5316\u754c\u9762\u67e5\u770b\u548c\u68c0\u7d22\u5b58\u50a8\u5728 Elasticsearch \u7684\u6570\u636e\u3002<\/p>\n<p><!-- more --><\/p>\n<p>GitHub\u5b98\u7f51\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/kubernetes\/kubernetes\/tree\/master\/cluster\/addons\/fluentd-elasticsearch\">https:\/\/github.com\/kubernetes\/kubernetes\/tree\/master\/cluster\/addons\/fluentd-elasticsearch<\/a><\/p>\n<h2>\u64cd\u4f5c\u6b65\u9aa4<\/h2>\n<h3>\u83b7\u53d6yaml\u6587\u4ef6<\/h3>\n<p>Github\u5b98\u7f51\u4e0b\u8f7d\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/github.com\/kubernetes\/kubernetes\/tree\/master\/cluster\/addons\/fluentd-elasticsearch\">https:\/\/github.com\/kubernetes\/kubernetes\/tree\/master\/cluster\/addons\/fluentd-elasticsearch<\/a><\/p>\n<ul>\n<li><code>fluentd-es-configmap.yaml<\/code><\/li>\n<li><code>fluentd-es-ds.yaml<\/code><\/li>\n<li><code>es-statefulset.yaml<\/code><\/li>\n<li><code>kibana-deployment.yaml<\/code><\/li>\n<li><code>kibana-service.yaml<\/code><\/li>\n<\/ul>\n<pre><code>[root@k8s-master ~]# mkdir efk\n[root@k8s-master ~]# cp kubernetes\/cluster\/addons\/fluentd-elasticsearch\/*.yaml efk\/<\/code><\/pre>\n<h3>\u51c6\u5907\u955c\u50cf\uff08\u5728\u6240\u6709\u8282\u70b9\u4e0a\uff09<\/h3>\n<p>\u6ce8\uff1a\u56e0\u4e3a\u88ab\u5899\u7684\u7f18\u6545\uff0c\u52a0\u4e0a\u955c\u50cf\u6587\u4ef6\u6bd4\u8f83\u5927\uff0c\u542f\u52a8\u4f1a\u8d39\u65f6\uff0c\u53ef\u4ee5\u63d0\u524d\u5355\u72ec\u4e0b\u8f7d\u597d\u6240\u9700\u955c\u50cf<\/p>\n<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/www.docker.elastic.co\/\">https:\/\/www.docker.elastic.co\/<\/a><\/p>\n<h3>\u53d1\u5e03yaml\u6587\u4ef6\u5230k8s\u4e2d<\/h3>\n<pre><code>[root@k8s-master efk]# cd efk\n[root@k8s-master efk]# kubectl apply -f .<\/code><\/pre>\n<h3>\u67e5\u770b\u5404pod\u72b6\u6001<\/h3>\n<pre><code>[root@k8s-master efk]# kubectl get po -n kube-system -o wide<\/code><\/pre>\n<h3>\u67e5\u770bkibana<\/h3>\n<pre><code>[root@k8s-master efk]# kubectl logs -n kube-system kibana-logging-f8d99b66f-kc8h9 -f<\/code><\/pre>\n<p>\u67e5\u770bkibana\u5730\u5740<\/p>\n<pre><code>[root@k8s-master ~]# kubectl cluster-info | grep kibana\nKibana is running at https:\/\/192.168.0.8:6443\/api\/v1\/namespaces\/kube-system\/services\/kibana-logging\/proxy<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u7b80\u5355\u4ecb\u7ecd EFK \u7ec4\u5408\u63d2\u4ef6\u662fk8s\u9879\u76ee\u7684\u4e00\u4e2a\u65e5\u5fd7\u89e3\u51b3\u65b9\u6848\uff0c\u5b83\u5305\u62ec\u4e09\u4e2a\u7ec4\u4ef6\uff1aElasticsearch, Flu [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[10],"tags":[358,356],"class_list":["post-1448","post","type-post","status-publish","format-standard","hentry","category-k8s","tag-efk","tag-kubernetes"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1448","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1448"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1448\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1448"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1448"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1448"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}