Skip to content

Commit

Permalink
feat: add log utils daemonset
Browse files Browse the repository at this point in the history
Signed-off-by: Clément Nussbaumer <[email protected]>
  • Loading branch information
clementnuss committed Oct 29, 2024
1 parent 8072c8c commit a469e0a
Show file tree
Hide file tree
Showing 2 changed files with 97 additions and 0 deletions.
34 changes: 34 additions & 0 deletions log-utils/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: syslog-ng-config
data:
syslog-ng.conf: |
@version: 4.2
@include "scl.conf"
# Source definition for JSON logs on port 514
source s_json {
network(
port(514)
transport("udp")
flags(no-parse) # Don't try to parse as syslog
);
};
# Parser for JSON format
parser p_json {
json-parser();
};
# Define the destination as stdout
destination d_stdout {
pipe("/dev/stdout");
};
# Define the log path
log {
source(s_json);
parser(p_json);
destination(d_stdout);
};
63 changes: 63 additions & 0 deletions log-utils/daemonset.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apiVersion: apps/v1
kind: DaemonSet
metadata:
labels:
k8s-app: logs-utils
name: logs-utils
namespace: kube-system
spec:
selector:
matchLabels:
k8s-app: logs-utils
template:
metadata:
labels:
k8s-app: logs-utils
spec:
containers:
- image: balabit/syslog-ng
imagePullPolicy: Always
# readinessProbe: TODO ?
name: rpcbind
volumeMounts:
- mountPath: /etc/syslog-ng
name: syslog-ng-config
ports:
- protocol: UDP
containerPort: 514
hostPort: 514

resources:
{}
# add:
# - CHOWN
# - KILL
# - NET_ADMIN
# - NET_RAW
# - IPC_LOCK
# - SYS_ADMIN
# - SYS_RESOURCE
# - DAC_OVERRIDE
# - FOWNER
# - SETGID
# - SETUID
# drop:
# - ALL
# seLinuxOptions:
# level: s0
# type: spc_t
# startupProbe:
# failureThreshold: 105
priorityClassName: system-node-critical
dnsPolicy: ClusterFirst
restartPolicy: Always
terminationGracePeriodSeconds: 1
volumes:
- name: syslog-ng-config
configMap:
name: syslog-ng-config
items:
- key: syslog-ng.conf
path: syslog-ng.conf
tolerations:
- operator: Exists

0 comments on commit a469e0a

Please sign in to comment.