Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Kubernetes1.6.2 deploys the EFK plug-in

2025-04-06 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article introduces Kubernetes1.6.2 how to deploy the EFK plug-in, the content is very detailed, interested friends can refer to, hope to be helpful to you.

Prepare the yaml file

Official document catalogue:

Https://github.com/kubernetes/kubernetes/tree/v1.6.2/cluster/addons/fluentd-elasticsearch

New es-rbac.yaml and fluentd-es-rbac.yaml files have been added to define Role and RoleBinding used by elasticsearch and fluentd

Es-rbac.yaml

ApiVersion: v1kind: ServiceAccountmetadata: name: elasticsearch namespace: kube-system---kind: ClusterRoleBindingapiVersion: rbac.authorization.k8s.io/v1alpha1metadata: name: elasticsearchsubjects:-kind: ServiceAccount name: elasticsearch namespace: kube-systemroleRef: kind: ClusterRole name: view apiGroup: rbac.authorization.k8s.io

Fluentd-es-rbac.yaml

ApiVersion: v1kind: ServiceAccountmetadata: name: fluentd namespace: kube-system---kind: ClusterRoleBindingapiVersion: rbac.authorization.k8s.io/v1alpha1metadata: name: fluentdsubjects:-kind: ServiceAccount name: fluentd namespace: kube-systemroleRef: kind: ClusterRole name: view apiGroup: rbac.authorization.k8s.io configuration es-controller.yaml

Change the image address to Aliyun address

Registry.cn-hangzhou.aliyuncs.com/google-containers/elasticsearch:v2.4.1-1 configure fluentd-es-ds.yaml

Change the image address to Aliyun address

Registry.cn-hangzhou.aliyuncs.com/google-containers/fluentd-elasticsearch:1.22 configuration kibana-controller.yaml

Change the image address to Aliyun address

Registry.cn-hangzhou.aliyuncs.com/google-containers/kibana:v4.6.1-1 tags Node

DaemonSet fluentd-es-v1.22 will only schedule to the Node with the tag beta.kubernetes.io/fluentd-ds-ready=true set, which needs to be set on the Node where the fluentd is expected to run

[root@cz_fbsdb500_06 efk] # kubectl get nodesNAME STATUS AGE VERSION10.112.101.91 Ready 55d v1.6.210.112.101.92 Ready 55d v1.6.210.112.101.93 Ready 55d v1.6.2 [root @ cz_fbsdb500_06 efk] # kubectl label nodes 10.112.101.93 beta.kubernetes.io/fluentd-ds-ready=true [root@cz_ Fbsdb500_06 efk] # kubectl get node-- show-labelsNAME STATUS AGE VERSION LABELS10.112.101.91 Ready 55d v1.6.2 astatb Beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=10.112.101.9110.112.101.92 Ready 55d v1.6.2 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/os=linux,kubernetes.io/hostname=10.112.101.9210.112.101.93 Ready 55d v1.6.2 beta.kubernetes.io/arch=amd64,beta.kubernetes.io/fluentd-ds-ready=true,beta.kubernetes.io/os=linux Kubernetes.io/hostname=10.112.101.93es-service.yaml and kibana-service.yaml remain the same execution definition file

Execute to the yaml file directory of efk

Kubectl create-f. Check the execution result [root@cz_fbsdb500_06 efk] # kubectl get deployment-n kube-system | grep kibanakibana-logging 1 1 1 15d [root @ cz_fbsdb500_06 efk] # kubectl get pods-n kube-system | grep-E 'elasticsearch | fluentd | kibana'elasticsearch-logging-v1-3fmc1 1 Running 0 5delasticsearch-logging-v1-zffql 1 Running 0 5dfluentd-es-v1.22-5mpwk 1 4dkibana-logging-162986974-kz16j 1 Running 0 4dkibana-logging-162986974-kz16j 1 Running 0 5d

It takes a long time for kibana to start for the first time, which takes about 10 minutes.

Visit Kibana [root @ cz_fbsdb500_06 efk] # kubectl cluster-infoKubernetes master is running at https://10.112.101.90:6443Elasticsearch is running at https://10.112.101.90:6443/api/v1/proxy/namespaces/kube-system/services/elasticsearch-loggingHeapster is running at https://10.112.101.90:6443/api/v1/proxy/namespaces/kube-system/services/heapsterKibana is running at https://10.112.101.90:6443/api/ V1/proxy/namespaces/kube-system/services/kibana-loggingKubeDNS is running at https://10.112.101.90:6443/api/v1/proxy/namespaces/kube-system/services/kube-dnskubernetes-dashboard is running at https://10.112.101.90:6443/api/v1/proxy/namespaces/kube-system/services/kubernetes-dashboardmonitoring-grafana is running at https://10.112.101.90:6443/api/v1/proxy/namespaces/kube-system/services/monitoring- Grafanamonitoring-influxdb is running at https://10.112.101.90:6443/api/v1/proxy/namespaces/kube-system/services/monitoring-influxdb

Because kube-apiserver enables RBAC authorization, and browsers use anonymous certificates to access kube-apiserver, access to secure ports can cause authorization to fail. Here you need to access the kube-apiserver using a non-secure port.

Access the link:

Http://10.112.101.90:8080/api/v1/proxy/namespaces/kube-system/services/kibana-logging

Create an index (equivalent to a database in mysql) on the Settings-> Indices page, select Index contains time-based events, use the default logstash-* pattern, and click Create

After you create the Index, you can see the log collection information under the Discover menu in a few minutes.

On how to deploy the EFK plug-in Kubernetes1.6.2 to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report