From 0a8b710083b576e6158cb071210ea73cab0c12e6 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Tue, 21 May 2019 13:10:07 -0500 Subject: [PATCH] Elasticsearch: Add job history to Curator, update schedule key This updates the Elastic Curator cron job to include configuration for successful and failed job history limits, similar to the other cron jobs we deploy. This also moves the key for configuring the cron schedule from under .Values.conf.curator to a new top level jobs key to maintain consistency This also fixes an indentation issue with the deployment overrides for Curator as well as adds the overrides for the Armada job Change-Id: I9c720df9677215bdd2bf18be77959bd5f671c0ca Signed-off-by: Steve Wilkerson --- elasticsearch/templates/cron-job-curator.yaml | 5 ++- elasticsearch/values.yaml | 9 +++- .../armada/manifests/armada-lma.yaml | 22 +++++++++ .../deployment/multinode/120-elasticsearch.sh | 45 +++++++++---------- .../osh-infra-logging/050-elasticsearch.sh | 45 +++++++++---------- 5 files changed, 77 insertions(+), 49 deletions(-) diff --git a/elasticsearch/templates/cron-job-curator.yaml b/elasticsearch/templates/cron-job-curator.yaml index 81b85b2f4..7a6a4d57d 100644 --- a/elasticsearch/templates/cron-job-curator.yaml +++ b/elasticsearch/templates/cron-job-curator.yaml @@ -29,7 +29,10 @@ metadata: annotations: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" }} spec: - schedule: {{ .Values.conf.curator.schedule | quote }} + schedule: {{ .Values.jobs.curator.cron | quote }} + successfulJobsHistoryLimit: {{ .Values.jobs.curator.history.success }} + failedJobsHistoryLimit: {{ .Values.jobs.curator.history.failed }} + concurrencyPolicy: Forbid jobTemplate: metadata: labels: diff --git a/elasticsearch/values.yaml b/elasticsearch/values.yaml index 1fe09a089..647416903 100644 --- a/elasticsearch/values.yaml +++ b/elasticsearch/values.yaml @@ -352,6 +352,13 @@ secrets: elasticsearch: public: elasticsearch-tls-public +jobs: + curator: + cron: "* */6 * * *" + history: + success: 3 + failed: 1 + conf: httpd: | ServerRoot "/usr/local/apache2" @@ -490,8 +497,6 @@ conf: ceph: admin_keyring: null curator: - #run every 6th hour - schedule: "0 */6 * * *" action_file: # Remember, leave a key empty if there is no value. None will be a string, # not a Python "NoneType" diff --git a/tools/deployment/armada/manifests/armada-lma.yaml b/tools/deployment/armada/manifests/armada-lma.yaml index bc8f45c1d..0f3761815 100644 --- a/tools/deployment/armada/manifests/armada-lma.yaml +++ b/tools/deployment/armada/manifests/armada-lma.yaml @@ -403,6 +403,28 @@ data: pod_name: type: keyword index: false + curator: + action_file: + actions: + 1: + action: delete_indices + description: >- + "Delete indices older than 365 days" + options: + timeout_override: + continue_if_exception: False + ignore_empty_list: True + disable_action: True + filters: + - filtertype: pattern + kind: prefix + value: logstash- + - filtertype: age + source: name + direction: older + timestring: '%Y.%m.%d' + unit: days + unit_count: 365 source: type: local location: ${OSH_INFRA_PATH} diff --git a/tools/deployment/multinode/120-elasticsearch.sh b/tools/deployment/multinode/120-elasticsearch.sh index a276c3b8a..c4a7990a6 100755 --- a/tools/deployment/multinode/120-elasticsearch.sh +++ b/tools/deployment/multinode/120-elasticsearch.sh @@ -34,29 +34,28 @@ conf: master: "-Xms512m -Xmx512m" snapshots: enabled: true - curator: - schedule: "0 */6 * * *" - action_file: - actions: - 1: - action: delete_indices - description: >- - "Delete indices older than 365 days" - options: - timeout_override: - continue_if_exception: False - ignore_empty_list: True - disable_action: True - filters: - - filtertype: pattern - kind: prefix - value: logstash- - - filtertype: age - source: name - direction: older - timestring: '%Y.%m.%d' - unit: days - unit_count: 365 + curator: + action_file: + actions: + 1: + action: delete_indices + description: >- + "Delete indices older than 365 days" + options: + timeout_override: + continue_if_exception: False + ignore_empty_list: True + disable_action: True + filters: + - filtertype: pattern + kind: prefix + value: logstash- + - filtertype: age + source: name + direction: older + timestring: '%Y.%m.%d' + unit: days + unit_count: 365 monitoring: prometheus: enabled: true diff --git a/tools/deployment/osh-infra-logging/050-elasticsearch.sh b/tools/deployment/osh-infra-logging/050-elasticsearch.sh index 8e3401976..a4de23cef 100755 --- a/tools/deployment/osh-infra-logging/050-elasticsearch.sh +++ b/tools/deployment/osh-infra-logging/050-elasticsearch.sh @@ -32,29 +32,28 @@ conf: elasticsearch: snapshots: enabled: true - curator: - schedule: "0 */6 * * *" - action_file: - actions: - 1: - action: delete_indices - description: >- - "Delete indices older than 365 days" - options: - timeout_override: - continue_if_exception: False - ignore_empty_list: True - disable_action: True - filters: - - filtertype: pattern - kind: prefix - value: logstash- - - filtertype: age - source: name - direction: older - timestring: '%Y.%m.%d' - unit: days - unit_count: 365 + curator: + action_file: + actions: + 1: + action: delete_indices + description: >- + "Delete indices older than 365 days" + options: + timeout_override: + continue_if_exception: False + ignore_empty_list: True + disable_action: True + filters: + - filtertype: pattern + kind: prefix + value: logstash- + - filtertype: age + source: name + direction: older + timestring: '%Y.%m.%d' + unit: days + unit_count: 365 EOF helm upgrade --install elasticsearch ./elasticsearch \