From aab1621af0ddbb51daf35b651e3a9abacd092c7d Mon Sep 17 00:00:00 2001 From: Christian Groschupp Date: Wed, 20 Feb 2019 12:23:23 +0100 Subject: [PATCH] [stable/elasticsearch-curator] add env option (#11533) * Add env option to elasticsearch-curator. Signed-off-by: Christian Groschupp * Allow to overwrite command in elasticsearch-curator. Signed-off-by: Christian Groschupp * Update README.md in elasticsearch-curator. Signed-off-by: Christian Groschupp * Bump elasticsearch-curator version to 1.2.1. Signed-off-by: Christian Groschupp --- stable/elasticsearch-curator/Chart.yaml | 2 +- stable/elasticsearch-curator/README.md | 4 +++- stable/elasticsearch-curator/templates/cronjob.yaml | 12 +++++++++++- stable/elasticsearch-curator/values.yaml | 3 +++ 4 files changed, 18 insertions(+), 3 deletions(-) diff --git a/stable/elasticsearch-curator/Chart.yaml b/stable/elasticsearch-curator/Chart.yaml index 216e93b80e..c2be0621a8 100644 --- a/stable/elasticsearch-curator/Chart.yaml +++ b/stable/elasticsearch-curator/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "5.5.4" description: A Helm chart for Elasticsearch Curator name: elasticsearch-curator -version: 1.2.0 +version: 1.2.1 home: https://github.com/elastic/curator keywords: - curator diff --git a/stable/elasticsearch-curator/README.md b/stable/elasticsearch-curator/README.md index 4e1ab9d894..c6e3664fee 100644 --- a/stable/elasticsearch-curator/README.md +++ b/stable/elasticsearch-curator/README.md @@ -40,7 +40,9 @@ their default values. | `cronjob.failedJobsHistoryLimit` | Specify the number of failed Jobs to keep | `nil` | | `cronjob.successfulJobsHistoryLimit` | Specify the number of completed Jobs to keep | `nil` | | `pod.annotations` | Annotations to add to the pod | {} | -| `dryrun` | Run Curator in dry-run mode | `false` | +| `dryrun` | Run Curator in dry-run mode | `false` | +| `env` | Environment variables to add to the cronjob container | {} | +| `command` | Command to execute | ["curator"] | | `configMaps.action_file_yml` | Contents of the Curator action_file.yml | See values.yaml | | `configMaps.config_yml` | Contents of the Curator config.yml (overrides config) | See values.yaml | | `resources` | Resource requests and limits | {} | diff --git a/stable/elasticsearch-curator/templates/cronjob.yaml b/stable/elasticsearch-curator/templates/cronjob.yaml index 96d4a29574..9452f481f1 100644 --- a/stable/elasticsearch-curator/templates/cronjob.yaml +++ b/stable/elasticsearch-curator/templates/cronjob.yaml @@ -58,12 +58,22 @@ spec: mountPath: /etc/es-curator {{- if .Values.extraVolumeMounts }} {{ toYaml .Values.extraVolumeMounts | indent 16 }} +{{ end }} +{{ if .Values.command }} + command: +{{ toYaml .Values.command | indent 16 }} {{- end }} - command: [ "curator" ] {{- if .Values.dryrun }} args: [ "--dry-run", "--config", "/etc/es-curator/config.yml", "/etc/es-curator/action_file.yml" ] {{- else }} args: [ "--config", "/etc/es-curator/config.yml", "/etc/es-curator/action_file.yml" ] +{{- end }} + env: +{{- if .Values.env }} +{{- range $key,$value := .Values.env }} + - name: {{ $key | upper | quote}} + value: {{ $value | quote}} +{{- end }} {{- end }} resources: {{ toYaml .Values.resources | indent 16 }} diff --git a/stable/elasticsearch-curator/values.yaml b/stable/elasticsearch-curator/values.yaml index e9a7e0c22b..6ac4f2c924 100644 --- a/stable/elasticsearch-curator/values.yaml +++ b/stable/elasticsearch-curator/values.yaml @@ -25,6 +25,9 @@ hooks: # run curator in dry-run mode dryrun: false +command: ["curator"] +env: {} + configMaps: # Delete indices older than 7 days action_file_yml: |-