From abbb25e0e66a5b689349c56df1b02dab3d141350 Mon Sep 17 00:00:00 2001 From: Darshit Chanpura Date: Thu, 7 Dec 2023 11:42:27 -0500 Subject: [PATCH] Adds helm config capability to add custom admin password via txt file Signed-off-by: Darshit Chanpura --- charts/opensearch/templates/statefulset.yaml | 9 +++++++++ charts/opensearch/values.yaml | 4 ++++ 2 files changed, 13 insertions(+) diff --git a/charts/opensearch/templates/statefulset.yaml b/charts/opensearch/templates/statefulset.yaml index cae15317..906b8869 100644 --- a/charts/opensearch/templates/statefulset.yaml +++ b/charts/opensearch/templates/statefulset.yaml @@ -210,6 +210,11 @@ spec: - name: keystore-{{ .secretName }} secret: {{ toYaml . | nindent 12 }} {{- end }} + {{- if .Values.initialAdminPasswordTxtFile.enabled }} + - name: initialAdminPasswordTxt + hostPath: + path: {{ .Values.initialAdminPasswordTxtFile.mountPath }} + {{- end}} {{ end }} {{- if .Values.extraVolumes }} # Currently some extra blocks accept strings @@ -467,6 +472,10 @@ spec: mountPath: {{ $.Values.opensearchHome }}/config/{{ $path }} subPath: {{ $path }} {{- end -}} + {{- if .Values.initialAdminPasswordTxtFile.enabled }} + - name: initialAdminPasswordTxt + mountPath: {{ $.Values.opensearchHome }}/config/initialAdminPassword.txt + {{- end }} {{- if .Values.extraVolumeMounts }} # Currently some extra blocks accept strings # to continue with backwards compatibility this is being kept diff --git a/charts/opensearch/values.yaml b/charts/opensearch/values.yaml index d16a5192..d84b7821 100644 --- a/charts/opensearch/values.yaml +++ b/charts/opensearch/values.yaml @@ -133,6 +133,10 @@ image: # Cluster will not spin-up without this unless demo config install is disabled. adminPassword: "" +initialAdminPasswordTxtFile: + enabled: false + mountPath: /path/to/your/initialAdminPassword.txt + podAnnotations: {} # iam.amazonaws.com/role: es-cluster