Skip to content

Commit a469e0a

Browse files
committed
feat: add log utils daemonset
Signed-off-by: Clément Nussbaumer <[email protected]>
1 parent 8072c8c commit a469e0a

File tree

2 files changed

+97
-0
lines changed

2 files changed

+97
-0
lines changed

log-utils/configmap.yaml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: syslog-ng-config
5+
data:
6+
syslog-ng.conf: |
7+
@version: 4.2
8+
@include "scl.conf"
9+
10+
# Source definition for JSON logs on port 514
11+
source s_json {
12+
network(
13+
port(514)
14+
transport("udp")
15+
flags(no-parse) # Don't try to parse as syslog
16+
);
17+
};
18+
19+
# Parser for JSON format
20+
parser p_json {
21+
json-parser();
22+
};
23+
24+
# Define the destination as stdout
25+
destination d_stdout {
26+
pipe("/dev/stdout");
27+
};
28+
29+
# Define the log path
30+
log {
31+
source(s_json);
32+
parser(p_json);
33+
destination(d_stdout);
34+
};

log-utils/daemonset.yaml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
apiVersion: apps/v1
2+
kind: DaemonSet
3+
metadata:
4+
labels:
5+
k8s-app: logs-utils
6+
name: logs-utils
7+
namespace: kube-system
8+
spec:
9+
selector:
10+
matchLabels:
11+
k8s-app: logs-utils
12+
template:
13+
metadata:
14+
labels:
15+
k8s-app: logs-utils
16+
spec:
17+
containers:
18+
- image: balabit/syslog-ng
19+
imagePullPolicy: Always
20+
# readinessProbe: TODO ?
21+
name: rpcbind
22+
volumeMounts:
23+
- mountPath: /etc/syslog-ng
24+
name: syslog-ng-config
25+
ports:
26+
- protocol: UDP
27+
containerPort: 514
28+
hostPort: 514
29+
30+
resources:
31+
{}
32+
# add:
33+
# - CHOWN
34+
# - KILL
35+
# - NET_ADMIN
36+
# - NET_RAW
37+
# - IPC_LOCK
38+
# - SYS_ADMIN
39+
# - SYS_RESOURCE
40+
# - DAC_OVERRIDE
41+
# - FOWNER
42+
# - SETGID
43+
# - SETUID
44+
# drop:
45+
# - ALL
46+
# seLinuxOptions:
47+
# level: s0
48+
# type: spc_t
49+
# startupProbe:
50+
# failureThreshold: 105
51+
priorityClassName: system-node-critical
52+
dnsPolicy: ClusterFirst
53+
restartPolicy: Always
54+
terminationGracePeriodSeconds: 1
55+
volumes:
56+
- name: syslog-ng-config
57+
configMap:
58+
name: syslog-ng-config
59+
items:
60+
- key: syslog-ng.conf
61+
path: syslog-ng.conf
62+
tolerations:
63+
- operator: Exists

0 commit comments

Comments
 (0)