Merge "[DOC] Remove references to old versions"
authorKrzysztof Opasiak <k.opasiak@samsung.com>
Mon, 2 Mar 2020 20:52:23 +0000 (20:52 +0000)
committerGerrit Code Review <gerrit@onap.org>
Mon, 2 Mar 2020 20:52:23 +0000 (20:52 +0000)
14 files changed:
kubernetes/dmaap/components/dmaap-dr-prov/resources/config/provserver.properties
kubernetes/dmaap/components/dmaap-dr-prov/templates/deployment.yaml
kubernetes/dmaap/components/dmaap-dr-prov/templates/secret.yaml [new file with mode: 0644]
kubernetes/dmaap/components/dmaap-dr-prov/values.yaml
kubernetes/sdnc/charts/dmaap-listener/values.yaml
kubernetes/sdnc/charts/sdnc-ansible-server/values.yaml
kubernetes/sdnc/charts/sdnc-portal/resources/config/admportal.json
kubernetes/sdnc/charts/sdnc-portal/resources/config/dblib.properties
kubernetes/sdnc/charts/sdnc-portal/resources/config/svclogic.properties
kubernetes/sdnc/charts/sdnc-portal/resources/config/svclogic.properties.sdnctldb02
kubernetes/sdnc/charts/sdnc-portal/templates/deployment.yaml
kubernetes/sdnc/charts/sdnc-portal/templates/secrets.yaml
kubernetes/sdnc/charts/sdnc-portal/values.yaml
kubernetes/sdnc/charts/ueb-listener/values.yaml

index 34662ae..b672311 100644 (file)
@@ -7,9 +7,9 @@
 # * 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.
@@ -40,9 +40,9 @@ org.onap.dmaap.datarouter.provserver.isaddressauthenabled = false
 
 # Database access
 org.onap.dmaap.datarouter.db.driver   = org.mariadb.jdbc.Driver
-org.onap.dmaap.datarouter.db.url      = jdbc:mariadb://{{.Values.config.dmaapDrDb.mariadbServiceName}}:{{.Values.config.dmaapDrDb.mariadbServicePort}}/datarouter
-org.onap.dmaap.datarouter.db.login    = datarouter
-org.onap.dmaap.datarouter.db.password = datarouter
+org.onap.dmaap.datarouter.db.url      = jdbc:mariadb://{{.Values.config.dmaapDrDb.mariadbServiceName}}:{{.Values.config.dmaapDrDb.mariadbServicePort}}/{{.Values.mariadb.config.mysqlDatabase}}
+org.onap.dmaap.datarouter.db.login    = ${DB_USERNAME}
+org.onap.dmaap.datarouter.db.password = ${DB_PASSWORD}
 
 # PROV - DEFAULT ENABLED TLS PROTOCOLS
 org.onap.dmaap.datarouter.provserver.https.include.protocols = TLSv1.1|TLSv1.2
@@ -55,4 +55,3 @@ org.onap.dmaap.datarouter.provserver.aaf.sub.type         = org.onap.dmaap-dr.su
 org.onap.dmaap.datarouter.provserver.aaf.instance         = legacy
 org.onap.dmaap.datarouter.provserver.aaf.action.publish   = publish
 org.onap.dmaap.datarouter.provserver.aaf.action.subscribe = subscribe
-
index d6257bb..104fcdc 100644 (file)
@@ -120,6 +120,11 @@ spec:
               port: {{ .Values.config.dmaapDrProv.internalPort }}
             initialDelaySeconds: {{ .Values.readiness.initialDelaySeconds }}
             periodSeconds: {{ .Values.readiness.periodSeconds }}
+          env:
+          - name: DB_USERNAME
+            {{- include "common.secret.envFromSecret" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "login") | indent 12 }}
+          - name: DB_PASSWORD
+            {{- include "common.secret.envFromSecret" (dict "global" . "uid" "dmaap-dr-db-user-secret" "key" "password") | indent 12 }}
           volumeMounts:
           {{- if .Values.global.aafEnabled }}
           - mountPath: {{ .Values.persistence.aafCredsPath }}
diff --git a/kubernetes/dmaap/components/dmaap-dr-prov/templates/secret.yaml b/kubernetes/dmaap/components/dmaap-dr-prov/templates/secret.yaml
new file mode 100644 (file)
index 0000000..dee311c
--- /dev/null
@@ -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" . }}
index 4dcd7c3..6165568 100644 (file)
@@ -19,6 +19,17 @@ global:
   nodePortPrefix: 302
   loggingDirectory: /opt/app/datartr/logs
 
+#################################################################
+# Secrets metaconfig
+#################################################################
+secrets:
+  - uid: dmaap-dr-db-user-secret
+    name: '{{ include "common.release" . }}-dmaap-dr-db-user-secret'
+    type: basicAuth
+    externalSecret: '{{ tpl (default "" .Values.config.dmaapDrDb.userCredentialsExternalSecret) . }}'
+    login: '{{ .Values.config.dmaapDrDb.userName }}'
+    password: '{{ .Values.config.dmaapDrDb.userPassword }}'
+
 #################################################################
 # Application configuration defaults.
 #################################################################
@@ -88,6 +99,9 @@ config:
     mariadbServiceName: dmaap-dr-db-svc
     mariadbServicePort: 3306
     mariadbContName: dmaap-dr-db
+    userName: datarouter
+#    userPassword: password
+#    userCredentialsExternalSecret: some secret
 
 # mariadb-galera configuration
 mariadb:
@@ -95,9 +109,7 @@ mariadb:
   nameOverride: dmaap-dr-db
   replicaCount: 2
   config:
-    mariadbRootPassword: datarouter
-    userName: datarouter
-    userPassword: datarouter
+    userCredentialsExternalSecret: '{{ include "common.release" . }}-dmaap-dr-db-user-secret'
     mysqlDatabase: datarouter
   service:
     name: dmaap-dr-db-svc
@@ -136,4 +148,4 @@ resources:
     requests:
       cpu: 1000m
       memory: 2Gi
-  unlimited: {}
\ No newline at end of file
+  unlimited: {}
index d90da63..bec4d1c 100644 (file)
@@ -46,7 +46,7 @@ secrets:
     passwordPolicy: required
   - uid: odl-creds
     type: basicAuth
-    externalSecret: '{{ .Values.config.odlCredsExternalSecret }}'
+    externalSecret: '{{ tpl (default "" .Values.config.odlCredsExternalSecret) . }}'
     login: '{{ .Values.config.odlUser }}'
     password: '{{ .Values.config.odlPassword }}'
     passwordPolicy: required
index b0b3c81..4ee7c6f 100644 (file)
@@ -46,7 +46,7 @@ secrets:
     passwordPolicy: required
   - uid: rest-creds
     type: basicAuth
-    externalSecret: '{{ .Values.config.restCredsExternalSecret }}'
+    externalSecret: '{{ tpl (default "" .Values.config.restCredsExternalSecret) . }}'
     login: '{{ .Values.config.restUser }}'
     password: '{{ .Values.config.restPassword }}'
     passwordPolicy: required
index 8560ca1..e845e96 100644 (file)
   },
   "svclogicPropertiesDb01": "{{.Values.config.configDir}}/svclogic.properties.sdnctldb01",
   "databases": [
-    "{{.Values.config.mariadbGalera.serviceName}}.{{.Release.Namespace}}|sdnc-sdnctldb01.{{.Release.Namespace}}"
+    "{{include "common.mariadbService" $}}|sdnc-sdnctldb01.{{.Release.Namespace}}"
   ],
   "dbFabricServer": "localhost",
   "dbFabricPort": "32275",
   "dbFabricGroupId": "hagroup1",
-  "dbFabricUser": "admin",
-  "dbFabricPassword": "admin",
-  "dbFabricDB": "mysql",
-  "dbUser": "sdnctl",
-  "dbPassword": "{{.Values.config.dbSdnctlPassword}}",
-  "dbName": "sdnctl",
+  "dbFabricUser": "${DB_FABRIC_USER}",
+  "dbFabricPassword": "${DB_FABRIC_PASSWORD",
+  "dbFabricDB": "{{.Values.config.dbFabricDB}}",
+  "dbUser": "${SDNC_DB_USER}",
+  "dbPassword": "${SDNC_DB_PASSWORD}",
+  "dbName": "{{index $.Values "mariadb-galera" "config" "mysqlDatabase"}}",
   "odlProtocol": "http",
   "odlHost": "sdnc.{{.Release.Namespace}}",
   "odlConexusHost": "sdnc.{{.Release.Namespace}}",
   "odlPort": "8181",
   "odlConexusPort": "8181",
-  "odlUser": "admin",
-  "odlPasswd": "{{.Values.config.odlPassword}}",
+  "odlUser": "${ODL_USER}",
+  "odlPasswd": "${ODL_PASSWORD}",
   "ConexusNetwork_sslCert": "{{.Values.config.storesDir}}/org.onap.sdnc.p12",
-  "ConexusNetwork_sslKey": "{{.Values.config.keystorePwd}}",
+  "ConexusNetwork_sslKey": "${KEYSTORE_PASSWORD}",
   "AppNetwork_sslCert": "",
   "AppNetwork_sslKey": "",
   "hostnameList": [
index 7a5475e..beb514e 100644 (file)
@@ -1,7 +1,6 @@
 ###
 # ============LICENSE_START=======================================================
-# Copyright (C) 2018 ONAP Intellectual Property. All rights
-#                                              reserved.
+# Copyright (C) 2018 ONAP Intellectual Property. All rights reserved.
 # ================================================================================
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
 ###
 org.onap.ccsdk.sli.dbtype=jdbc
 org.onap.ccsdk.sli.jdbc.hosts=sdnctldb01
-org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{.Values.config.mariadbGalera.serviceName}}.{{.Release.Namespace}}:{{.Values.config.mariadbGalera.internalPort}}/sdnctl
+org.onap.ccsdk.sli.jdbc.url=jdbc:mysql://{{include "common.mariadbService" $}}:{{include "common.mariadbPort" $}}/{{index $.Values "mariadb-galera" "config" "mysqlDatabase"}}
 org.onap.ccsdk.sli.jdbc.driver=org.mariadb.jdbc.Driver
-org.onap.ccsdk.sli.jdbc.database=sdnctl
-org.onap.ccsdk.sli.jdbc.user=sdnctl
-org.onap.ccsdk.sli.jdbc.password={{.Values.config.dbSdnctlPassword}}
+org.onap.ccsdk.sli.jdbc.database={{index $.Values "mariadb-galera" "config" "mysqlDatabase"}}
+org.onap.ccsdk.sli.jdbc.user=${SDNC_DB_USER}
+org.onap.ccsdk.sli.jdbc.password=${SDNC_DB_PASSWORD}
 org.onap.ccsdk.sli.jdbc.connection.name=sdnctldb01
 org.onap.ccsdk.sli.jdbc.connection.timeout=50
 org.onap.ccsdk.sli.jdbc.request.timeout=100
index cc13a9d..a2570cd 100644 (file)
@@ -1,5 +1,5 @@
 org.openecomp.sdnctl.sli.dbtype = jdbc
-org.openecomp.sdnctl.sli.jdbc.url = jdbc:mysql://sdnc-sdnctldb01:3306/sdnctl
-org.openecomp.sdnctl.sli.jdbc.database = sdnctl
-org.openecomp.sdnctl.sli.jdbc.user = sdnctl
-org.openecomp.sdnctl.sli.jdbc.password = {{.Values.config.dbSdnctlPassword}}
\ No newline at end of file
+org.openecomp.sdnctl.sli.jdbc.url = jdbc:mysql://sdnc-sdnctldb01:3306/{{index $.Values "mariadb-galera" "config" "mysqlDatabase"}}
+org.openecomp.sdnctl.sli.jdbc.database = {{index $.Values "mariadb-galera" "config" "mysqlDatabase"}}
+org.openecomp.sdnctl.sli.jdbc.user = ${SDNC_DB_USER}
+org.openecomp.sdnctl.sli.jdbc.password = ${SDNC_DB_PASSWORD}
index c75c603..267bc20 100644 (file)
@@ -1,5 +1,5 @@
 org.openecomp.sdnctl.sli.dbtype = jdbc
-org.openecomp.sdnctl.sli.jdbc.url = jdbc:mysql://sdnc-sdnctldb02:3306/sdnctl
-org.openecomp.sdnctl.sli.jdbc.database = sdnctl
-org.openecomp.sdnctl.sli.jdbc.user = sdnctl
-org.openecomp.sdnctl.sli.jdbc.password = {{.Values.config.dbSdnctlPassword}}
\ No newline at end of file
+org.openecomp.sdnctl.sli.jdbc.url = jdbc:mysql://sdnc-sdnctldb02:3306/{{index $.Values "mariadb-galera" "config" "mysqlDatabase"}}
+org.openecomp.sdnctl.sli.jdbc.database = {{index $.Values "mariadb-galera" "config" "mysqlDatabase"}}
+org.openecomp.sdnctl.sli.jdbc.user = ${SDNC_DB_USER}
+org.openecomp.sdnctl.sli.jdbc.password = ${SDNC_DB_PASSWORD}
index db92b20..3a728ad 100644 (file)
@@ -31,11 +31,40 @@ spec:
         release: {{ include "common.release" . }}
     spec:
       initContainers:
+      - command:
+        - sh
+        args:
+        - -c
+        - "cd /config-input && for PFILE in `ls -1 .`; do envsubst <${PFILE} >/config/${PFILE}; done"
+        env:
+        - name: SDNC_DB_USER
+          {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
+        - name: SDNC_DB_PASSWORD
+          {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
+        - name: DB_FABRIC_USER
+          {{- include "common.secret.envFromSecret" (dict "global" . "uid" "fabric-db-creds" "key" "login") | indent 10 }}
+        - name: DB_FABRIC_PASSWORD
+          {{- include "common.secret.envFromSecret" (dict "global" . "uid" "fabric-db-creds" "key" "password") | indent 10 }}
+        - name: ODL_USER
+          {{- include "common.secret.envFromSecret" (dict "global" . "uid" "odl-creds" "key" "login") | indent 10 }}
+        - name: ODL_PASSWORD
+          {{- include "common.secret.envFromSecret" (dict "global" . "uid" "odl-creds" "key" "password") | indent 10 }}
+        - name: KEYSTORE_PASSWORD
+          {{- include "common.secret.envFromSecret" (dict "global" . "uid" "keystore-password" "key" "password") | indent 10 }}
+        volumeMounts:
+        - mountPath: /config-input
+          name: config-input
+        - mountPath: /config
+          name: properties
+        image: "{{ .Values.global.envsubstImage }}"
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        name: {{ include "common.name" . }}-update-config
+
       - command:
         - /root/ready.py
         args:
         - --container-name
-        - {{ .Values.config.mariadbGalera.chartName }}
+        - {{ include "common.mariadbService" . }}
         - --container-name
         - {{ .Values.config.sdncChartName }}
         env:
@@ -71,10 +100,7 @@ spec:
             periodSeconds: {{ .Values.readiness.periodSeconds }}
           env:
             - name: MYSQL_ROOT_PASSWORD
-              valueFrom:
-                secretKeyRef:
-                  name: {{ template "common.fullname" . }}
-                  key: db-root-password
+              {{- include "common.secret.envFromSecret" (dict "global" . "uid" "db-root-password" "key" "password") | indent 14 }}
             - name: SDNC_CONFIG_DIR
               value: "{{ .Values.config.configDir }}"
           volumeMounts:
@@ -110,9 +136,12 @@ spec:
         - name: localtime
           hostPath:
             path: /etc/localtime
-        - name: properties
+        - name: config-input
           configMap:
             name: {{ include "common.fullname" . }}
             defaultMode: 0644
+        - name: properties
+          emptyDir:
+            medium: Memory
       imagePullSecrets:
       - name: "{{ include "common.namespace" . }}-docker-registry-key"
index 239f734..dee311c 100644 (file)
@@ -1,13 +1,15 @@
-apiVersion: v1
-kind: Secret
-metadata:
-  name: {{ include "common.fullname" . }}
-  namespace: {{ include "common.namespace" . }}
-  labels:
-    app: {{ include "common.fullname" . }}
-    chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }}
-    release: {{ include "common.release" . }}
-    heritage: {{ .Release.Service }}
-type: Opaque
-data:
-  db-root-password: {{ .Values.config.dbRootPassword | b64enc | quote }}
+# 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" . }}
index 7ff000e..94ea5d7 100644 (file)
@@ -21,6 +21,52 @@ global:
   readinessImage: readiness-check:2.0.2
   loggingRepository: docker.elastic.co
   loggingImage: beats/filebeat:5.5.0
+  # envsusbt
+  envsubstImage: dibi/envsubst
+
+  mariadbGalera:
+    #This flag allows SO to instantiate its own mariadb-galera cluster
+    #If shared instance is used, this chart assumes that DB already exists
+    localCluster: false
+    service: mariadb-galera
+    internalPort: 3306
+    nameOverride: mariadb-galera
+
+#################################################################
+# Secrets metaconfig
+#################################################################
+secrets:
+  - uid: db-root-password
+    type: password
+    externalSecret: '{{ .Values.global.mariadbGalera.localCluster | ternary (default (include "common.mariadb.secret.rootPassSecretName" (dict "dot" . "chartName" (index .Values "mariadb-galera" "nameOverride"))) (index .Values "mariadb-galera" "config" "mariadbRootPasswordExternalSecret")) (include "common.mariadb.secret.rootPassSecretName" (dict "dot" . "chartName" .Values.global.mariadbGalera.nameOverride)) }}'
+    password: '{{ (index .Values "mariadb-galera" "config" "mariadbRootPassword" }}'
+    passwordPolicy: required
+  - uid: db-secret
+    name: &dbSecretName '{{ include "common.release" . }}-sdnc-portal-db-secret'
+    type: basicAuth
+    # This is a nasty trick that allows you override this secret using external one
+    # with the same field that is used to pass this to subchart
+    externalSecret: '{{ ternary "" (tpl (default "" (index .Values "mariadb-galera" "config" "userCredentialsExternalSecret")) .) (hasSuffix "sdnc-portal-db-secret" (index .Values "mariadb-galera" "config" "userCredentialsExternalSecret"))}}'
+    login: '{{ index .Values "mariadb-galera" "config" "userName" }}'
+    password: '{{ index .Values "mariadb-galera" "config" "userPassword" }}'
+    passwordPolicy: required
+  - uid: odl-creds
+    type: basicAuth
+    externalSecret: '{{ tpl (default "" .Values.config.odlCredsExternalSecret) . }}'
+    login: '{{ .Values.config.odlUser }}'
+    password: '{{ .Values.config.odlPassword }}'
+    passwordPolicy: required
+  - uid: fabric-db-creds
+    type: basicAuth
+    externalSecret: '{{ tpl (default "" .Values.config.odlCredsExternalSecret) . }}'
+    login: '{{ .Values.config.dbFabricUser }}'
+    password: '{{ .Values.config.dbFabricPassword }}'
+    passwordPolicy: required
+  - uid: keystore-password
+    type: password
+    externalSecret: '{{ tpl (default "" .Values.config.KeyStorePwdExternalSecret) . }}'
+    password: '{{ .Values.config.keystorePwd }}'
+    passwordPolicy: required
 
 #################################################################
 # Application configuration defaults.
@@ -29,17 +75,34 @@ global:
 repository: nexus3.onap.org:10001
 image: onap/admportal-sdnc-image:1.7.6
 config:
-  dbRootPassword: secretpassword
-  dbSdnctlPassword: gamma
+  dbFabricDB: mysql
+  dbFabricUser: admin
+  dbFabricPassword: admin
+  # dbFabricDBCredsExternalSecret: some secret
   sdncChartName: sdnc
   configDir: /opt/onap/sdnc/data/properties
   storesDir: /opt/onap/sdnc/data/stores
+  odlUser: admin
   odlPassword: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
+  # odlCredsExternalSecret: some secret
   keystorePwd: ff^G9D]yf&r}Ktum@BJ0YB?N
-  mariadbGalera:
-    chartName: mariadb-galera
-    serviceName: mariadb-galera
+  # keystorePwdExternalSecret: some secret
+
+mariadb-galera:
+  config:
+    userCredentialsExternalSecret: *dbSecretName
+    userName: sdnctl
+    userPassword: gamma
+    mysqlDatabase: sdnctl
+  nameOverride: sdnc-portal-galera
+  service:
+    name: sdnc-portal-galera
+    portName: sdnc-portal-galera
     internalPort: 3306
+  replicaCount: 1
+  persistence:
+    enabled: true
+    mountSubPath: sdnc-portal/maria/data
 
 # default number of instances
 replicaCount: 0
index 03fbf52..9b7dcb0 100644 (file)
@@ -46,13 +46,13 @@ secrets:
     passwordPolicy: required
   - uid: odl-creds
     type: basicAuth
-    externalSecret: '{{ .Values.config.odlCredsExternalSecret }}'
+    externalSecret: '{{ tpl (default "" .Values.config.odlCredsExternalSecret) . }}'
     login: '{{ .Values.config.odlUser }}'
     password: '{{ .Values.config.odlPassword }}'
     passwordPolicy: required
   - uid: ueb-creds
     type: basicAuth
-    externalSecret: '{{ .Values.config.odlCredsExternalSecret }}'
+    externalSecret: '{{ tpl (default "" .Values.config.odlCredsExternalSecret) . }}'
     login: '{{ .Values.config.uebUser }}'
     password: '{{ .Values.config.uebPassword }}'
     passwordPolicy: required