Rename elasticsearch configmaps and provide config via toYaml

This brings the elasticsearch configmaps, volume and mount names
inline with other charts by naming them after the service.

This also moves the configuration for elasticsearch to the values
file to bring it inline with other charts that do the same

Change-Id: I61f7c740d830a9a0567f8b72a0f815a09407b90c
This commit is contained in:
Steve Wilkerson 2017-12-28 10:52:54 -06:00
parent 45ba95a2de
commit 9b32ba17f4
11 changed files with 87 additions and 122 deletions

View File

@ -20,7 +20,7 @@ limitations under the License.
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: elastic-bin name: elasticsearch-bin
data: data:
elasticsearch.sh: | elasticsearch.sh: |
{{ tuple "bin/_elasticsearch.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }} {{ tuple "bin/_elasticsearch.sh.tpl" . | include "helm-toolkit.utils.template" | indent 4 }}

View File

@ -20,14 +20,14 @@ limitations under the License.
apiVersion: v1 apiVersion: v1
kind: ConfigMap kind: ConfigMap
metadata: metadata:
name: elastic-etc name: elasticsearch-etc
data: data:
elasticsearch.yml: |+ elasticsearch.yml: |+
{{- tuple .Values.conf.elasticsearch "etc/_elasticsearch.yml.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{ toYaml .Values.conf.elasticsearch.config | indent 4 }}
log4j2.properties: |+ log4j2.properties: |+
{{- tuple .Values.conf.elasticsearch "etc/_log4j2.properties.tpl" . | include "helm-toolkit.utils.configmap_templater" }} {{- tuple .Values.conf.elasticsearch "etc/_log4j2.properties.tpl" . | include "helm-toolkit.utils.configmap_templater" }}
action_file.yml: |- action_file.yml: |+
{{ toYaml .Values.conf.curator.action_file | indent 4 }} {{ toYaml .Values.conf.curator.action_file | indent 4 }}
config.yml: |- config.yml: |+
{{ toYaml .Values.conf.curator.config | indent 4 }} {{ toYaml .Values.conf.curator.config | indent 4 }}
{{- end }} {{- end }}

View File

@ -48,28 +48,28 @@ spec:
volumeMounts: volumeMounts:
- name: pod-etc-curator - name: pod-etc-curator
mountPath: /etc/config mountPath: /etc/config
- name: elastic-bin - name: elasticsearch-bin
mountPath: /tmp/curator.sh mountPath: /tmp/curator.sh
subPath: curator.sh subPath: curator.sh
readOnly: true readOnly: true
- name: elastic-etc - name: elasticsearch-etc
mountPath: /etc/config/config.yml mountPath: /etc/config/config.yml
subPath: config.yml subPath: config.yml
readOnly: true readOnly: true
- name: elastic-etc - name: elasticsearch-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
volumes: volumes:
- name: pod-etc-curator - name: pod-etc-curator
emptyDir: {} emptyDir: {}
- name: elastic-bin - name: elasticsearch-bin
configMap: configMap:
name: elastic-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
- name: elastic-etc - name: elasticsearch-etc
configMap: configMap:
name: elastic-etc name: elasticsearch-etc
defaultMode: 0444 defaultMode: 0444
{{- end }} {{- end }}
{{- end }} {{- end }}

View File

@ -110,41 +110,41 @@ spec:
- name: ES_JAVA_OPTS - name: ES_JAVA_OPTS
value: "{{ .Values.conf.elasticsearch.env.java_opts }}" value: "{{ .Values.conf.elasticsearch.env.java_opts }}"
volumeMounts: volumeMounts:
- name: elastic-logs - name: elasticsearch-logs
mountPath: {{ .Values.conf.elasticsearch.path.logs }} mountPath: {{ .Values.conf.elasticsearch.config.path.logs }}
- name: elastic-bin - name: elasticsearch-bin
mountPath: /tmp/elasticsearch.sh mountPath: /tmp/elasticsearch.sh
subPath: elasticsearch.sh subPath: elasticsearch.sh
readOnly: true readOnly: true
- name: elastic-config - name: elasticsearch-config
mountPath: /usr/share/elasticsearch/config mountPath: /usr/share/elasticsearch/config
- name: elastic-etc - name: elasticsearch-etc
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
subPath: elasticsearch.yml subPath: elasticsearch.yml
readOnly: true readOnly: true
- name: elastic-etc - name: elasticsearch-etc
mountPath: /usr/share/elasticsearch/config/log4j2.properties mountPath: /usr/share/elasticsearch/config/log4j2.properties
subPath: log4j2.properties subPath: log4j2.properties
readOnly: true readOnly: true
- name: storage - name: storage
mountPath: {{ .Values.conf.elasticsearch.path.data }} mountPath: {{ .Values.conf.elasticsearch.config.path.data }}
{{ if .Values.storage.filesystem_repository.enabled }} {{ if .Values.storage.filesystem_repository.enabled }}
- name: snapshots - name: snapshots
mountPath: {{ .Values.conf.elasticsearch.path.repo }} mountPath: {{ .Values.conf.elasticsearch.config.path.repo }}
{{ end }} {{ end }}
{{ if $mounts_elasticsearch.volumeMounts }}{{ toYaml $mounts_elasticsearch.volumeMounts | indent 12 }}{{ end }} {{ if $mounts_elasticsearch.volumeMounts }}{{ toYaml $mounts_elasticsearch.volumeMounts | indent 12 }}{{ end }}
volumes: volumes:
- name: elastic-logs - name: elasticsearch-logs
emptyDir: {} emptyDir: {}
- name: elastic-bin - name: elasticsearch-bin
configMap: configMap:
name: elastic-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
- name: elastic-config - name: elasticsearch-config
emptyDir: {} emptyDir: {}
- name: elastic-etc - name: elasticsearch-etc
configMap: configMap:
name: elastic-etc name: elasticsearch-etc
defaultMode: 0444 defaultMode: 0444
- name: storage - name: storage
emptyDir: {} emptyDir: {}

View File

@ -104,41 +104,41 @@ spec:
- name: ES_JAVA_OPTS - name: ES_JAVA_OPTS
value: "{{ .Values.conf.elasticsearch.env.java_opts }}" value: "{{ .Values.conf.elasticsearch.env.java_opts }}"
volumeMounts: volumeMounts:
- name: elastic-logs - name: elasticsearch-logs
mountPath: {{ .Values.conf.elasticsearch.path.logs }} mountPath: {{ .Values.conf.elasticsearch.config.path.logs }}
- name: elastic-bin - name: elasticsearch-bin
mountPath: /tmp/elasticsearch.sh mountPath: /tmp/elasticsearch.sh
subPath: elasticsearch.sh subPath: elasticsearch.sh
readOnly: true readOnly: true
- name: elastic-config - name: elasticsearch-config
mountPath: /usr/share/elasticsearch/config mountPath: /usr/share/elasticsearch/config
- name: elastic-etc - name: elasticsearch-etc
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
subPath: elasticsearch.yml subPath: elasticsearch.yml
readOnly: true readOnly: true
- name: elastic-etc - name: elasticsearch-etc
mountPath: /usr/share/elasticsearch/config/log4j2.properties mountPath: /usr/share/elasticsearch/config/log4j2.properties
subPath: log4j2.properties subPath: log4j2.properties
readOnly: true readOnly: true
- name: storage - name: storage
mountPath: {{ .Values.conf.elasticsearch.path.data }} mountPath: {{ .Values.conf.elasticsearch.config.path.data }}
{{ if .Values.storage.filesystem_repository.enabled }} {{ if .Values.storage.filesystem_repository.enabled }}
- name: snapshots - name: snapshots
mountPath: {{ .Values.conf.elasticsearch.path.repo }} mountPath: {{ .Values.conf.elasticsearch.config.path.repo }}
{{ end }} {{ end }}
{{ if $mounts_elasticsearch.volumeMounts }}{{ toYaml $mounts_elasticsearch.volumeMounts | indent 12 }}{{ end }} {{ if $mounts_elasticsearch.volumeMounts }}{{ toYaml $mounts_elasticsearch.volumeMounts | indent 12 }}{{ end }}
volumes: volumes:
- name: elastic-logs - name: elasticsearch-logs
emptyDir: {} emptyDir: {}
- name: elastic-bin - name: elasticsearch-bin
configMap: configMap:
name: elastic-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
- name: elastic-config - name: elasticsearch-config
emptyDir: {} emptyDir: {}
- name: elastic-etc - name: elasticsearch-etc
configMap: configMap:
name: elastic-etc name: elasticsearch-etc
defaultMode: 0444 defaultMode: 0444
- name: storage - name: storage
emptyDir: {} emptyDir: {}

View File

@ -1,43 +0,0 @@
{{/*
Copyright 2017 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.
*/}}
cluster:
name: {{ .Values.conf.elasticsearch.cluster.name }}
node:
master: ${NODE_MASTER}
data: ${NODE_DATA}
name: ${NODE_NAME}
max_local_storage_nodes: {{ .Values.pod.replicas.data }}
network.host: {{ .Values.conf.elasticsearch.network.host }}
path:
data: {{ .Values.conf.elasticsearch.path.data }}
logs: {{ .Values.conf.elasticsearch.path.logs }}
repo: {{ .Values.conf.elasticsearch.path.repo }}
bootstrap:
memory_lock: {{ .Values.conf.elasticsearch.bootstrap.memory_lock }}
http:
enabled: ${HTTP_ENABLE}
compression: true
discovery:
zen:
ping.unicast.hosts: ${DISCOVERY_SERVICE}
minimum_master_nodes: {{ .Values.conf.elasticsearch.zen.min_masters }}

View File

@ -50,16 +50,16 @@ spec:
command: command:
- /tmp/image-repo-sync.sh - /tmp/image-repo-sync.sh
volumeMounts: volumeMounts:
- name: elastic-bin - name: elasticsearch-bin
mountPath: /tmp/image-repo-sync.sh mountPath: /tmp/image-repo-sync.sh
subPath: image-repo-sync.sh subPath: image-repo-sync.sh
readOnly: true readOnly: true
- name: docker-socket - name: docker-socket
mountPath: /var/run/docker.sock mountPath: /var/run/docker.sock
volumes: volumes:
- name: elastic-bin - name: elasticsearch-bin
configMap: configMap:
name: elastic-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
- name: docker-socket - name: docker-socket
hostPath: hostPath:

View File

@ -49,17 +49,17 @@ spec:
- name: REPO_TYPE - name: REPO_TYPE
value: {{ .Values.conf.elasticsearch.repository.type | quote }} value: {{ .Values.conf.elasticsearch.repository.type | quote }}
- name: REPO_LOCATION - name: REPO_LOCATION
value: {{ .Values.conf.elasticsearch.path.repo | quote }} value: {{ .Values.conf.elasticsearch.config.path.repo | quote }}
command: command:
- /tmp/register-repository.sh - /tmp/register-repository.sh
volumeMounts: volumeMounts:
- name: elastic-bin - name: elasticsearch-bin
mountPath: /tmp/register-repository.sh mountPath: /tmp/register-repository.sh
subPath: register-repository.sh subPath: register-repository.sh
readOnly: true readOnly: true
volumes: volumes:
- name: elastic-bin - name: elasticsearch-bin
configMap: configMap:
name: elastic-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
{{- end }} {{- end }}

View File

@ -35,13 +35,13 @@ spec:
- name: ELASTICSEARCH_ENDPOINT - name: ELASTICSEARCH_ENDPOINT
value: {{ tuple "elasticsearch" "internal" "client" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }} value: {{ tuple "elasticsearch" "internal" "client" . | include "helm-toolkit.endpoints.host_and_port_endpoint_uri_lookup" }}
volumeMounts: volumeMounts:
- name: elastic-bin - name: elasticsearch-bin
mountPath: /tmp/helm-tests.sh mountPath: /tmp/helm-tests.sh
subPath: helm-tests.sh subPath: helm-tests.sh
readOnly: true readOnly: true
volumes: volumes:
- name: elastic-bin - name: elasticsearch-bin
configMap: configMap:
name: elastic-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
{{- end }} {{- end }}

View File

@ -101,41 +101,41 @@ spec:
- name: DISCOVERY_SERVICE - name: DISCOVERY_SERVICE
value: {{ tuple "elasticsearch" "discovery" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }} value: {{ tuple "elasticsearch" "discovery" $envAll | include "helm-toolkit.endpoints.hostname_short_endpoint_lookup" }}
volumeMounts: volumeMounts:
- name: elastic-logs - name: elasticsearch-logs
mountPath: {{ .Values.conf.elasticsearch.path.logs }} mountPath: {{ .Values.conf.elasticsearch.config.path.logs }}
- name: elastic-bin - name: elasticsearch-bin
mountPath: /tmp/elasticsearch.sh mountPath: /tmp/elasticsearch.sh
subPath: elasticsearch.sh subPath: elasticsearch.sh
readOnly: true readOnly: true
- name: elastic-config - name: elasticsearch-config
mountPath: /usr/share/elasticsearch/config mountPath: /usr/share/elasticsearch/config
- name: elastic-etc - name: elasticsearch-etc
mountPath: /usr/share/elasticsearch/config/elasticsearch.yml mountPath: /usr/share/elasticsearch/config/elasticsearch.yml
subPath: elasticsearch.yml subPath: elasticsearch.yml
readOnly: true readOnly: true
- name: elastic-etc - name: elasticsearch-etc
mountPath: /usr/share/elasticsearch/config/log4j2.properties mountPath: /usr/share/elasticsearch/config/log4j2.properties
subPath: log4j2.properties subPath: log4j2.properties
readOnly: true readOnly: true
{{ if .Values.storage.filesystem_repository.enabled }} {{ if .Values.storage.filesystem_repository.enabled }}
- name: snapshots - name: snapshots
mountPath: {{ .Values.conf.elasticsearch.path.repo }} mountPath: {{ .Values.conf.elasticsearch.config.path.repo }}
{{ end }} {{ end }}
- name: storage - name: storage
mountPath: {{ .Values.conf.elasticsearch.path.data }} mountPath: {{ .Values.conf.elasticsearch.config.path.data }}
{{ if $mounts_elasticsearch.volumeMounts }}{{ toYaml $mounts_elasticsearch.volumeMounts | indent 12 }}{{ end }} {{ if $mounts_elasticsearch.volumeMounts }}{{ toYaml $mounts_elasticsearch.volumeMounts | indent 12 }}{{ end }}
volumes: volumes:
- name: elastic-logs - name: elasticsearch-logs
emptyDir: {} emptyDir: {}
- name: elastic-bin - name: elasticsearch-bin
configMap: configMap:
name: elastic-bin name: elasticsearch-bin
defaultMode: 0555 defaultMode: 0555
- name: elastic-config - name: elasticsearch-config
emptyDir: {} emptyDir: {}
- name: elastic-etc - name: elasticsearch-etc
configMap: configMap:
name: elastic-etc name: elasticsearch-etc
defaultMode: 0444 defaultMode: 0444
{{ if .Values.storage.filesystem_repository.enabled }} {{ if .Values.storage.filesystem_repository.enabled }}
- name: snapshots - name: snapshots

View File

@ -224,24 +224,32 @@ conf:
logformat: default logformat: default
blacklist: ['elasticsearch', 'urllib3'] blacklist: ['elasticsearch', 'urllib3']
elasticsearch: elasticsearch:
override: config:
prefix: bootstrap:
append: memory_lock: true
bootstrap: cluster:
memory_lock: true name: elasticsearch
cluster: discovery:
name: elasticsearch zen:
network: ping.unicast.hosts: ${DISCOVERY_SERVICE}
host: 0.0.0.0 minimum_master_nodes: 2
path: http:
data: /usr/share/elasticsearch/data enabled: ${HTTP_ENABLE}
logs: /usr/share/elasticsearch/logs compression: true
repo: /usr/share/elasticsearch/repo network:
host: 0.0.0.0
node:
master: ${NODE_MASTER}
data: ${NODE_DATA}
name: ${NODE_NAME}
max_local_storage_nodes: 3
path:
data: /usr/share/elasticsearch/data
logs: /usr/share/elasticsearch/logs
repo: /var/lib/openstack-helm/elasticsearch
repository: repository:
name: default_repo name: default_repo
type: fs type: fs
zen:
min_masters: 2
env: env:
java_opts: "-Xms256m -Xmx256m" java_opts: "-Xms256m -Xmx256m"
log4j2: log4j2: