aboutsummaryrefslogtreecommitdiffstats
path: root/kubernetes/policy
diff options
context:
space:
mode:
Diffstat (limited to 'kubernetes/policy')
-rw-r--r--kubernetes/policy/charts/mariadb/resources/config/db.sh2
-rw-r--r--kubernetes/policy/charts/policy-pap/resources/config/config.json19
-rw-r--r--kubernetes/policy/charts/policy-pap/resources/config/topic.properties22
-rw-r--r--kubernetes/policy/charts/policy-pap/templates/configmap.yaml2
-rw-r--r--kubernetes/policy/charts/policy-pap/templates/deployment.yaml17
5 files changed, 59 insertions, 3 deletions
diff --git a/kubernetes/policy/charts/mariadb/resources/config/db.sh b/kubernetes/policy/charts/mariadb/resources/config/db.sh
index 3f94223d33..a5eb7f55c2 100644
--- a/kubernetes/policy/charts/mariadb/resources/config/db.sh
+++ b/kubernetes/policy/charts/mariadb/resources/config/db.sh
@@ -15,7 +15,7 @@
#!/bin/bash -xv
-for db in support onap_sdk log migration operationshistory10 pooling
+for db in support onap_sdk log migration operationshistory10 pooling policyadmin 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}'@'%' ;"
diff --git a/kubernetes/policy/charts/policy-pap/resources/config/config.json b/kubernetes/policy/charts/policy-pap/resources/config/config.json
index 81451037de..995c951b81 100644
--- a/kubernetes/policy/charts/policy-pap/resources/config/config.json
+++ b/kubernetes/policy/charts/policy-pap/resources/config/config.json
@@ -22,5 +22,24 @@
"port":6969,
"userName":"healthcheck",
"password":"zb!XztG34"
+ },
+ "pdpParameters": {
+ "updateParameters": {
+ "maxRetryCount": 1,
+ "maxWaitMs": 30000
+ },
+ "stateChangeParameters": {
+ "maxRetryCount": 1,
+ "maxWaitMs": 30000
+ }
+ },
+ "databaseProviderParameters": {
+ "name": "PolicyProviderParameterGroup",
+ "implementation": "org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
+ "databaseDriver": "org.mariadb.jdbc.Driver",
+ "databaseUrl": "jdbc:mariadb://{{.Values.global.mariadb.nameOverride}}:3306/policyadmin",
+ "databaseUser": "policy_user",
+ "databasePassword": "cG9saWN5X3VzZXI=",
+ "persistenceUnit": "PolicyMariaDb"
}
}
diff --git a/kubernetes/policy/charts/policy-pap/resources/config/topic.properties b/kubernetes/policy/charts/policy-pap/resources/config/topic.properties
new file mode 100644
index 0000000000..c1124a1172
--- /dev/null
+++ b/kubernetes/policy/charts/policy-pap/resources/config/topic.properties
@@ -0,0 +1,22 @@
+# ============LICENSE_START=======================================================
+# ONAP PAP
+# ================================================================================
+# Copyright (C) 2019 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.
+# ============LICENSE_END=========================================================
+
+dmaap.sink.topics=POLICY-PDP-PAP
+dmaap.sink.topics.POLICY-PDP-PAP.servers=message-router
+dmaap.source.topics=POLICY-PDP-PAP
+dmaap.source.topics.POLICY-PDP-PAP.servers=message-router
diff --git a/kubernetes/policy/charts/policy-pap/templates/configmap.yaml b/kubernetes/policy/charts/policy-pap/templates/configmap.yaml
index 56180768a1..19ce6a8f20 100644
--- a/kubernetes/policy/charts/policy-pap/templates/configmap.yaml
+++ b/kubernetes/policy/charts/policy-pap/templates/configmap.yaml
@@ -22,5 +22,5 @@ metadata:
name: {{ include "common.fullname" . }}-configmap
namespace: {{ include "common.namespace" . }}
data:
-{{ tpl (.Files.Glob "resources/config/config.json").AsConfig . | indent 2 }}
+{{ tpl (.Files.Glob "resources/config/*").AsConfig . | indent 2 }}
diff --git a/kubernetes/policy/charts/policy-pap/templates/deployment.yaml b/kubernetes/policy/charts/policy-pap/templates/deployment.yaml
index 5bec94b102..4945f766d8 100644
--- a/kubernetes/policy/charts/policy-pap/templates/deployment.yaml
+++ b/kubernetes/policy/charts/policy-pap/templates/deployment.yaml
@@ -16,12 +16,27 @@ spec:
app: {{ include "common.name" . }}
release: {{ .Release.Name }}
spec:
+ initContainers:
+ - command:
+ - /root/ready.py
+ args:
+ - --container-name
+ - {{ .Values.global.mariadb.nameOverride }}
+ env:
+ - name: NAMESPACE
+ valueFrom:
+ fieldRef:
+ apiVersion: v1
+ fieldPath: metadata.namespace
+ image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}"
+ imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
+ name: {{ include "common.name" . }}-readiness
containers:
- name: {{ include "common.name" . }}
image: "{{ include "common.repository" . }}/{{ .Values.image }}"
imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }}
command: ["/opt/app/policy/pap/bin/policy-pap.sh"]
- args: ["/opt/app/policy/pap/etc/mounted/config.json"]
+ args: ["/opt/app/policy/pap/etc/mounted/config.json", "/opt/app/policy/pap/etc/mounted/topic.properties"]
ports:
- containerPort: {{ .Values.service.internalPort }}
# disable liveness probe when breakpoints set in debugger