[POLICY] Update core images/config for m4 istanbul 77/120577/24
authorjhh <jorge.hernandez-herrero@att.com>
Thu, 15 Apr 2021 16:04:39 +0000 (11:04 -0500)
committera.sreekumar <ajith.sreekumar@bell.ca>
Fri, 17 Sep 2021 12:24:58 +0000 (13:24 +0100)
New images and configuration for api, pap, distribution,
pdpd, pdpx, pdpa and db components.

Issue-ID: POLICY-3199
Issue-ID: POLICY-3456
Issue-ID: POLICY-3593
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Change-Id: I4572a3aeb8481d8d2ea671f67e105a05fc6ce1b8
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Signed-off-by: Jim Hahn <jrh3@att.com>
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Signed-off-by: Jim Hahn <jrh3@att.com>
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
Signed-off-by: jhh <jorge.hernandez-herrero@att.com>
Signed-off-by: a.sreekumar <ajith.sreekumar@bell.ca>
20 files changed:
kubernetes/policy/components/policy-apex-pdp/resources/config/OnapPfConfig.json
kubernetes/policy/components/policy-apex-pdp/resources/config/config.json [deleted file]
kubernetes/policy/components/policy-apex-pdp/values.yaml
kubernetes/policy/components/policy-api/resources/config/config.json
kubernetes/policy/components/policy-api/values.yaml
kubernetes/policy/components/policy-distribution/resources/config/config.json
kubernetes/policy/components/policy-distribution/values.yaml
kubernetes/policy/components/policy-drools-pdp/resources/configmaps/base.conf
kubernetes/policy/components/policy-drools-pdp/resources/configmaps/engine-system.properties [new file with mode: 0644]
kubernetes/policy/components/policy-drools-pdp/resources/configmaps/logback.xml
kubernetes/policy/components/policy-drools-pdp/values.yaml
kubernetes/policy/components/policy-pap/resources/config/config.json
kubernetes/policy/components/policy-pap/values.yaml
kubernetes/policy/components/policy-xacml-pdp/resources/config/config.json
kubernetes/policy/components/policy-xacml-pdp/values.yaml
kubernetes/policy/resources/config/db.sh
kubernetes/policy/resources/config/db_migrator_policy_init.sh [new file with mode: 0644]
kubernetes/policy/templates/configmap.yaml
kubernetes/policy/templates/job.yaml
kubernetes/policy/values.yaml

index 66a42f0..0c9d6a5 100755 (executable)
@@ -5,7 +5,8 @@
       "port": 6969,
       "userName": "${RESTSERVER_USER}",
       "password": "${RESTSERVER_PASSWORD}",
-      "https": true
+      "https": true,
+      "prometheus": true
     },
     "pdpStatusParameters":{
         "pdpGroup": "defaultGroup",
diff --git a/kubernetes/policy/components/policy-apex-pdp/resources/config/config.json b/kubernetes/policy/components/policy-apex-pdp/resources/config/config.json
deleted file mode 100755 (executable)
index d6bd17f..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-{{/*
-#  ============LICENSE_START=======================================================
-#   Copyright (C) 2018 Ericsson. 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.
-#  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.
-#
-#  SPDX-License-Identifier: Apache-2.0
-#  ============LICENSE_END=========================================================
-*/}}
-{
-  "javaProperties" : [
-    ["javax.net.ssl.trustStore", "/opt/app/policy/apex-pdp/etc/ssl/policy-truststore"],
-    ["javax.net.ssl.trustStorePassword", "${TRUSTSTORE_PASSWORD_BASE64}"]
-  ],
-  "engineServiceParameters": {
-    "name": "MyApexEngine",
-    "version": "0.0.1",
-    "id": 45,
-    "instanceCount": 4,
-    "deploymentPort": 12345,
-    "policyModelFileName": "examples/models/SampleDomain/SamplePolicyModelJAVASCRIPT.json",
-    "engineParameters": {
-      "executorParameters": {
-        "JAVASCRIPT": {
-          "parameterClassName": "org.onap.policy.apex.plugins.executor.javascript.JavascriptExecutorParameters"
-        }
-      }
-    }
-  },
-  "eventOutputParameters": {
-    "FirstProducer": {
-      "carrierTechnologyParameters": {
-        "carrierTechnology": "FILE",
-        "parameters": {
-          "standardIo": true
-        }
-      },
-      "eventProtocolParameters": {
-        "eventProtocol": "JSON"
-      }
-    }
-  },
-  "eventInputParameters": {
-    "FirstConsumer": {
-      "carrierTechnologyParameters": {
-        "carrierTechnology": "FILE",
-        "parameters": {
-          "standardIo": true
-        }
-      },
-      "eventProtocolParameters": {
-        "eventProtocol": "JSON"
-      }
-    }
-  }
-}
index eb6292a..3983d93 100755 (executable)
@@ -49,7 +49,7 @@ secrets:
 # Application configuration defaults.
 #################################################################
 # application image
-image: onap/policy-apex-pdp:2.5.2
+image: onap/policy-apex-pdp:2.6.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index 729eea8..ce59965 100755 (executable)
@@ -25,7 +25,8 @@
         "userName":"${RESTSERVER_USER}",
         "password":"${RESTSERVER_PASSWORD}",
         "https": true,
-        "aaf": false
+        "aaf": false,
+        "prometheus": true
     },
     "databaseProviderParameters": {
         "name": "PolicyProviderParameterGroup",
index 36eb5c4..87ddd73 100755 (executable)
@@ -78,7 +78,7 @@ certInitializer:
 # Application configuration defaults.
 #################################################################
 # application image
-image: onap/policy-api:2.4.2
+image: onap/policy-api:2.5.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index ae31633..615afc6 100755 (executable)
@@ -2,6 +2,7 @@
 #  ============LICENSE_START=======================================================
 #   Copyright (C) 2018 Ericsson. All rights reserved.
 #   Modifications Copyright (C) 2020 AT&T Intellectual Property.
+#   Modifications Copyright (C) 2021 Bell Canada. 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.
@@ -25,7 +26,8 @@
         "port":6969,
         "userName":"${RESTSERVER_USER}",
         "password":"${RESTSERVER_PASSWORD}",
-        "https":true
+        "https":true,
+        "prometheus": true
     },
     "receptionHandlerParameters":{
         "SDCReceptionHandler":{
@@ -69,8 +71,8 @@
                 ],
                 "consumerGroup": "policy-group",
                 "environmentName": "AUTO",
-                "keystorePath": "null",
-                "keystorePassword": "null",
+                "keyStorePath": "null",
+                "keyStorePassword": "null",
                 "activeserverTlsAuth": false,
                 "isFilterinEmptyResources": true,
                 "isUseHttpsWithDmaap": true
             "parameterClassName":"org.onap.policy.distribution.forwarding.lifecycle.api.LifecycleApiForwarderParameters",
             "parameters":{
                 "apiParameters": {
-                "hostName": "policy-api",
-                "port": 6969,
-                  "userName": "${API_USER}",
-                  "password": "${API_PASSWORD}"
-                 },
+                    "clientName": "policy-api",
+                    "hostname": "policy-api",
+                    "port": 6969,
+                    "userName": "${API_USER}",
+                    "password": "${API_PASSWORD}",
+                    "useHttps": true
+                },
                 "papParameters": {
-                  "hostName": "policy-pap",
-                  "port": 6969,
-                 "userName": "${PAP_USER}",
-                "password": "${PAP_PASSWORD}"
+                    "clientName": "policy-pap",
+                    "hostname": "policy-pap",
+                    "port": 6969,
+                    "userName": "${PAP_USER}",
+                    "password": "${PAP_PASSWORD}",
+                    "useHttps": true
                 },
-                "isHttps": true,
                 "deployPolicies": true
              }
         }
index fb6ef6e..1614bd8 100755 (executable)
@@ -67,7 +67,7 @@ global:
 # Application configuration defaults.
 #################################################################
 # application image
-image: onap/policy-distribution:2.5.2
+image: onap/policy-distribution:2.6.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index ec8d119..ff532ab 100755 (executable)
@@ -1,6 +1,7 @@
 {{/*
 # Copyright © 2017-2018 Amdocs, Bell Canada.
 # Modifications Copyright (C) 2018-2020 AT&T Intellectual Property.
+# Modifications Copyright (C) 2021 Bell Canada. 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.
@@ -40,6 +41,7 @@ REPOSITORY_OFFLINE={{.Values.nexus.offline}}
 # Relational (SQL) DB access
 
 SQL_HOST={{ .Values.db.name }}
+SQL_PORT=3306
 
 # AAF
 
@@ -47,6 +49,11 @@ AAF={{.Values.aaf.enabled}}
 AAF_NAMESPACE=org.onap.policy
 AAF_HOST=aaf-locate.{{.Release.Namespace}}
 
+# HTTP Servers
+
+HTTP_SERVER_HTTPS=true
+PROMETHEUS=true
+
 # PDP-D DMaaP configuration channel
 
 PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION
@@ -85,6 +92,7 @@ DCAE_CONSUMER_GROUP=dcae.policy.shared
 # Open DMaaP
 
 DMAAP_SERVERS=message-router
+DMAAP_HTTPS=true
 
 # AAI
 
diff --git a/kubernetes/policy/components/policy-drools-pdp/resources/configmaps/engine-system.properties b/kubernetes/policy/components/policy-drools-pdp/resources/configmaps/engine-system.properties
new file mode 100644 (file)
index 0000000..c7cca2b
--- /dev/null
@@ -0,0 +1,45 @@
+#
+# ============LICENSE_START=======================================================
+# ONAP
+# ================================================================================
+# Copyright (C) 2021 AT&T 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.
+# 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.
+# ============LICENSE_END=========================================================
+#
+
+# system properties set within the application
+
+java.net.preferIPv4Stack=true
+
+# jmx
+
+com.sun.management.jmxremote.port=9991
+com.sun.management.jmxremote.authenticate=false
+com.sun.management.jmxremote.ssl=false
+
+# certs
+
+javax.net.ssl.trustStore=${envd:TRUSTSTORE:/opt/app/policy/etc/ssl/policy-truststore}
+javax.net.ssl.trustStorePassword=${envd:TRUSTSTORE_PASSWD}
+
+javax.net.ssl.keyStore=${envd:KEYSTORE}
+javax.net.ssl.keyStorePassword=${envd:KEYSTORE_PASSWD}
+
+# kie
+
+kie.maven.offline.force=${envd:REPOSITORY_OFFLINE:false}
+
+# symmetric key for sensitive configuration data
+
+engine.symm.key=${envd:SYMM_KEY}
index 7173d80..2fc08e4 100755 (executable)
@@ -80,7 +80,7 @@
             <maxHistory>30</maxHistory>
             <totalSizeCap>10GB</totalSizeCap>
         </rollingPolicy>
-        <filter class="org.onap.policy.drools.utils.logging.LoggerMarkerFilter$MetricLoggerMarkerFilter" />
+        <filter class="org.onap.policy.common.utils.logging.LoggerMarkerFilter$MetricLoggerMarkerFilter" />
         <encoder>
             <pattern>%X{RequestID}|%X{InvocationID}|%X{ServiceName}|%X{PartnerName}|%X{BeginTimestamp}|%X{EndTimestamp}|%X{ElapsedTime}|%X{ServiceInstanceID}|%X{VirtualServerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{Severity}|%X{TargetEntity}|%X{TargetServiceName}|%X{Server}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{ClientIPAddress}|%X{ProcessKey}|%X{RemoteHost}||%X{TargetVirtualEntity}|%level|%thread| %msg%n</pattern>
         </encoder>
@@ -98,7 +98,7 @@
             <maxHistory>30</maxHistory>
             <totalSizeCap>10GB</totalSizeCap>
         </rollingPolicy>
-        <filter class="org.onap.policy.drools.utils.logging.LoggerMarkerFilter$TransactionLoggerMarkerFilter" />
+        <filter class="org.onap.policy.common.utils.logging.LoggerMarkerFilter$TransactionLoggerMarkerFilter" />
         <encoder>
             <pattern>%X{RequestID}|%X{InvocationID}|%X{ServiceName}|%X{PartnerName}|%X{BeginTimestamp}|%X{EndTimestamp}|%X{ElapsedTime}|%X{ServiceInstanceID}|%X{VirtualServerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{Severity}|%X{TargetEntity}|%X{TargetServiceName}|%X{Server}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{ClientIPAddress}|%X{ProcessKey}|%X{RemoteHost}||%X{TargetVirtualEntity}|%level|%thread| %msg%n</pattern>
         </encoder>
     </appender>
 
     <appender name="MetricStdOut" class="ch.qos.logback.core.ConsoleAppender">
-        <filter class="org.onap.policy.drools.utils.logging.LoggerMarkerFilter$MetricLoggerMarkerFilter" />
+        <filter class="org.onap.policy.common.utils.logging.LoggerMarkerFilter$MetricLoggerMarkerFilter" />
         <encoder>
             <pattern>%X{RequestID}|%X{InvocationID}|%X{ServiceName}|%X{PartnerName}|%X{BeginTimestamp}|%X{EndTimestamp}|%X{ElapsedTime}|%X{ServiceInstanceID}|%X{VirtualServerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{Severity}|%X{TargetEntity}|%X{TargetServiceName}|%X{Server}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{ClientIPAddress}|%X{ProcessKey}|%X{RemoteHost}||%X{TargetVirtualEntity}|%level|%thread| %msg%n</pattern>
         </encoder>
     </appender>
 
     <appender name="TransactionStdOut" class="ch.qos.logback.core.ConsoleAppender">
-        <filter class="org.onap.policy.drools.utils.logging.LoggerMarkerFilter$TransactionLoggerMarkerFilter" />
+        <filter class="org.onap.policy.common.utils.logging.LoggerMarkerFilter$TransactionLoggerMarkerFilter" />
         <encoder>
             <pattern>%X{RequestID}|%X{InvocationID}|%X{ServiceName}|%X{PartnerName}|%X{BeginTimestamp}|%X{EndTimestamp}|%X{ElapsedTime}|%X{ServiceInstanceID}|%X{VirtualServerName}|%X{StatusCode}|%X{ResponseCode}|%X{ResponseDescription}|%X{InstanceUUID}|%X{Severity}|%X{TargetEntity}|%X{TargetServiceName}|%X{Server}|%X{ServerIPAddress}|%X{ServerFQDN}|%X{ClientIPAddress}|%X{ProcessKey}|%X{RemoteHost}||%X{TargetVirtualEntity}|%level|%thread| %msg%n</pattern>
         </encoder>
index 38d3989..678cce7 100755 (executable)
@@ -1,4 +1,5 @@
-# Copyright © 2017 Amdocs, Bell Canada
+# Copyright © 2017 Amdocs
+# Copyright © 2017, 2021 Bell Canada
 # Modifications Copyright © 2018-2021 AT&T Intellectual Property
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -34,7 +35,7 @@ secrets:
 # Application configuration defaults.
 #################################################################
 # application image
-image: onap/policy-pdpd-cl:1.8.2
+image: onap/policy-pdpd-cl:1.9.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index 0b30a27..e5cbd22 100755 (executable)
@@ -1,6 +1,7 @@
 {{/*
 #  ============LICENSE_START=======================================================
 #   Copyright (C) 2019 Nordix Foundation.
+#   Modifications Copyright (C) 2021 AT&T 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.
@@ -25,7 +26,8 @@
         "userName":"${RESTSERVER_USER}",
         "password":"${RESTSERVER_PASSWORD}",
         "https": true,
-        "aaf": false
+        "aaf": false,
+        "prometheus": true
     },
     "pdpParameters": {
         "heartBeatMs": 120000,
@@ -47,6 +49,7 @@
         "databasePassword": "${SQL_PASSWORD}",
         "persistenceUnit": "PolicyMariaDb"
     },
+    "savePdpStatisticsInDb": true,
     "topicParameterGroup": {
         "topicSources" : [{
             "topic" : "POLICY-PDP-PAP",
             "useHttps": true,
             "fetchTimeout": 15000,
             "topicCommInfrastructure" : "dmaap"
+        },
+        {
+            "topic" : "POLICY-HEARTBEAT",
+            "effectiveTopic": "POLICY-PDP-PAP",
+            "consumerGroup": "policy-pap",
+            "servers" : [ "message-router" ],
+            "useHttps": true,
+            "fetchTimeout": 15000,
+            "topicCommInfrastructure" : "dmaap"
         }],
         "topicSinks" : [{
             "topic" : "POLICY-PDP-PAP",
index 3c4c3e5..c373e04 100755 (executable)
@@ -92,7 +92,7 @@ certInitializer:
 # Application configuration defaults.
 #################################################################
 # application image
-image: onap/policy-pap:2.4.2
+image: onap/policy-pap:2.5.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index a626a04..19b4d9c 100755 (executable)
         "userName": "${RESTSERVER_USER}",
         "password": "${RESTSERVER_PASSWORD}",
         "https": true,
-        "aaf": false
+        "aaf": false,
+        "prometheus": true
     },
     "policyApiParameters": {
-        "host": "policy-api",
+        "hostname": "policy-api",
         "port": 6969,
         "userName": "${API_USER}",
         "password": "${API_PASSWORD}",
-        "https": true,
+        "useHttps": true,
         "aaf": false
     },
-    "applicationPath": "/opt/app/policy/pdpx/apps",
+    "applicationParameters": {
+        "applicationPath": "/opt/app/policy/pdpx/apps"
+    },
     "topicParameterGroup": {
         "topicSources" : [{
             "topic" : "POLICY-PDP-PAP",
index 9eda53e..91984cc 100755 (executable)
@@ -83,7 +83,7 @@ certInitializer:
 # Application configuration defaults.
 #################################################################
 # application image
-image: onap/policy-xacml-pdp:2.4.2
+image: onap/policy-xacml-pdp:2.5.0
 pullPolicy: Always
 
 # flag to enable debugging - application support required
index 90c9879..7b94372 100755 (executable)
 
 mysql() { /usr/bin/mysql  -h ${MYSQL_HOST} -P ${MYSQL_USER} "$@"; };
 
-for db in support onap_sdk log migration operationshistory10 pooling policyadmin policyclamp operationshistory
+for db in migration pooling policyadmin policyclamp operationshistory
 do
-       mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
-       mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;"
+    mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
+    mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;"
 done
 
 mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;"
diff --git a/kubernetes/policy/resources/config/db_migrator_policy_init.sh b/kubernetes/policy/resources/config/db_migrator_policy_init.sh
new file mode 100644 (file)
index 0000000..d1cc108
--- /dev/null
@@ -0,0 +1,21 @@
+#!/bin/sh
+{{/*
+# Copyright (C) 2021 Nordix Foundation.
+#
+# 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.
+*/}}
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade
+rc=$?
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report
+exit $rc
index 7809c74..17558f8 100755 (executable)
@@ -1,6 +1,7 @@
 {{/*
 # Copyright © 2017 Amdocs, Bell Canada
 # Modifications Copyright © 2018, 2020 AT&T Intellectual Property
+# Modifications Copyright (C) 2021 Nordix Foundation.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -26,4 +27,4 @@ metadata:
     release: {{ include "common.release" . }}
     heritage: {{ .Release.Service }}
 data:
-{{ tpl (.Files.Glob "resources/config/db.sh").AsConfig . | indent 2 }}
+{{ tpl (.Files.Glob "resources/config/*.sh").AsConfig . | indent 2 }}
index 72c94f3..d781a63 100755 (executable)
@@ -1,6 +1,7 @@
 {{/*
 # Copyright © 2018 Amdocs, Bell Canada
 # Modifications Copyright © 2020 AT&T Intellectual Property
+# Modifications Copyright (C) 2021 Nordix Foundation.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -47,7 +48,6 @@ spec:
             fieldRef:
               apiVersion: v1
               fieldPath: metadata.namespace
-      containers:
       - name: {{ include "common.release" . }}-policy-galera-config
         image: {{ include "repositoryGenerator.dockerHubRepository" . }}/{{ .Values.mariadb.image }}
         imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
@@ -70,6 +70,32 @@ spec:
         - name: MYSQL_PORT
           value: "{{ index .Values "mariadb-galera" "service" "internalPort" }}"
         resources:
+{{ include "common.resources" . }}
+      containers:
+      - name: {{ include "common.release" . }}-policy-galera-db-migrator
+        image: {{ .Values.repository }}/{{ .Values.dbmigrator.image }}
+        imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+        volumeMounts:
+        - mountPath: /dbcmd-config/db_migrator_policy_init.sh
+          name: {{ include "common.fullname" . }}-config
+          subPath: db_migrator_policy_init.sh
+        command:
+        - /bin/sh
+        args:
+        - -x
+        - /dbcmd-config/db_migrator_policy_init.sh
+        env:
+        - name: SQL_HOST
+          value: "{{ index .Values "mariadb-galera" "service" "name" }}"
+        - name: SQL_USER
+          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "login") | indent 10 }}
+        - name: SQL_PASSWORD
+          {{- include "common.secret.envFromSecretFast" (dict "global" . "uid" "db-secret" "key" "password") | indent 10 }}
+        - name: SQL_DB
+          value: {{ .Values.dbmigrator.schema }}
+        - name: POLICY_HOME
+          value: {{ .Values.dbmigrator.policy_home }}
+        resources:
 {{ include "common.resources" . }}
       restartPolicy: Never
       serviceAccountName: {{ include "common.fullname" (dict "suffix" "read" "dot" . )}}
@@ -80,3 +106,5 @@ spec:
             items:
               - key: db.sh
                 path: db.sh
+              - key: db_migrator_policy_init.sh
+                path: db_migrator_policy_init.sh
index 92344dd..5478e5b 100755 (executable)
@@ -1,5 +1,6 @@
 # Copyright © 2017 Amdocs, Bell Canada
 # Modifications Copyright © 2018-2020 AT&T Intellectual Property
+# Modifications Copyright (C) 2021 Nordix Foundation.
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
 # you may not use this file except in compliance with the License.
@@ -84,6 +85,11 @@ pullPolicy: Always
 mariadb:
   image: mariadb:10.5.8
 
+dbmigrator:
+  image: onap/policy-db-migrator:2.3.0
+  schema: policyadmin
+  policy_home: "/opt/app/policy"
+
 subChartsOnly:
   enabled: true