Added logging via Filebeat -> Logstash

This commit is contained in:
2025-10-21 20:33:33 +02:00
parent 20def0ad16
commit 6e2eb8f8e0
7 changed files with 177 additions and 1 deletions

18
logstash/configmap.yaml Normal file
View File

@@ -0,0 +1,18 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: logstash-config
namespace: app-notifications
data:
logstash.conf: |
input {
beats {
port => 5044
}
}
filter {
if [level] == "DEBUG" { drop {} }
}
output {
stdout { codec => json } # for testing
}

28
logstash/deployment.yaml Normal file
View File

@@ -0,0 +1,28 @@
apiVersion: apps/v1
kind: Deployment
metadata:
name: logstash
namespace: app-notifications
spec:
replicas: 1
selector:
matchLabels:
app: logstash
template:
metadata:
labels:
app: logstash
spec:
containers:
- name: logstash
image: docker.elastic.co/logstash/logstash:8.12.1
ports:
- containerPort: 5044
volumeMounts:
- name: logstash-config
mountPath: /usr/share/logstash/pipeline/logstash.conf
subPath: logstash.conf
volumes:
- name: logstash-config
configMap:
name: logstash-config

12
logstash/service.yaml Normal file
View File

@@ -0,0 +1,12 @@
apiVersion: v1
kind: Service
metadata:
name: logstash
namespace: app-notifications
spec:
selector:
app: logstash
ports:
- protocol: TCP
port: 5044
targetPort: 5044