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
This commit is contained in:
Steve Wilkerson 2019-05-09 10:22:25 -05:00
parent 22dcebb93d
commit 88f21acf34
10 changed files with 79 additions and 22 deletions

View File

@ -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 }}

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.configmap_bin }} {{- if .Values.manifests.configmap_bin_elasticsearch }}
{{- $envAll := . }} {{- $envAll := . }}
--- ---
apiVersion: v1 apiVersion: v1
@ -36,8 +36,6 @@ data:
{{- include "helm-toolkit.scripts.create_s3_user" . | indent 4 }} {{- include "helm-toolkit.scripts.create_s3_user" . | indent 4 }}
register-repository.sh: | register-repository.sh: |
{{ tuple "bin/_register-repository.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ 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: | es-cluster-wait.sh: |
{{ tuple "bin/_es-cluster-wait.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "bin/_es-cluster-wait.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}
image-repo-sync.sh: | image-repo-sync.sh: |

View File

@ -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 }}

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. limitations under the License.
*/}} */}}
{{- if .Values.manifests.configmap_etc }} {{- if .Values.manifests.configmap_etc_elasticsearch }}
{{- $envAll := . }} {{- $envAll := . }}
{{- if empty .Values.conf.elasticsearch.config.cloud.aws.access_key -}} {{- if empty .Values.conf.elasticsearch.config.cloud.aws.access_key -}}
@ -43,8 +43,6 @@ metadata:
type: Opaque type: Opaque
data: data:
elasticsearch.yml: {{ toYaml .Values.conf.elasticsearch.config | b64enc }} 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. #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.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 }} {{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.log4j2 "key" "log4j2.properties" "format" "Secret") | indent 2 }}

View File

@ -63,15 +63,15 @@ spec:
mountPath: /tmp mountPath: /tmp
- name: pod-etc-curator - name: pod-etc-curator
mountPath: /etc/config mountPath: /etc/config
- name: elasticsearch-bin - name: elastic-curator-bin
mountPath: /tmp/curator.sh mountPath: /tmp/curator.sh
subPath: curator.sh subPath: curator.sh
readOnly: true readOnly: true
- name: elasticsearch-etc - name: elastic-curator-etc
mountPath: /etc/config/config.yml mountPath: /etc/config/config.yml
subPath: config.yml subPath: config.yml
readOnly: true readOnly: true
- name: elasticsearch-etc - name: elastic-curator-etc
mountPath: /etc/config/action_file.yml mountPath: /etc/config/action_file.yml
subPath: action_file.yml subPath: action_file.yml
readOnly: true readOnly: true
@ -80,12 +80,12 @@ spec:
emptyDir: {} emptyDir: {}
- name: pod-etc-curator - name: pod-etc-curator
emptyDir: {} emptyDir: {}
- name: elasticsearch-bin - name: elastic-curator-bin
configMap: configMap:
name: elasticsearch-bin name: elastic-curator-bin
defaultMode: 0555 defaultMode: 0555
- name: elasticsearch-etc - name: elastic-curator-etc
secret: secret:
secretName: elasticsearch-etc secretName: elastic-curator-etc
defaultMode: 0444 defaultMode: 0444
{{- end }} {{- end }}

View File

@ -79,8 +79,8 @@ spec:
{{ tuple $envAll "elasticsearch" "client" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} {{ tuple $envAll "elasticsearch" "client" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations: annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | 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-bin-hash: {{ tuple "configmap-bin-elasticsearch.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.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 }} {{ dict "envAll" $envAll "podName" "elasticsearch-client" "containerNames" (list "elasticsearch-client") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec: spec:
{{ dict "envAll" $envAll "application" "client" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} {{ dict "envAll" $envAll "application" "client" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}

View File

@ -77,8 +77,8 @@ spec:
{{ tuple $envAll "elasticsearch" "master" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }} {{ tuple $envAll "elasticsearch" "master" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 8 }}
annotations: annotations:
{{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | 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-bin-hash: {{ tuple "configmap-bin-elasticsearch.yaml" . | include "helm-toolkit.utils.hash" }}
configmap-etc-hash: {{ tuple "configmap-etc.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 }} {{ dict "envAll" $envAll "podName" "elasticsearch-master" "containerNames" (list "elasticsearch-master") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }}
spec: spec:
{{ dict "envAll" $envAll "application" "master" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} {{ dict "envAll" $envAll "application" "master" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}

View File

@ -28,6 +28,7 @@ spec:
{{- if .Values.network.elasticsearch.node_port.enabled }} {{- if .Values.network.elasticsearch.node_port.enabled }}
nodePort: {{ .Values.network.elasticsearch.node_port.port }} nodePort: {{ .Values.network.elasticsearch.node_port.port }}
{{- end }} {{- end }}
type: LoadBalancer
selector: selector:
{{ tuple $envAll "elasticsearch" "client" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} {{ tuple $envAll "elasticsearch" "client" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }}
{{- if .Values.network.elasticsearch.node_port.enabled }} {{- if .Values.network.elasticsearch.node_port.enabled }}

View File

@ -78,8 +78,8 @@ spec:
annotations: annotations:
{{ dict "envAll" $envAll "podName" "elasticsearch-data" "containerNames" (list "elasticsearch-data") | include "helm-toolkit.snippets.kubernetes_mandatory_access_control_annotation" | indent 8 }} {{ 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 }} {{ tuple $envAll | include "helm-toolkit.snippets.release_uuid" | indent 8 }}
configmap-bin-hash: {{ tuple "configmap-bin.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.yaml" . | include "helm-toolkit.utils.hash" }} configmap-etc-hash: {{ tuple "configmap-etc-elasticsearch.yaml" . | include "helm-toolkit.utils.hash" }}
spec: spec:
{{ dict "envAll" $envAll "application" "data" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }} {{ dict "envAll" $envAll "application" "data" | include "helm-toolkit.snippets.kubernetes_pod_security_context" | indent 6 }}
serviceAccountName: {{ $serviceAccountName }} serviceAccountName: {{ $serviceAccountName }}

View File

@ -20,7 +20,7 @@ images:
tags: tags:
apache_proxy: docker.io/httpd:2.4 apache_proxy: docker.io/httpd:2.4
memory_init: docker.io/openstackhelm/heat:newton 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 elasticsearch: docker.io/srwilkers/elasticsearch-s3:v0.1.0
ceph_key_placement: docker.io/port/ceph-config-helper:v1.10.3 ceph_key_placement: docker.io/port/ceph-config-helper:v1.10.3
s3_bucket: docker.io/openstackhelm/ceph-daemon:latest s3_bucket: docker.io/openstackhelm/ceph-daemon:latest
@ -755,8 +755,10 @@ storage:
manifests: manifests:
configmap_bin: true configmap_bin_curator: true
configmap_etc: true configmap_bin_elasticsearch: true
configmap_etc_curator: true
configmap_etc_elasticsearch: true
cron_curator: true cron_curator: true
deployment_client: true deployment_client: true
deployment_master: true deployment_master: true