Skip to content

Commit

Permalink
Add elasticsearch template parameters (#31)
Browse files Browse the repository at this point in the history
To fix ILM policy creation logic.

Signed-off-by: Moritz Reinhardt <[email protected]>
  • Loading branch information
moreinhardt authored Nov 25, 2020
1 parent f7d848b commit 8cbbe9b
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/fluentd-elasticsearch/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v2
name: fluentd-elasticsearch
version: 11.0.2
version: 11.1.0
appVersion: 3.1.0
type: application
home: https://www.fluentd.org/
Expand Down
4 changes: 4 additions & 0 deletions charts/fluentd-elasticsearch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ The following table lists the configurable parameters of the Fluentd elasticsear
| `elasticsearch.ilm.policy` | Elasticsearch ILM policy to create | `{}` |
| `elasticsearch.ilm.policies` | Elasticsearch ILM policies to create, map of policy IDs and policies | `{}` |
| `elasticsearch.ilm.policy_overwrite` | Elastichsarch ILM policy overwrite | `false` |
| `elasticsearch.template.enabled` | Elastichsarch Index Template enabled | `false` |
| `elasticsearch.template.name` | Elastichsarch Index Template Name | `fluentd-template` |
| `elasticsearch.template.file` | Elasticsearch Index Template File Name (inside the daemonset) | `fluentd-template.json` |
| `elasticsearch.template.content` | Elasticsearch Index Template Content | _see `values.yaml`_ |
| `elasticsearch.indexName` | Elasticsearch Index Name | `fluentd` |
| `elasticsearch.path` | Elasticsearch Path | `""` |
| `elasticsearch.scheme` | Elasticsearch scheme setting | `http` |
Expand Down
9 changes: 9 additions & 0 deletions charts/fluentd-elasticsearch/templates/configmaps.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,10 @@ data:
ilm_policy "#{ENV['ILM_POLICY']}"
ilm_policies "#{ENV['ILM_POLICIES']}"
ilm_policy_overwrite "#{ENV['ILM_POLICY_OVERWRITE']}"
{{- end }}
{{- if or .Values.elasticsearch.template.enabled .Values.elasticsearch.ilm.enabled }}
template_name "#{ENV['TEMPLATE_NAME']}"
template_file "#{ENV['TEMPLATE_FILE']}"
{{- end }}
log_es_400_reason "#{ENV['OUTPUT_LOG_400_REASON']}"
reconnect_on_error "#{ENV['OUTPUT_RECONNECT_ON_ERROR']}"
Expand Down Expand Up @@ -549,6 +553,11 @@ data:
</label>
{{- end }}

{{- if or .Values.elasticsearch.template.enabled .Values.elasticsearch.ilm.enabled }}
{{ .Values.elasticsearch.template.file }}: |-
{{ .Values.elasticsearch.template.content | indent 4 }}
{{- end }}

{{- range $key, $value := .Values.extraConfigMaps }}
{{ $key }}: |-
{{ $value | indent 4 }}
Expand Down
6 changes: 6 additions & 0 deletions charts/fluentd-elasticsearch/templates/daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ spec:
value: {{ toJson .Values.elasticsearch.ilm.policies | quote }}
- name: ILM_POLICY_OVERWRITE
value: {{ .Values.elasticsearch.ilm.policy_overwrite | quote }}
{{- end }}
{{- if or .Values.elasticsearch.template.enabled .Values.elasticsearch.ilm.enabled }}
- name: TEMPLATE_NAME
value: {{ .Values.elasticsearch.template.name | quote }}
- name: TEMPLATE_FILE
value: "/etc/fluent/config.d/{{ .Values.elasticsearch.template.file }}"
{{- end }}
- name: OUTPUT_SCHEME
{{- if .Values.awsSigningSidecar.enabled }}
Expand Down
16 changes: 16 additions & 0 deletions charts/fluentd-elasticsearch/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,22 @@ elasticsearch:
# ilm_policy_id1: {}
# ilm_policy_id2: {}
policy_overwrite: false
template:
enabled: false
name: fluentd-template
file: fluentd-template.json
content: |-
{
"index_patterns": [
"logstash-*"
],
"settings": {
"index": {
"number_of_replicas": "1"
}
}
}
path: ""
scheme: "http"
sslVerify: true
Expand Down

0 comments on commit 8cbbe9b

Please sign in to comment.