From 32fe6f7b7b5f8cc4cd5019c8f3d10bae65d16402 Mon Sep 17 00:00:00 2001 From: Guilherme Oki Date: Thu, 25 Jul 2024 16:08:20 -0300 Subject: [PATCH 1/2] feat(helm): add option to set resources for initHelper Signed-off-by: Guilherme Oki --- .../templates/opensearch-cluster-cr.yaml | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/charts/opensearch-cluster/templates/opensearch-cluster-cr.yaml b/charts/opensearch-cluster/templates/opensearch-cluster-cr.yaml index e08132ca..cef7b7d2 100644 --- a/charts/opensearch-cluster/templates/opensearch-cluster-cr.yaml +++ b/charts/opensearch-cluster/templates/opensearch-cluster-cr.yaml @@ -27,6 +27,27 @@ spec: imagePullSecrets: {{ toYaml .Values.opensearchCluster.initHelper.imagePullSecrets | nindent 6 }} {{- end }} + {{- if .Values.opensearchCluster.initHelper.resources }} + resources: + {{- if .Values.opensearchCluster.initHelper.resources.requests }} + requests: + {{- if .Values.opensearchCluster.initHelper.resources.requests.memory }} + memory: {{ .Values.opensearchCluster.initHelper.resources.requests.memory }} + {{- end }} + {{- if .Values.opensearchCluster.initHelper.resources.requests.cpu }} + cpu: {{ .Values.opensearchCluster.initHelper.resources.requests.cpu }} + {{- end }} + {{- end }} + {{- if .Values.opensearchCluster.initHelper.resources.limits }} + limits: + {{- if .Values.opensearchCluster.initHelper.resources.limits.memory }} + memory: {{ .Values.opensearchCluster.initHelper.resources.limits.memory }} + {{- end }} + {{- if .Values.opensearchCluster.initHelper.resources.limits.cpu }} + cpu: {{ .Values.opensearchCluster.initHelper.resources.limits.cpu }} + {{- end }} + {{- end }} + {{- end }} {{- end }} general: {{- if .Values.opensearchCluster.general.version }} From c4269ab239e260b91d3589a2d61a5c25745dffef Mon Sep 17 00:00:00 2001 From: Guilherme Oki Date: Mon, 12 Aug 2024 23:57:51 -0300 Subject: [PATCH 2/2] chore(helm): add initHelper struct in values.yaml Signed-off-by: Guilherme Oki --- .../templates/opensearch-cluster-cr.yaml | 19 +------------------ charts/opensearch-cluster/values.yaml | 11 +++++++++++ 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/charts/opensearch-cluster/templates/opensearch-cluster-cr.yaml b/charts/opensearch-cluster/templates/opensearch-cluster-cr.yaml index cef7b7d2..79f3b70b 100644 --- a/charts/opensearch-cluster/templates/opensearch-cluster-cr.yaml +++ b/charts/opensearch-cluster/templates/opensearch-cluster-cr.yaml @@ -29,24 +29,7 @@ spec: {{- end }} {{- if .Values.opensearchCluster.initHelper.resources }} resources: - {{- if .Values.opensearchCluster.initHelper.resources.requests }} - requests: - {{- if .Values.opensearchCluster.initHelper.resources.requests.memory }} - memory: {{ .Values.opensearchCluster.initHelper.resources.requests.memory }} - {{- end }} - {{- if .Values.opensearchCluster.initHelper.resources.requests.cpu }} - cpu: {{ .Values.opensearchCluster.initHelper.resources.requests.cpu }} - {{- end }} - {{- end }} - {{- if .Values.opensearchCluster.initHelper.resources.limits }} - limits: - {{- if .Values.opensearchCluster.initHelper.resources.limits.memory }} - memory: {{ .Values.opensearchCluster.initHelper.resources.limits.memory }} - {{- end }} - {{- if .Values.opensearchCluster.initHelper.resources.limits.cpu }} - cpu: {{ .Values.opensearchCluster.initHelper.resources.limits.cpu }} - {{- end }} - {{- end }} + {{- toYaml .Values.opensearchCluster.initHelper.resources | nindent 6 }} {{- end }} {{- end }} general: diff --git a/charts/opensearch-cluster/values.yaml b/charts/opensearch-cluster/values.yaml index c0cc622f..2841ea81 100644 --- a/charts/opensearch-cluster/values.yaml +++ b/charts/opensearch-cluster/values.yaml @@ -27,6 +27,17 @@ opensearchCluster: limits: memory: "1Gi" cpu: "500m" + initHelper: + imagePullSecrets: [] + # - registryKeySecretName + imagePullPolicy: IfNotPresent + resources: {} + # requests: + # memory: "1Gi" + # cpu: "500m" + # limits: + # memory: "1Gi" + # cpu: "500m" nodePools: - component: masters diskSize: "30Gi"