ELK-ON-K8S安装

ELK-ON-K8S安装

helm安装

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
## helm-es
helm repo add bitnami https://charts.bitnami.com/bitnami
helm upgrade --install elasticsearch bitnami/elasticsearch -n base \
--set global.storageClass=nfs-zhikong \
--set global.kibanaEnabled=true \
--set image.tag=7.15.2-debian-10-r10 \
--set security.elasticPassword=Hxkj2021 \
--set master.replicas=1 \
--set master.autoscaling.enabled=false \
--set master.autoscaling.minReplicas=2 \
--set master.autoscaling.maxReplicas=11 \
--set master.heapSize=256m \
--set coordinating.replicas=1 \
--set coordinating.autoscaling.enabled=false \
--set coordinating.autoscaling.minReplicas=2 \
--set coordinating.autoscaling.maxReplicas=11 \
--set coordinating.heapSize=256m \
--set data.replicas=1 \
--set data.autoscaling.enabled=false \
--set data.autoscaling.minReplicas=2 \
--set data.autoscaling.maxReplicas=11 \
--set data.heapSize=1G \
--set ingest.replicas=1 \
--set curator.enabled=false \
--set metrics.enabled=false

## helm-logstash
helm repo add bitnami https://charts.bitnami.com/bitnami
helm upgrade --install logstash bitnami/logstash -n base \
--set image.tag=7.15.2-debian-10-r12 \
--set replicaCount=1 \
--set service.type=ClusterIP \
--set persistence.enabled=false \
--set persistence.storageClass=nfs-zhikong \
--set persistence.size=2Gi

## helm-filebeat
helm repo add elastic https://helm.elastic.co
helm upgrade --install filebeat elastic/filebeat -n base \
--set daemonset.enabled=true

configmap配置

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
## es-configmap

pid.file: /opt/bitnami/kibana/tmp/kibana.pid
server.host: "::"
server.port: 5601
elasticsearch.hosts: [http://elasticsearch-coordinating-only:9200]
server.rewriteBasePath: false


## filebeat-configmap

filebeat.inputs:
- type: log
paths:
- /var/log/*server/*server/*.log


output.logstash:
hosts: [logstash:8080]

## logstash-configmap

input {
# udp {
# port => 1514
# type => syslog
# }
# tcp {
# port => 1514
# type => syslog
# }
beats { port => 8080 }
}
output {
elasticsearch {
hosts => ["elasticsearch-master:9200"]
# manage_template => false
index => "%{[@metadata][beat]}-%{+YYYY.MM.dd}"
}
# gelf {
# host => "${GRAYLOG_HOST}"
# port => ${GRAYLOG_PORT}
# }
# stdout {}
}