Skip to content

Commit

Permalink
Merge pull request #4981 from ktzsolt/helmchartfixes
Browse files Browse the repository at this point in the history
helm: multiple fixes
  • Loading branch information
czanik committed Jun 5, 2024
2 parents 9adfc8e + 7bc2ccb commit d63b9fc
Show file tree
Hide file tree
Showing 4 changed files with 73 additions and 31 deletions.
2 changes: 1 addition & 1 deletion contrib/syslog-ng-helm-chart/templates/compress-job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ data:
fi
done
---
apiVersion: batch/v1beta1
apiVersion: batch/v1
kind: CronJob
metadata:
name: {{ include "syslog-ng.fullname" . }}-compressor
Expand Down
14 changes: 12 additions & 2 deletions contrib/syslog-ng-helm-chart/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,24 +33,34 @@ spec:
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: tcp-port
- name: tcp-port-601
containerPort: 601
protocol: TCP
- name: udp-port
- name: tcp-port-514
containerPort: 514
protocol: TCP
- name: tcp-port-6514
containerPort: 6514
protocol: TCP
- name: udp-port-514
containerPort: 514
protocol: UDP
volumeMounts:
{{- if .Values.config }}
- mountPath: /etc/syslog-ng/syslog-ng.conf
name: config
subPath: syslog-ng.conf
{{- end }}
{{- if .Values.storage.enable }}
- mountPath: /var/log
name: logs
{{- end }}
volumes:
{{- if .Values.config }}
- name: config
configMap:
name: {{ include "syslog-ng.fullname" . }}
{{- end }}
{{- if .Values.storage.enable }}
- name: logs
persistentVolumeClaim:
Expand Down
16 changes: 12 additions & 4 deletions contrib/syslog-ng-helm-chart/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,21 @@ spec:
type: {{ .Values.service.type }}
{{- end }}
ports:
- name: udp-port
- name: tcp-port-514
port: 514
targetPort: 514
protocol: UDP
- name: tcp-port
protocol: TCP
- name: tcp-port-601
port: 601
targetPort: 601
protocol: TCP
protocol: TCP
- name: tcp-port-6514
port: 6514
targetPort: 6514
protocol: TCP
- name: udp-port-514
port: 514
targetPort: 514
protocol: UDP
selector:
{{- include "syslog-ng.selectorLabels" . | nindent 4 }}
72 changes: 48 additions & 24 deletions contrib/syslog-ng-helm-chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,54 @@ image:
repository: balabit/syslog-ng
pullPolicy: IfNotPresent
# Overrides the image tag whose default is the chart appVersion.
tag: "3.27.1"

# By default, the network() driver binds to 0.0.0.0, meaning that it listens
# on every available IPV4 interface on the TCP/601 port.

config: |
@version: 3.27
@include "scl.conf"
options {
# enable or disable directory creation for destination files
create_dirs(yes);
# keep hostnames from source host
keep_hostname(yes);
# use ISO8601 timestamps
ts_format(iso);
};
log {
source {
network();
};
destination { file("/var/log/${YEAR}-${MONTH}-syslog"); };
};
tag: "4.7.1"

# By default, https://github.com/syslog-ng/syslog-ng/blob/master/docker/syslog-ng.conf will be used that is part of the image
# You can ovverride this by providing your own config, for example:
# config: |
# #############################################################################
# # Default syslog-ng.conf file which collects all local logs into a
# # single file called /var/log/messages tailored to container usage.
# #
# # The changes from the stock, default syslog-ng.conf file is that we've
# # dropped the system() source that is not needed and that we enabled network
# # connections using default-network-drivers(). Customize as needed and
# # override using the -v option to docker, such as:
# #
# # docker run ... -v "$PWD/syslog-ng.conf":/etc/syslog-ng/syslog-ng.conf
# #

# @version: 4.7
# @include "scl.conf"

# source s_local {
# internal();
# };

# source s_network {
# default-network-drivers(
# # NOTE: TLS support
# #
# # the default-network-drivers() source driver opens the TLS
# # enabled ports as well, however without an actual key/cert
# # pair they will not operate and syslog-ng would display a
# # warning at startup.
# #
# #tls(key-file("/path/to/ssl-private-key") cert-file("/path/to/ssl-cert"))
# );
# };

# destination d_local {
# file("/var/log/messages");
# file("/var/log/messages-kv.log" template("$ISODATE $HOST $(format-welf --scope all-nv-pairs)\n") frac-digits(3));
# };

# log {
# source(s_local);
# source(s_network);
# destination(d_local);
# };
config: ""

storage:
enable: True
Expand Down

0 comments on commit d63b9fc

Please sign in to comment.