From 88f21acf34542f9d99364f27de12b0bf155f0193 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Thu, 9 May 2019 10:22:25 -0500 Subject: [PATCH] Curator: Update image, add separate configmaps for service This updates the Curator image to use version 5.6.0, which adds additional actions for use, such as the ability to shrink indices. This also adds a separate configmap and config secret for Curator, as this allows us to use separate configmap annotations on the Elasticsearch component pods to prevent Curator config updates from triggering recreation of Elasticsearch components. This helps alleviate overhead associated with Elasticsearch service restarts. Change-Id: I0aec7756b0dc09bc3981ede950dc88f821aeca4b --- .../templates/configmap-bin-curator.yaml | 29 +++++++++++++++++++ ....yaml => configmap-bin-elasticsearch.yaml} | 4 +-- .../templates/configmap-etc-curator.yaml | 29 +++++++++++++++++++ ....yaml => configmap-etc-elasticsearch.yaml} | 4 +-- elasticsearch/templates/cron-job-curator.yaml | 14 ++++----- .../templates/deployment-client.yaml | 4 +-- .../templates/deployment-master.yaml | 4 +-- elasticsearch/templates/service-logging.yaml | 1 + elasticsearch/templates/statefulset-data.yaml | 4 +-- elasticsearch/values.yaml | 8 +++-- 10 files changed, 79 insertions(+), 22 deletions(-) create mode 100644 elasticsearch/templates/configmap-bin-curator.yaml rename elasticsearch/templates/{configmap-bin.yaml => configmap-bin-elasticsearch.yaml} (91%) create mode 100644 elasticsearch/templates/configmap-etc-curator.yaml rename elasticsearch/templates/{configmap-etc.yaml => configmap-etc-elasticsearch.yaml} (92%) diff --git a/elasticsearch/templates/configmap-bin-curator.yaml b/elasticsearch/templates/configmap-bin-curator.yaml new file mode 100644 index 000000000..160a657ac --- /dev/null +++ b/elasticsearch/templates/configmap-bin-curator.yaml @@ -0,0 +1,29 @@ +{{/* +Copyright 2019 The Openstack-Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +{{- if .Values.manifests.configmap_bin_curator }} +{{- $envAll := . }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: elastic-curator-bin +data: + curator.sh: | +{{ tuple "bin/_curator.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} + image-repo-sync.sh: | +{{- include "helm-toolkit.scripts.image_repo_sync" . | indent 4 }} +{{- end }} diff --git a/elasticsearch/templates/configmap-bin.yaml b/elasticsearch/templates/configmap-bin-elasticsearch.yaml similarity index 91% rename from elasticsearch/templates/configmap-bin.yaml rename to elasticsearch/templates/configmap-bin-elasticsearch.yaml index 99c9c6366..4f213835f 100644 --- a/elasticsearch/templates/configmap-bin.yaml +++ b/elasticsearch/templates/configmap-bin-elasticsearch.yaml @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.configmap_bin }} +{{- if .Values.manifests.configmap_bin_elasticsearch }} {{- $envAll := . }} --- apiVersion: v1 @@ -36,8 +36,6 @@ data: {{- include "helm-toolkit.scripts.create_s3_user" . | indent 4 }} register-repository.sh: | {{ tuple "bin/_register-repository.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} - curator.sh: | -{{ tuple "bin/_curator.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} es-cluster-wait.sh: | {{ tuple "bin/_es-cluster-wait.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} image-repo-sync.sh: | diff --git a/elasticsearch/templates/configmap-etc-curator.yaml b/elasticsearch/templates/configmap-etc-curator.yaml new file mode 100644 index 000000000..db581a3ff --- /dev/null +++ b/elasticsearch/templates/configmap-etc-curator.yaml @@ -0,0 +1,29 @@ +{{/* +Copyright 2019 The Openstack-Helm Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/}} + +{{- if .Values.manifests.configmap_etc_curator }} +{{- $envAll := . }} + +--- +apiVersion: v1 +kind: Secret +metadata: + name: elastic-curator-etc +type: Opaque +data: + action_file.yml: {{ toYaml .Values.conf.curator.action_file | b64enc }} + config.yml: {{ toYaml .Values.conf.curator.config | b64enc }} +{{- end }} diff --git a/elasticsearch/templates/configmap-etc.yaml b/elasticsearch/templates/configmap-etc-elasticsearch.yaml similarity index 92% rename from elasticsearch/templates/configmap-etc.yaml rename to elasticsearch/templates/configmap-etc-elasticsearch.yaml index 0cf390f8d..eebeb303e 100644 --- a/elasticsearch/templates/configmap-etc.yaml +++ b/elasticsearch/templates/configmap-etc-elasticsearch.yaml @@ -14,7 +14,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} -{{- if .Values.manifests.configmap_etc }} +{{- if .Values.manifests.configmap_etc_elasticsearch }} {{- $envAll := . }} {{- if empty .Values.conf.elasticsearch.config.cloud.aws.access_key -}} @@ -43,8 +43,6 @@ metadata: type: Opaque data: elasticsearch.yml: {{ toYaml .Values.conf.elasticsearch.config | b64enc }} - action_file.yml: {{ toYaml .Values.conf.curator.action_file | b64enc }} - config.yml: {{ toYaml .Values.conf.curator.config | b64enc }} #NOTE(portdirect): this must be last, to work round helm ~2.7 bug. {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.httpd "key" "httpd.conf" "format" "Secret") | indent 2 }} {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.log4j2 "key" "log4j2.properties" "format" "Secret") | indent 2 }} diff --git a/elasticsearch/templates/cron-job-curator.yaml b/elasticsearch/templates/cron-job-curator.yaml index ddb14fe32..81b85b2f4 100644 --- a/elasticsearch/templates/cron-job-curator.yaml +++ b/elasticsearch/templates/cron-job-curator.yaml @@ -63,15 +63,15 @@ spec: mountPath: /tmp - name: pod-etc-curator mountPath: /etc/config - - name: elasticsearch-bin + - name: elastic-curator-bin mountPath: /tmp/curator.sh subPath: curator.sh readOnly: true - - name: elasticsearch-etc + - name: elastic-curator-etc mountPath: /etc/config/config.yml subPath: config.yml readOnly: true - - name: elasticsearch-etc + - name: elastic-curator-etc mountPath: /etc/config/action_file.yml subPath: action_file.yml readOnly: true @@ -80,12 +80,12 @@ spec: emptyDir: {} - name: pod-etc-curator emptyDir: {} - - name: elasticsearch-bin + - name: elastic-curator-bin configMap: - name: elasticsearch-bin + name: elastic-curator-bin defaultMode: 0555 - - name: elasticsearch-etc + - name: elastic-curator-etc secret: - secretName: elasticsearch-etc + secretName: elastic-curator-etc defaultMode: 0444 {{- end }} diff --git a/elasticsearch/templates/deployment-client.yaml b/elasticsearch/templates/deployment-client.yaml index df82fee0b..518a8c526 100644 --- a/elasticsearch/templates/deployment-client.yaml +++ b/elasticsearch/templates/deployment-client.yaml @@ -79,8 +79,8 @@ spec: {{ tuple $envAll "elasticsearch" "client" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} annotations: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} - configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} - configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} + configmap-bin-hash: {{ tuple "configmap-bin-elasticsearch.yaml" . | include "helm-toolkit.utils.hash" }} + configmap-etc-hash: {{ tuple "configmap-etc-elasticsearch.yaml" . | include "helm-toolkit.utils.hash" }} {{ dict "envAll" $envAll "podName" "elasticsearch-client" "containerNames" (list "elasticsearch-client") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: {{ dict "envAll" $envAll "application" "client" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} diff --git a/elasticsearch/templates/deployment-master.yaml b/elasticsearch/templates/deployment-master.yaml index 3b72732d0..726afbe28 100644 --- a/elasticsearch/templates/deployment-master.yaml +++ b/elasticsearch/templates/deployment-master.yaml @@ -77,8 +77,8 @@ spec: {{ tuple $envAll "elasticsearch" "master" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} annotations: {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} - configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} - configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} + configmap-bin-hash: {{ tuple "configmap-bin-elasticsearch.yaml" . | include "helm-toolkit.utils.hash" }} + configmap-etc-hash: {{ tuple "configmap-etc-elasticsearch.yaml" . | include "helm-toolkit.utils.hash" }} {{ dict "envAll" $envAll "podName" "elasticsearch-master" "containerNames" (list "elasticsearch-master") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} spec: {{ dict "envAll" $envAll "application" "master" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} diff --git a/elasticsearch/templates/service-logging.yaml b/elasticsearch/templates/service-logging.yaml index 1a31533f7..1c09ce63f 100644 --- a/elasticsearch/templates/service-logging.yaml +++ b/elasticsearch/templates/service-logging.yaml @@ -28,6 +28,7 @@ spec: {{- if .Values.network.elasticsearch.node_port.enabled }} nodePort: {{ .Values.network.elasticsearch.node_port.port }} {{- end }} + type: LoadBalancer selector: {{ tuple $envAll "elasticsearch" "client" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{- if .Values.network.elasticsearch.node_port.enabled }} diff --git a/elasticsearch/templates/statefulset-data.yaml b/elasticsearch/templates/statefulset-data.yaml index dff7aa09f..872e7dd38 100644 --- a/elasticsearch/templates/statefulset-data.yaml +++ b/elasticsearch/templates/statefulset-data.yaml @@ -78,8 +78,8 @@ spec: annotations: {{ dict "envAll" $envAll "podName" "elasticsearch-data" "containerNames" (list "elasticsearch-data") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }} - configmap-bin-hash: {{ tuple "configmap-bin.yaml" . | include "helm-toolkit.utils.hash" }} - configmap-etc-hash: {{ tuple "configmap-etc.yaml" . | include "helm-toolkit.utils.hash" }} + configmap-bin-hash: {{ tuple "configmap-bin-elasticsearch.yaml" . | include "helm-toolkit.utils.hash" }} + configmap-etc-hash: {{ tuple "configmap-etc-elasticsearch.yaml" . | include "helm-toolkit.utils.hash" }} spec: {{ dict "envAll" $envAll "application" "data" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} serviceAccountName: {{ $serviceAccountName }} diff --git a/elasticsearch/values.yaml b/elasticsearch/values.yaml index 2a0e9586b..7858e0379 100644 --- a/elasticsearch/values.yaml +++ b/elasticsearch/values.yaml @@ -20,7 +20,7 @@ images: tags: apache_proxy: docker.io/httpd:2.4 memory_init: docker.io/openstackhelm/heat:newton - curator: docker.io/bobrik/curator:5.2.0 + curator: docker.io/bobrik/curator:5.6.0 elasticsearch: docker.io/srwilkers/elasticsearch-s3:v0.1.0 ceph_key_placement: docker.io/port/ceph-config-helper:v1.10.3 s3_bucket: docker.io/openstackhelm/ceph-daemon:latest @@ -755,8 +755,10 @@ storage: manifests: - configmap_bin: true - configmap_etc: true + configmap_bin_curator: true + configmap_bin_elasticsearch: true + configmap_etc_curator: true + configmap_etc_elasticsearch: true cron_curator: true deployment_client: true deployment_master: true