From 0af86b2dbfa01a4f5ab11f708aae91119cb4713b Mon Sep 17 00:00:00 2001 From: "Thomas Hesse (THES) [EXT]" Date: Tue, 6 Feb 2024 18:07:47 +0100 Subject: [PATCH 1/5] Add resource settings and storage size setting for Elasticsearch --- apigateway/helm/templates/elasticsearch.yaml | 16 ++++++++++++++++ apigateway/helm/values.yaml | 13 +++++++++++++ 2 files changed, 29 insertions(+) diff --git a/apigateway/helm/templates/elasticsearch.yaml b/apigateway/helm/templates/elasticsearch.yaml index 82d5ddb..d9b3f8f 100644 --- a/apigateway/helm/templates/elasticsearch.yaml +++ b/apigateway/helm/templates/elasticsearch.yaml @@ -69,6 +69,18 @@ spec: # use default node set - name: default count: {{ .Values.elasticsearch.defaultNodeSet.count }} + {{- if .Values.elasticsearch.storage }} + volumeClaimTemplates: + - metadata: + name: elasticsearch-data # Do not change this name unless you set up a volume mount for the data path. + spec: + accessModes: + - ReadWriteOnce + resources: + requests: + storage: {{ .Values.elasticsearch.storage }} + storageClassName: standard + {{- end }} config: {{- if not .Values.elasticsearch.defaultNodeSet.memoryMapping }} node.store.allow_mmap: false @@ -86,6 +98,10 @@ spec: spec: imagePullSecrets: {{- toYaml .Values.imagePullSecrets | nindent 12 }} + containers: + - name: elasticsearch + resources: + {{- toYaml .Values.elasticsearch.resources | nindent 14 }} initContainers: {{- if and .Values.elasticsearch.defaultNodeSet.setMaxMapCount .Values.elasticsearch.defaultNodeSet.memoryMapping }} - name: sysctl diff --git a/apigateway/helm/values.yaml b/apigateway/helm/values.yaml index 400f9d3..b1d96b5 100644 --- a/apigateway/helm/values.yaml +++ b/apigateway/helm/values.yaml @@ -474,6 +474,19 @@ elasticsearch: # Make sure that the image corresponds to the version field. image: + # -- Resource Settings for Elasticsearch + # Example: + # + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + resources: {} + + storage: "" + # -- The secret name that holds the sag es user for API Gateway. secretName: "" From fe767782f4f7adb8766969ecea01e1a661a57eea Mon Sep 17 00:00:00 2001 From: "Thomas Hesse (THES) [EXT]" Date: Tue, 6 Feb 2024 18:13:58 +0100 Subject: [PATCH 2/5] Add value for storageClassName, change name for default node set --- apigateway/helm/templates/elasticsearch.yaml | 4 ++-- apigateway/helm/values.yaml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apigateway/helm/templates/elasticsearch.yaml b/apigateway/helm/templates/elasticsearch.yaml index d9b3f8f..8bb1b3f 100644 --- a/apigateway/helm/templates/elasticsearch.yaml +++ b/apigateway/helm/templates/elasticsearch.yaml @@ -67,7 +67,7 @@ spec: {{- toYaml .Values.elasticsearch.nodeSets | nindent 4 }} {{ else }} # use default node set - - name: default + - name: default2 count: {{ .Values.elasticsearch.defaultNodeSet.count }} {{- if .Values.elasticsearch.storage }} volumeClaimTemplates: @@ -79,7 +79,7 @@ spec: resources: requests: storage: {{ .Values.elasticsearch.storage }} - storageClassName: standard + storageClassName: {{ default "standard" .Values.elasticsearch.storageClassName }} {{- end }} config: {{- if not .Values.elasticsearch.defaultNodeSet.memoryMapping }} diff --git a/apigateway/helm/values.yaml b/apigateway/helm/values.yaml index b1d96b5..6dee250 100644 --- a/apigateway/helm/values.yaml +++ b/apigateway/helm/values.yaml @@ -486,6 +486,7 @@ elasticsearch: resources: {} storage: "" + storageClassName: "" # -- The secret name that holds the sag es user for API Gateway. secretName: "" From 84724601ea540656b0ad9eda22ec0ba09c6075be Mon Sep 17 00:00:00 2001 From: "Thomas Hesse (THES) [EXT]" Date: Tue, 6 Feb 2024 18:16:39 +0100 Subject: [PATCH 3/5] Set default value for storage --- apigateway/helm/templates/elasticsearch.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/apigateway/helm/templates/elasticsearch.yaml b/apigateway/helm/templates/elasticsearch.yaml index 8bb1b3f..30b8f72 100644 --- a/apigateway/helm/templates/elasticsearch.yaml +++ b/apigateway/helm/templates/elasticsearch.yaml @@ -69,7 +69,6 @@ spec: # use default node set - name: default2 count: {{ .Values.elasticsearch.defaultNodeSet.count }} - {{- if .Values.elasticsearch.storage }} volumeClaimTemplates: - metadata: name: elasticsearch-data # Do not change this name unless you set up a volume mount for the data path. @@ -78,9 +77,8 @@ spec: - ReadWriteOnce resources: requests: - storage: {{ .Values.elasticsearch.storage }} + storage: {{ default "1Gi" .Values.elasticsearch.storage }} storageClassName: {{ default "standard" .Values.elasticsearch.storageClassName }} - {{- end }} config: {{- if not .Values.elasticsearch.defaultNodeSet.memoryMapping }} node.store.allow_mmap: false From 9a69900cb3af170b6fdd582fcd743cc36efe584e Mon Sep 17 00:00:00 2001 From: "Thomas Hesse (THES) [EXT]" Date: Tue, 6 Feb 2024 18:38:26 +0100 Subject: [PATCH 4/5] Fix default storageClassName --- apigateway/helm/templates/elasticsearch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apigateway/helm/templates/elasticsearch.yaml b/apigateway/helm/templates/elasticsearch.yaml index 30b8f72..85d7215 100644 --- a/apigateway/helm/templates/elasticsearch.yaml +++ b/apigateway/helm/templates/elasticsearch.yaml @@ -78,7 +78,7 @@ spec: resources: requests: storage: {{ default "1Gi" .Values.elasticsearch.storage }} - storageClassName: {{ default "standard" .Values.elasticsearch.storageClassName }} + storageClassName: {{ default "default" .Values.elasticsearch.storageClassName }} config: {{- if not .Values.elasticsearch.defaultNodeSet.memoryMapping }} node.store.allow_mmap: false From 566e097dd02a40c050f26db357da4e89b401c904 Mon Sep 17 00:00:00 2001 From: "Thomas Hesse (THES) [EXT]" Date: Tue, 6 Feb 2024 19:02:32 +0100 Subject: [PATCH 5/5] Revert back to default as default node set name --- apigateway/helm/templates/elasticsearch.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apigateway/helm/templates/elasticsearch.yaml b/apigateway/helm/templates/elasticsearch.yaml index 85d7215..771d9da 100644 --- a/apigateway/helm/templates/elasticsearch.yaml +++ b/apigateway/helm/templates/elasticsearch.yaml @@ -67,7 +67,7 @@ spec: {{- toYaml .Values.elasticsearch.nodeSets | nindent 4 }} {{ else }} # use default node set - - name: default2 + - name: default count: {{ .Values.elasticsearch.defaultNodeSet.count }} volumeClaimTemplates: - metadata: