You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@amoro.apache.org by ji...@apache.org on 2024/06/20 06:19:36 UTC

(amoro) branch master updated: Move admin username and password to secrets (#2948)

This is an automated email from the ASF dual-hosted git repository.

jinsongzhou pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/amoro.git


The following commit(s) were added to refs/heads/master by this push:
     new e0dbcddb6 Move admin username and password to secrets (#2948)
e0dbcddb6 is described below

commit e0dbcddb6227e372e72f147d469f3ae5b7b68eba
Author: Xavier Bai <xu...@apache.org>
AuthorDate: Thu Jun 20 14:19:32 2024 +0800

    Move admin username and password to secrets (#2948)
---
 charts/amoro/templates/amoro-admin-secret.yaml | 11 +++++++++++
 charts/amoro/templates/amoro-configmap.yaml    |  2 --
 charts/amoro/templates/amoro-deployment.yaml   | 10 ++++++++++
 charts/amoro/values.yaml                       |  6 ++++++
 4 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/charts/amoro/templates/amoro-admin-secret.yaml b/charts/amoro/templates/amoro-admin-secret.yaml
new file mode 100644
index 000000000..90385db63
--- /dev/null
+++ b/charts/amoro/templates/amoro-admin-secret.yaml
@@ -0,0 +1,11 @@
+apiVersion: v1
+kind: Secret
+metadata:
+  name: {{ include "common.names.fullname" . }}
+  labels:
+        {{- include "amoro.labels" . | nindent 4 }}
+type: Opaque
+data:
+  # use helm set dashboard username and password
+  username: {{ .Values.amoroConf.ams.adminUsername | b64enc | quote }}
+  password: {{ .Values.amoroConf.ams.adminPassword | b64enc | quote }}
\ No newline at end of file
diff --git a/charts/amoro/templates/amoro-configmap.yaml b/charts/amoro/templates/amoro-configmap.yaml
index 9e5992ae1..22bda0794 100644
--- a/charts/amoro/templates/amoro-configmap.yaml
+++ b/charts/amoro/templates/amoro-configmap.yaml
@@ -40,8 +40,6 @@ data:
   ## Helm chart provided Amoro configurations
   config.yaml: |
     ams:
-      admin-username: admin
-      admin-password: admin
       server-bind-host: "0.0.0.0"
       server-expose-host: "127.0.0.1"
 
diff --git a/charts/amoro/templates/amoro-deployment.yaml b/charts/amoro/templates/amoro-deployment.yaml
index 87f6128ed..465fc9d88 100644
--- a/charts/amoro/templates/amoro-deployment.yaml
+++ b/charts/amoro/templates/amoro-deployment.yaml
@@ -62,6 +62,16 @@ spec: {{/* TODO If Support Replica can be use more than 1 */}}
                   name: {{ include "common.names.fullname" . }}
                   key: password
             {{- end }}
+            - name: "AMS_ADMIN__USERNAME"
+              valueFrom:
+                secretKeyRef:
+                  name: {{ include "common.names.fullname" . }}
+                  key: username
+            - name: "AMS_ADMIN__PASSWORD"
+              valueFrom:
+                secretKeyRef:
+                  name: {{ include "common.names.fullname" . }}
+                  key: password
             {{- with .Values.env }}
             {{- tpl (toYaml .) $ | nindent 12 }}
             {{- end }}
diff --git a/charts/amoro/values.yaml b/charts/amoro/values.yaml
index a5e12a1f8..e32f406af 100644
--- a/charts/amoro/values.yaml
+++ b/charts/amoro/values.yaml
@@ -137,6 +137,12 @@ jvmOptions: ~
 ## AMS configurations files
 ##
 amoroConf:
+  ## AMS Dashboard username and password
+  ##
+  ams:
+    adminUsername: admin
+    adminPassword: admin
+
   ## AMS database properties, default value is derby. For production environment, suggest to use mysql
   ##
   database: