Skip to content

Commit 94d2854

Browse files
committedMay 26, 2024
ngnix-logs
1 parent a21ecf4 commit 94d2854

File tree

3 files changed

+133
-0
lines changed

3 files changed

+133
-0
lines changed
 

‎ngnix/fluent-bit-configmap.yaml

+88
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: fluent-bit
5+
namespace: efk
6+
data:
7+
custom_parsers.conf: |
8+
[PARSER]
9+
Name docker_no_time
10+
Format json
11+
Time_Keep Off
12+
Time_Key time
13+
Time_Format %Y-%m-%dT%H:%M:%S.%L
14+
fluent-bit.conf: |
15+
[SERVICE]
16+
Daemon Off
17+
Flush 1
18+
Log_Level info
19+
Parsers_File /fluent-bit/etc/parsers.conf
20+
Parsers_File /fluent-bit/etc/conf/custom_parsers.conf
21+
HTTP_Server On
22+
HTTP_Listen 0.0.0.0
23+
HTTP_Port 2020
24+
Health_Check On
25+
26+
[INPUT]
27+
Name tail
28+
Path /var/log/containers/app-event-simulator*.log
29+
multiline.parser docker, cri
30+
Tag kube.*
31+
Mem_Buf_Limit 5MB
32+
Skip_Long_Lines On
33+
34+
[INPUT]
35+
Name systemd
36+
Tag host.*
37+
Systemd_Filter _SYSTEMD_UNIT=kubelet.service
38+
Read_From_Tail On
39+
40+
[INPUT]
41+
Name tail
42+
Path /var/log/containers/nginx-deployment*.log
43+
multiline.parser docker, cri
44+
Tag nginx.*
45+
Mem_Buf_Limit 5MB
46+
Skip_Long_Lines On
47+
48+
[FILTER]
49+
Name kubernetes
50+
Match kube.*
51+
Merge_Log On
52+
Keep_Log Off
53+
K8S-Logging.Parser On
54+
K8S-Logging.Exclude On
55+
56+
[FILTER]
57+
Name kubernetes
58+
Match nginx.*
59+
Merge_Log On
60+
Keep_Log Off
61+
K8S-Logging.Parser On
62+
K8S-Logging.Exclude On
63+
64+
[OUTPUT]
65+
Name es
66+
Match kube.*
67+
Host elasticsearch
68+
Logstash_Format On
69+
Retry_Limit False
70+
Suppress_Type_Name On
71+
72+
[OUTPUT]
73+
Name es
74+
Match host.*
75+
Host elasticsearch
76+
Logstash_Format On
77+
Logstash_Prefix node
78+
Retry_Limit False
79+
Suppress_Type_Name On
80+
81+
[OUTPUT]
82+
Name es
83+
Match nginx.*
84+
Host elasticsearch
85+
Logstash_Format On
86+
Logstash_Prefix nginx
87+
Retry_Limit False
88+
Suppress_Type_Name On

‎ngnix/nginx-service.yaml

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: nginx-service
5+
namespace: efk
6+
labels:
7+
app: nginx
8+
spec:
9+
selector:
10+
app: nginx
11+
ports:
12+
- protocol: TCP
13+
port: 80
14+
targetPort: 80
15+
type: NodePort

‎ngnix/ngnix-deployment.yaml

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: nginx-deployment
5+
namespace: efk
6+
labels:
7+
app: nginx
8+
spec:
9+
replicas: 1
10+
selector:
11+
matchLabels:
12+
app: nginx
13+
template:
14+
metadata:
15+
labels:
16+
app: nginx
17+
spec:
18+
containers:
19+
- name: nginx
20+
image: nginx:latest
21+
ports:
22+
- containerPort: 80
23+
volumeMounts:
24+
- mountPath: /var/log/nginx
25+
name: log-volume
26+
volumes:
27+
- name: log-volume
28+
hostPath:
29+
path: /var/log/ngnixapp
30+
type: DirectoryOrCreate

0 commit comments

Comments
 (0)
Please sign in to comment.