From 95cce733d047efc184096b02425d150f693e97df Mon Sep 17 00:00:00 2001 From: Alen Komljen Date: Wed, 10 Jul 2019 21:52:26 +0200 Subject: [PATCH] SC-5200 Add support for LA custom configs (#15405) Signed-off-by: Alen Komljen --- stable/sematext-agent/Chart.yaml | 2 +- stable/sematext-agent/README.md | 1 + .../configmap-logagent-custom-configs.yaml | 13 +++++++++++++ stable/sematext-agent/templates/daemonset.yaml | 10 ++++++++++ stable/sematext-agent/values.yaml | 15 +++++++++++++++ 5 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 stable/sematext-agent/templates/configmap-logagent-custom-configs.yaml diff --git a/stable/sematext-agent/Chart.yaml b/stable/sematext-agent/Chart.yaml index f2f90ef7d1..d564836b18 100644 --- a/stable/sematext-agent/Chart.yaml +++ b/stable/sematext-agent/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 appVersion: "1.0" -version: 1.0.12 +version: 1.0.13 description: Helm chart for deploying Sematext Agent to Kubernetes keywords: - sematext diff --git a/stable/sematext-agent/README.md b/stable/sematext-agent/README.md index 3cf5fa3ffa..d8864a4333 100644 --- a/stable/sematext-agent/README.md +++ b/stable/sematext-agent/README.md @@ -54,6 +54,7 @@ The following table lists the configuration parameters of the `sematext-agent` c | `logagent.image.tag` | The image tag | `latest` | | `logagent.image.pullPolicy` | Image pull policy | `Always` | | `logagent.resources` | Logagent resources | `{}` | +| `logagent.customConfigs` | Logagent custom configs | `[]` | | `logagent.extraHostVolumeMounts` | Extra mounts | `{}` | | `customUrl.serverBaseUrl` | Custom Base URL | `Nil` | | `customUrl.logsReceiverUrl` | Custom Logs receiver URL | `Nil` | diff --git a/stable/sematext-agent/templates/configmap-logagent-custom-configs.yaml b/stable/sematext-agent/templates/configmap-logagent-custom-configs.yaml new file mode 100644 index 0000000000..ccfe5d45f4 --- /dev/null +++ b/stable/sematext-agent/templates/configmap-logagent-custom-configs.yaml @@ -0,0 +1,13 @@ +{{- if .Values.logagent.customConfigs }} +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "sematext-agent.fullname" . }}-logagent-custom-configs + labels: + app: {{ template "sematext-agent.name" . }}-logagent + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{ toYaml .Values.logagent.customConfigs | indent 2 }} +{{- end }} diff --git a/stable/sematext-agent/templates/daemonset.yaml b/stable/sematext-agent/templates/daemonset.yaml index e4a19313b4..8469cc75bb 100644 --- a/stable/sematext-agent/templates/daemonset.yaml +++ b/stable/sematext-agent/templates/daemonset.yaml @@ -26,6 +26,7 @@ spec: checksum/config-agent: {{ include (print $.Template.BasePath "/configmap-agent.yaml") . | sha256sum }} checksum/config-agent-autodisco: {{ include (print $.Template.BasePath "/configmap-agent-autodisco.yaml") . | sha256sum }} checksum/config-logagent: {{ include (print $.Template.BasePath "/configmap-logagent.yaml") . | sha256sum }} + checksum/config-logagent-custom-configs: {{ include (print $.Template.BasePath "/configmap-logagent-custom-configs.yaml") . | sha256sum }} checksum/secret: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }} spec: serviceAccountName: {{ template "sematext-agent.serviceAccountName" . }} @@ -115,6 +116,10 @@ spec: volumeMounts: - name: docker-sock mountPath: /var/run/docker.sock + {{- if .Values.logagent.customConfigs }} + - mountPath: /etc/sematext + name: logagent-config-volume + {{- end }} {{- if .Values.logagent.extraHostVolumeMounts }} {{- range $_, $mount := .Values.logagent.extraHostVolumeMounts }} - name: {{ $mount.name }} @@ -146,6 +151,11 @@ spec: - name: lib hostPath: path: /host/usr/lib + {{- if .Values.logagent.customConfigs }} + - name: logagent-config-volume + configMap: + name: {{ template "sematext-agent.fullname" . }}-logagent-custom-configs + {{- end }} {{- if .Values.logagent.extraHostVolumeMounts }} {{- range $_, $mount := .Values.logagent.extraHostVolumeMounts }} - name: {{ $mount.name }} diff --git a/stable/sematext-agent/values.yaml b/stable/sematext-agent/values.yaml index c314d7a52b..f94e43b055 100644 --- a/stable/sematext-agent/values.yaml +++ b/stable/sematext-agent/values.yaml @@ -25,6 +25,21 @@ logagent: config: LOGSENE_BULK_SIZE: "1000" LOGSENE_LOG_INTERVAL: "10000" + customConfigs: [] + # logagent.conf: |- + # options: + # printStats: 60 + # suppress: true + # geoipEnabled: true + # diskBufferDir: /tmp/sematext-logagent + # parser: + # patternFiles: + # - /etc/logagent/patterns.yml + # output: + # logsene: + # module: elasticsearch + # url: ${LOGSENE_RECEIVER_URL} + resources: {} extraHostVolumeMounts: {} # - name: