-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathk8s-logstash.yaml
97 lines (97 loc) · 2.11 KB
/
k8s-logstash.yaml
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
---
apiVersion: v1
kind: ConfigMap
metadata:
name: logstash-config
namespace: elk-stack
data:
logstash.conf: |-
input {
redis {
host => "redis"
password => "my_redis_password"
key => "phplogs"
data_type => "list"
}
}
output {
elasticsearch {
hosts => "elasticsearch:9200"
user => "elastic"
password => "changeme"
index => "logstash-%{+YYYY.MM.dd}"
sniffing => false
}
}
logstash.yml: |-
http.host: "0.0.0.0"
path.config: /usr/share/logstash/pipeline
xpack.monitoring.enabled: false
xpack.monitoring.elasticsearch.username: elastic
xpack.monitoring.elasticsearch.password: changeme
---
kind: Service
apiVersion: v1
metadata:
name: logstash
namespace: elk-stack
labels:
app: logstash
spec:
ports:
- port: 9600
selector:
app: logstash
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: logstash
namespace: elk-stack
labels:
app: logstash
spec:
replicas: 1
selector:
matchLabels:
app: logstash
template:
metadata:
labels:
app: logstash
spec:
containers:
- name: logstash
ports:
- containerPort: 9600
image: docker.elastic.co/logstash/logstash:7.8.0
volumeMounts:
- name: config
mountPath: /usr/share/logstash/config/logstash.yml
subPath: logstash.yml
readOnly: true
- name: pipeline
mountPath: /usr/share/logstash/pipeline
readOnly: true
command:
- logstash
resources:
limits:
memory: 1Gi
cpu: "200m"
requests:
memory: 400m
cpu: "200m"
volumes:
- name: pipeline
configMap:
name: logstash-config
items:
- key: logstash.conf
path: logstash.conf
- name: config
configMap:
name: logstash-config
items:
- key: logstash.yml
path: logstash.yml