From bfcc27479545cf15e302fa102ada157dc7c968f9 Mon Sep 17 00:00:00 2001 From: Michael Lorant Date: Wed, 3 Apr 2019 19:57:42 +1100 Subject: [PATCH] Add support for custom files. (#12773) Signed-off-by: Michael Lorant --- stable/logstash/Chart.yaml | 2 +- stable/logstash/README.md | 1 + stable/logstash/templates/files-config.yaml | 14 ++++++++++ stable/logstash/templates/statefulset.yaml | 4 +++ stable/logstash/values.yaml | 29 +++++++++++++++++++++ 5 files changed, 49 insertions(+), 1 deletion(-) create mode 100644 stable/logstash/templates/files-config.yaml diff --git a/stable/logstash/Chart.yaml b/stable/logstash/Chart.yaml index 5d0c7ffbf3..6151a2a3ab 100644 --- a/stable/logstash/Chart.yaml +++ b/stable/logstash/Chart.yaml @@ -3,7 +3,7 @@ description: Logstash is an open source, server-side data processing pipeline icon: https://www.elastic.co/assets/blt86e4472872eed314/logo-elastic-logstash-lt.svg home: https://www.elastic.co/products/logstash name: logstash -version: 1.6.0 +version: 1.7.0 appVersion: 6.7.0 sources: - https://www.docker.elastic.co diff --git a/stable/logstash/README.md b/stable/logstash/README.md index 7bfd58ff8d..07a02db92b 100644 --- a/stable/logstash/README.md +++ b/stable/logstash/README.md @@ -112,6 +112,7 @@ The following table lists the configurable parameters of the chart and its defau | `elasticsearch.port` | ElasticSearch port | `9200` | | `config` | Logstash configuration key-values | (see `values.yaml`) | | `patterns` | Logstash patterns configuration | `nil` | +| `files` | Logstash custom files configuration | `nil` | | `inputs` | Logstash inputs configuration | beats | | `filters` | Logstash filters configuration | `nil` | | `outputs` | Logstash outputs configuration | elasticsearch | diff --git a/stable/logstash/templates/files-config.yaml b/stable/logstash/templates/files-config.yaml new file mode 100644 index 0000000000..9553079b56 --- /dev/null +++ b/stable/logstash/templates/files-config.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ template "logstash.fullname" . }}-files + labels: + app: {{ template "logstash.name" . }} + chart: {{ template "logstash.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +data: +{{- range $key, $value := .Values.files }} + {{ $key }}: |- +{{ $value | indent 4 }} +{{- end }} diff --git a/stable/logstash/templates/statefulset.yaml b/stable/logstash/templates/statefulset.yaml index 5f2c389b18..d2bbc32a6c 100644 --- a/stable/logstash/templates/statefulset.yaml +++ b/stable/logstash/templates/statefulset.yaml @@ -27,6 +27,7 @@ spec: {{- end }} annotations: checksum/patterns: {{ include (print $.Template.BasePath "/patterns-config.yaml") . | sha256sum }} + checksum/templates: {{ include (print $.Template.BasePath "/files-config.yaml") . | sha256sum }} checksum/pipeline: {{ include (print $.Template.BasePath "/pipeline-config.yaml") . | sha256sum }} {{- if .Values.podAnnotations }} ## Custom pod annotations @@ -130,6 +131,9 @@ spec: - name: patterns configMap: name: {{ template "logstash.fullname" . }}-patterns + - name: files + configMap: + name: {{ template "logstash.fullname" . }}-files - name: pipeline configMap: name: {{ template "logstash.fullname" . }}-pipeline diff --git a/stable/logstash/values.yaml b/stable/logstash/values.yaml index 67d2fea22b..a9eb15867e 100644 --- a/stable/logstash/values.yaml +++ b/stable/logstash/values.yaml @@ -150,6 +150,8 @@ volumeMounts: mountPath: /usr/share/logstash/data - name: patterns mountPath: /usr/share/logstash/patterns + - name: files + mountPath: /usr/share/logstash/files - name: pipeline mountPath: /usr/share/logstash/pipeline @@ -217,6 +219,33 @@ patterns: # main: |- # TESTING {"foo":.*}$ +## Custom files that can be referenced by plugins. +## Each YAML heredoc will become located in the logstash home directory under +## the files subdirectory. +files: + # logstash-template.json: |- + # { + # "order": 0, + # "version": 1, + # "index_patterns": [ + # "logstash-*" + # ], + # "settings": { + # "index": { + # "refresh_interval": "5s" + # } + # }, + # "mappings": { + # "doc": { + # "_meta": { + # "version": "1.0.0" + # }, + # "enabled": false + # } + # }, + # "aliases": {} + # } + ## NOTE: To achieve multiple pipelines with this chart, current best practice ## is to maintain one pipeline per chart release. In this way configuration is ## simplified and pipelines are more isolated from one another.