From 66abbf2377830ba81943693ee5a556034a84a36d Mon Sep 17 00:00:00 2001 From: Netanel Koli Date: Tue, 15 Nov 2022 22:28:35 +0200 Subject: [PATCH 1/2] Upgrade to elastic 8.5.0 and keep using http --- .../storage/elasticsearch/configMap.yaml | 13 +++++++++ .../storage/elasticsearch/elasticsearch.yaml | 27 +++++++++++++++++-- values.yaml | 7 +++++ 3 files changed, 45 insertions(+), 2 deletions(-) create mode 100644 templates/storage/elasticsearch/configMap.yaml diff --git a/templates/storage/elasticsearch/configMap.yaml b/templates/storage/elasticsearch/configMap.yaml new file mode 100644 index 0000000..764e6cd --- /dev/null +++ b/templates/storage/elasticsearch/configMap.yaml @@ -0,0 +1,13 @@ +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "finala.fullname" . }}-elasticsearch-config + labels: + chart: "{{ .Chart.Name }}" + app: "{{ include "finala.fullname" . }}-elasticsearch" +data: +{{- range $path, $config := .Values.storage.esConfig }} + {{ $path }}: | +{{ $config | indent 4 -}} +{{- end -}} \ No newline at end of file diff --git a/templates/storage/elasticsearch/elasticsearch.yaml b/templates/storage/elasticsearch/elasticsearch.yaml index da1f8f8..93bfc2b 100644 --- a/templates/storage/elasticsearch/elasticsearch.yaml +++ b/templates/storage/elasticsearch/elasticsearch.yaml @@ -15,9 +15,26 @@ spec: labels: component: {{ include "finala.fullname" . }}-elasticsearch spec: + volumes: + - name: esconfig + configMap: + name: {{ include "finala.fullname" . }}-elasticsearch-config + affinity: + nodeAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + nodeSelectorTerms: + - matchExpressions: + - key: NodeType + operator: In + values: + - gitops + tolerations: + - key: "gitops" + value: "true" + effect: "NoSchedule" containers: - name: {{ include "finala.fullname" . }}-elasticsearch - image: docker.elastic.co/elasticsearch/elasticsearch:7.7.0 + image: docker.elastic.co/elasticsearch/elasticsearch:8.5.0 env: - name: discovery.type value: single-node @@ -29,4 +46,10 @@ spec: requests: cpu: 500m memory: 1Gi -{{- end }} + volumeMounts: + {{- range $path, $config := .Values.storage.esConfig }} + - name: esconfig + mountPath: /usr/share/elasticsearch/config/{{ $path }} + subPath: {{ $path }} + {{- end -}} +{{- end }} \ No newline at end of file diff --git a/values.yaml b/values.yaml index f48bfbb..d811ba0 100644 --- a/values.yaml +++ b/values.yaml @@ -13,6 +13,13 @@ fullnameOverride: "" storage: type: internal + # Elasticsearch application configurations for http access. Remove for https and add other configurations. Example: https://github.com/elastic/helm-charts/blob/7.17/elasticsearch/examples/security/values.yaml + esConfig: + elasticsearch.yml: | + network.host: 0.0.0.0 + xpack.security.enabled: false + xpack.security.http.ssl.enabled: false + xpack.security.transport.ssl.enabled: false api: create: true From 4fce7cc7a28461d5b4b9545e0f3dde14da1a552e Mon Sep 17 00:00:00 2001 From: Netanel Koli Date: Tue, 15 Nov 2022 22:29:48 +0200 Subject: [PATCH 2/2] Upgrade to elastic 8.5.0 and keep using http --- templates/storage/elasticsearch/elasticsearch.yaml | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/templates/storage/elasticsearch/elasticsearch.yaml b/templates/storage/elasticsearch/elasticsearch.yaml index 93bfc2b..a9efff8 100644 --- a/templates/storage/elasticsearch/elasticsearch.yaml +++ b/templates/storage/elasticsearch/elasticsearch.yaml @@ -19,19 +19,6 @@ spec: - name: esconfig configMap: name: {{ include "finala.fullname" . }}-elasticsearch-config - affinity: - nodeAffinity: - requiredDuringSchedulingIgnoredDuringExecution: - nodeSelectorTerms: - - matchExpressions: - - key: NodeType - operator: In - values: - - gitops - tolerations: - - key: "gitops" - value: "true" - effect: "NoSchedule" containers: - name: {{ include "finala.fullname" . }}-elasticsearch image: docker.elastic.co/elasticsearch/elasticsearch:8.5.0