diff --git a/elasticsearch/templates/configmap-etc.yaml b/elasticsearch/templates/configmap-etc.yaml index f9c1cbfce..f77f99722 100644 --- a/elasticsearch/templates/configmap-etc.yaml +++ b/elasticsearch/templates/configmap-etc.yaml @@ -16,6 +16,10 @@ limitations under the License. {{- if .Values.manifests.configmap_etc }} {{- $envAll := . }} + +{{- if and (.Values.conf.elasticsearch.repository.enabled) (empty .Values.conf.elasticsearch.config.path.repo) -}} +{{- set .Values.conf.elasticsearch.config.path "repo" .Values.conf.elasticsearch.repository.location -}} +{{- end -}} --- apiVersion: v1 kind: ConfigMap diff --git a/elasticsearch/templates/deployment-client.yaml b/elasticsearch/templates/deployment-client.yaml index 2c1f1116b..12fbab38b 100644 --- a/elasticsearch/templates/deployment-client.yaml +++ b/elasticsearch/templates/deployment-client.yaml @@ -130,7 +130,7 @@ spec: mountPath: {{ .Values.conf.elasticsearch.config.path.data }} {{ if .Values.storage.filesystem_repository.enabled }} - name: snapshots - mountPath: {{ .Values.conf.elasticsearch.config.path.repo }} + mountPath: {{ .Values.conf.elasticsearch.repository.location }} {{ end }} {{ if $mounts_elasticsearch.volumeMounts }}{{ toYaml $mounts_elasticsearch.volumeMounts | indent 12 }}{{ end }} volumes: diff --git a/elasticsearch/templates/deployment-master.yaml b/elasticsearch/templates/deployment-master.yaml index 487790368..7564224f4 100644 --- a/elasticsearch/templates/deployment-master.yaml +++ b/elasticsearch/templates/deployment-master.yaml @@ -124,7 +124,7 @@ spec: mountPath: {{ .Values.conf.elasticsearch.config.path.data }} {{ if .Values.storage.filesystem_repository.enabled }} - name: snapshots - mountPath: {{ .Values.conf.elasticsearch.config.path.repo }} + mountPath: {{ .Values.conf.elasticsearch.repository.location }} {{ end }} {{ if $mounts_elasticsearch.volumeMounts }}{{ toYaml $mounts_elasticsearch.volumeMounts | indent 12 }}{{ end }} volumes: diff --git a/elasticsearch/templates/job-register-snapshot-repository.yaml b/elasticsearch/templates/job-register-snapshot-repository.yaml index 30860c3c2..ca7c5143b 100644 --- a/elasticsearch/templates/job-register-snapshot-repository.yaml +++ b/elasticsearch/templates/job-register-snapshot-repository.yaml @@ -15,6 +15,7 @@ limitations under the License. */}} {{- if .Values.manifests.job_snapshot_repository }} +{{- if .Values.conf.elasticsearch.repository.enabled }} {{- $envAll := . }} {{- $_ := set .Values "pod_dependency" .Values.dependencies.snapshot_repository -}} @@ -49,7 +50,7 @@ spec: - name: REPO_TYPE value: {{ .Values.conf.elasticsearch.repository.type | quote }} - name: REPO_LOCATION - value: {{ .Values.conf.elasticsearch.config.path.repo | quote }} + value: {{ .Values.conf.elasticsearch.repository.location | quote }} command: - /tmp/register-repository.sh volumeMounts: @@ -63,3 +64,4 @@ spec: name: elasticsearch-bin defaultMode: 0555 {{- end }} +{{- end }} diff --git a/elasticsearch/templates/statefulset-data.yaml b/elasticsearch/templates/statefulset-data.yaml index b2d019661..ae631a3e6 100644 --- a/elasticsearch/templates/statefulset-data.yaml +++ b/elasticsearch/templates/statefulset-data.yaml @@ -119,7 +119,7 @@ spec: readOnly: true {{ if .Values.storage.filesystem_repository.enabled }} - name: snapshots - mountPath: {{ .Values.conf.elasticsearch.config.path.repo }} + mountPath: {{ .Values.conf.elasticsearch.repository.location }} {{ end }} - name: storage mountPath: {{ .Values.conf.elasticsearch.config.path.data }} diff --git a/elasticsearch/values.yaml b/elasticsearch/values.yaml index 6e1dea5ef..8c9f23837 100644 --- a/elasticsearch/values.yaml +++ b/elasticsearch/values.yaml @@ -246,9 +246,10 @@ conf: path: data: /usr/share/elasticsearch/data logs: /usr/share/elasticsearch/logs - repo: /var/lib/openstack-helm/elasticsearch repository: + enabled: true name: default_repo + location: /var/lib/openstack-helm/elasticsearch type: fs env: java_opts: "-Xms256m -Xmx256m"