summaryrefslogtreecommitdiffstats
path: root/kubernetes/nbi/templates
diff options
context:
space:
mode:
authorKrzysztof Opasiak <k.opasiak@samsung.com>2020-02-07 15:49:54 +0100
committerKrzysztof Opasiak <k.opasiak@samsung.com>2020-02-07 17:11:24 +0100
commite383b3255e8c26f76d97dc33214c1e4f25c6aa6f (patch)
tree60f0f09c2463b973bef48f9fd1d8f8e0bbf34772 /kubernetes/nbi/templates
parent0c458968744127785300aa32345b64be882f93bb (diff)
[NBI] Don't hardcode mariadb-galera password
Let's use common secret template to generate user credentials for NBI DB and depend on mariadb-galera to generate secure enough root password. BTW. Don't be surprised for now mariadb-galera has a hardcoded root password but as soon as we move all charts that use it to common secret template it will be auto generated. Issue-ID: OOM-2291 Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com> Change-Id: I5d16f6c26aa63a46db98ba3dab3a76267b4049f1
Diffstat (limited to 'kubernetes/nbi/templates')
-rw-r--r--kubernetes/nbi/templates/deployment.yaml7
-rw-r--r--kubernetes/nbi/templates/secret.yaml15
2 files changed, 17 insertions, 5 deletions
diff --git a/kubernetes/nbi/templates/deployment.yaml b/kubernetes/nbi/templates/deployment.yaml
index ceaf12b844..1fad1fc5aa 100644
--- a/kubernetes/nbi/templates/deployment.yaml
+++ b/kubernetes/nbi/templates/deployment.yaml
@@ -56,12 +56,9 @@ spec:
- name: SPRING_DATASOURCE_URL
value: jdbc:mariadb://{{ include "common.mariadbService" . }}:{{ include "common.mariadbPort" . }}/{{ index .Values "mariadb-galera" "config" "mysqlDatabase" }}
- name: SPRING_DATASOURCE_USERNAME
- value: {{ index .Values "mariadb-galera" "config" "userName" }}
+ {{- include "common.secret.envFromSecret" (dict "global" . "uid" "nbi-db-secret" "key" "login") | indent 14 }}
- name: SPRING_DATASOURCE_PASSWORD
- valueFrom:
- secretKeyRef:
- name: {{ include "common.mariadbSecret" . }}
- key: {{ include "common.mariadbSecretParam" . }}
+ {{- include "common.secret.envFromSecret" (dict "global" . "uid" "nbi-db-secret" "key" "password") | indent 14 }}
- name: SPRING_DATA_MONGODB_HOST
value: {{ .Values.mongo.service.name }}.{{ include "common.namespace" . }}
- name: SPRING_DATA_MONGODB_PORT
diff --git a/kubernetes/nbi/templates/secret.yaml b/kubernetes/nbi/templates/secret.yaml
new file mode 100644
index 0000000000..dee311c336
--- /dev/null
+++ b/kubernetes/nbi/templates/secret.yaml
@@ -0,0 +1,15 @@
+# Copyright © 2020 Samsung Electronics
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+{{ include "common.secret" . }}