diff options
Diffstat (limited to 'kubernetes/policy')
15 files changed, 98 insertions, 29 deletions
diff --git a/kubernetes/policy/charts/brmsgw/values.yaml b/kubernetes/policy/charts/brmsgw/values.yaml index 49e37789df..d8cbda4aaf 100644 --- a/kubernetes/policy/charts/brmsgw/values.yaml +++ b/kubernetes/policy/charts/brmsgw/values.yaml @@ -25,7 +25,7 @@ global: ################################################################# # application image repository: nexus3.onap.org:10001 -image: onap/policy-pe:1.2.0 +image: onap/policy-pe:1.2.3 pullPolicy: Always # flag to enable debugging - application support required diff --git a/kubernetes/policy/charts/drools/charts/nexus/values.yaml b/kubernetes/policy/charts/drools/charts/nexus/values.yaml index 03a03cc198..add7a7c7be 100644 --- a/kubernetes/policy/charts/drools/charts/nexus/values.yaml +++ b/kubernetes/policy/charts/drools/charts/nexus/values.yaml @@ -46,14 +46,14 @@ affinity: {} # probe configuration parameters liveness: - initialDelaySeconds: 10 + initialDelaySeconds: 180 periodSeconds: 10 # necessary to disable liveness probe when setting breakpoints # in debugger so K8s doesn't restart unresponsive container enabled: true readiness: - initialDelaySeconds: 10 + initialDelaySeconds: 60 periodSeconds: 10 path: /nexus/service/local/status diff --git a/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/base.conf b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/base.conf index 9202b0ada7..1236176514 100644 --- a/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/base.conf +++ b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/base.conf @@ -78,13 +78,13 @@ DMAAP_SERVERS=message-router # AAI -AAI_URL=https://aai.api.simpledemo.openecomp.org:8443 +AAI_URL=https://aai.{{.Release.Namespace}}:8443 AAI_USERNAME=POLICY AAI_PASSWORD=POLICY # MSO -SO_URL=http://mso:8080/ecomp/mso/infra +SO_URL=http://so.{{.Release.Namespace}}:8080/ecomp/mso/infra SO_USERNAME=InfraPortalClient SO_PASSWORD=password1$ diff --git a/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/drools-tweaks.sh b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/drools-tweaks.sh index 65ef7053cd..5f504e2c65 100644 --- a/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/drools-tweaks.sh +++ b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/drools-tweaks.sh @@ -1,4 +1,4 @@ -#! /bin/bash +#! /bin/bash -xv # Copyright © 2017-2018 Amdocs, Bell Canada, AT&T # @@ -15,4 +15,57 @@ # limitations under the License. -${POLICY_HOME}/bin/features enable healthcheck +"${POLICY_HOME}"/bin/features enable healthcheck +"${POLICY_HOME}"/bin/features enable distributed-locking + +"${POLICY_HOME}"/bin/db-migrator -s pooling -o upgrade + +# make sure the PDPD-CONFIGURATION anonymous topic is created +# so not to lose any configuration updates + +echo +echo "testing publish to PDPD-CONFIGURATION topic" +echo + +curl --silent --connect-timeout 15 -X POST --header "Content-Type: application/json" -d "{}" http://message-router:3904/events/PDPD-CONFIGURATION + +echo +echo "testing subscribe to PDPD-CONFIGURATION topic " +echo + +curl --silent --connect-timeout 15 -X GET http://message-router:3904/events/PDPD-CONFIGURATION/1/1?timeout=5000 + +# for resiliency/scalability scenarios, check to see +# if there's an amsterdam artifact already deployed +# by brmsgw. If so, update the amsterdam controller +# coordinates. In the future, a more sophisticated +# solution will be put in place, that will required +# coordination among policy components. + +echo +echo "checking if there are amsterdam policies already deployed .." +echo + +AMSTERDAM_VERSION=$(curl --silent --connect-timeout 20 -X GET "http://nexus:8081/nexus/service/local/artifact/maven/resolve?r=releases&g=org.onap.policy-engine.drools.amsterdam&a=policy-amsterdam-rules&v=RELEASE" | grep -Po "(?<=<version>).*(?=</version>)") + +if [[ -z ${AMSTERDAM_VERSION} ]]; then + echo "no amsterdam policies have been found .." + exit 0 +fi + +echo +echo "The latest deployed amsterdam artifact in nexus has version ${AMSTERDAM_VERSION}" +echo + +sed -i.INSTALL -e "s/^rules.artifactId=.*/rules.artifactId=policy-amsterdam-rules/g" \ + -e "s/^rules.groupId=.*/rules.groupId=org.onap.policy-engine.drools.amsterdam/g" \ + -e "s/^rules.version=.*/rules.version=${AMSTERDAM_VERSION}/g" "${POLICY_HOME}"/config/amsterdam-controller.properties + +echo +echo "amsterdam controller will be started brained with maven coordinates:" +echo + +grep "^rules" "${POLICY_HOME}"/config/amsterdam-controller.properties + +echo +echo diff --git a/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/feature-pooling-dmaap.conf b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/feature-pooling-dmaap.conf new file mode 100644 index 0000000000..82384075b5 --- /dev/null +++ b/kubernetes/policy/charts/drools/resources/config/opt/policy/config/drools/feature-pooling-dmaap.conf @@ -0,0 +1,15 @@ +# Copyright 2018 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. + +POOLING_TOPIC=POOLING diff --git a/kubernetes/policy/charts/drools/templates/statefulset.yaml b/kubernetes/policy/charts/drools/templates/statefulset.yaml index 9041478c8c..71844f108d 100644 --- a/kubernetes/policy/charts/drools/templates/statefulset.yaml +++ b/kubernetes/policy/charts/drools/templates/statefulset.yaml @@ -51,10 +51,6 @@ spec: image: "{{ .Values.global.readinessRepository }}/{{ .Values.global.readinessImage }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} name: {{ include "common.name" . }}-readiness - hostAliases: - - ip: "{{ .Values.config.aaiServiceClusterIp }}" - hostnames: - - "aai.api.simpledemo.openecomp.org" containers: - name: {{ include "common.name" . }} image: "{{ include "common.repository" . }}/{{ .Values.image }}" @@ -88,6 +84,9 @@ spec: - mountPath: /tmp/policy-install/config/feature-healthcheck.conf name: drools-secret subPath: feature-healthcheck.conf + - mountPath: /tmp/policy-install/config/feature-pooling-dmaap.conf + name: drools-config + subPath: feature-pooling-dmaap.conf - mountPath: /tmp/policy-install/config/base.conf name: drools-config subPath: base.conf @@ -160,6 +159,9 @@ spec: - key: base.conf path: base.conf mode: 0755 + - key: feature-pooling-dmaap.conf + path: feature-pooling-dmaap.conf + mode: 0755 - key: policy-management.conf path: policy-management.conf mode: 0755 diff --git a/kubernetes/policy/charts/drools/values.yaml b/kubernetes/policy/charts/drools/values.yaml index e42e6ce049..b469ce703f 100644 --- a/kubernetes/policy/charts/drools/values.yaml +++ b/kubernetes/policy/charts/drools/values.yaml @@ -27,7 +27,7 @@ global: ################################################################# # application image repository: nexus3.onap.org:10001 -image: onap/policy-drools:1.2.0 +image: onap/policy-drools:1.2.3 pullPolicy: Always # flag to enable debugging - application support required @@ -36,10 +36,9 @@ debugEnabled: false # application configuration config: nexusPort: 8081 - aaiServiceClusterIp: 10.43.255.254 # default number of instances -replicaCount: 4 +replicaCount: 1 nodeSelector: {} @@ -47,14 +46,14 @@ affinity: {} # probe configuration parameters liveness: - initialDelaySeconds: 10 + initialDelaySeconds: 180 periodSeconds: 10 # necessary to disable liveness probe when setting breakpoints # in debugger so K8s doesn't restart unresponsive container - enabled: false + enabled: true readiness: - initialDelaySeconds: 10 + initialDelaySeconds: 60 periodSeconds: 10 service: diff --git a/kubernetes/policy/charts/mariadb/resources/config/db.sh b/kubernetes/policy/charts/mariadb/resources/config/db.sh index ead656ef0e..067b3c312f 100644 --- a/kubernetes/policy/charts/mariadb/resources/config/db.sh +++ b/kubernetes/policy/charts/mariadb/resources/config/db.sh @@ -14,7 +14,7 @@ #!/bin/bash -xv -for db in support onap_sdk log +for db in support onap_sdk log migration operationshistory10 pooling 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/mariadb/values.yaml b/kubernetes/policy/charts/mariadb/values.yaml index 7703234a66..a3dd7676a4 100644 --- a/kubernetes/policy/charts/mariadb/values.yaml +++ b/kubernetes/policy/charts/mariadb/values.yaml @@ -45,14 +45,14 @@ affinity: {} # probe configuration parameters liveness: - initialDelaySeconds: 10 + initialDelaySeconds: 120 periodSeconds: 10 # necessary to disable liveness probe when setting breakpoints # in debugger so K8s doesn't restart unresponsive container enabled: true readiness: - initialDelaySeconds: 10 + initialDelaySeconds: 120 periodSeconds: 10 ## Persist data to a persitent volume diff --git a/kubernetes/policy/charts/pdp/resources/config/pe/pdplp.conf b/kubernetes/policy/charts/pdp/resources/config/pe/pdplp.conf index f5f4060aad..7f894fd4a9 100644 --- a/kubernetes/policy/charts/pdp/resources/config/pe/pdplp.conf +++ b/kubernetes/policy/charts/pdp/resources/config/pe/pdplp.conf @@ -18,8 +18,8 @@ LOGPARSER_X_MS_MB=1024 LOGPARSER_X_MX_MB=1024 SERVER=http://{{ include "common.servicename" . }}:{{.Values.service.externalPort}}/pdp/ -LOGPATH=/opt/app/policy/servers/pdp/logs/pdp-rest.log -PARSERLOGPATH=IntegrityMonitor.log +LOGPATH=/var/log/onap/policy/pdpx/pdp-rest.log +PARSERLOGPATH=/opt/app/policy/servers/pdplp/bin/IntegrityMonitor.log node_type=logparser # the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase diff --git a/kubernetes/policy/charts/pdp/values.yaml b/kubernetes/policy/charts/pdp/values.yaml index 9d3fdbd78c..45d8d60f5c 100644 --- a/kubernetes/policy/charts/pdp/values.yaml +++ b/kubernetes/policy/charts/pdp/values.yaml @@ -27,7 +27,7 @@ global: ################################################################# # application image repository: nexus3.onap.org:10001 -image: onap/policy-pe:1.2.0 +image: onap/policy-pe:1.2.3 pullPolicy: Always # flag to enable debugging - application support required @@ -38,7 +38,7 @@ config: papPort: 9091 # default number of instances -replicaCount: 2 +replicaCount: 1 nodeSelector: {} diff --git a/kubernetes/policy/resources/config/pe/pap.conf b/kubernetes/policy/resources/config/pe/pap.conf index ae9d47c491..8590dcac03 100644 --- a/kubernetes/policy/resources/config/pe/pap.conf +++ b/kubernetes/policy/resources/config/pe/pap.conf @@ -39,7 +39,7 @@ REST_ADMIN_REPOSITORY=repository REST_ADMIN_WORKSPACE=workspace # PDP related properties -PAP_PDP_URL=http://{{ .Release.Name }}-{{ .Values.global.pdp.nameOverride }}-0.{{ .Values.global.pdp.nameOverride }}.{{ include "common.namespace" . }}.svc.cluster.local:{{ .Values.config.pdpPort }}/pdp/,testpdp,alpha123;http://{{ .Release.Name }}-{{ .Values.global.pdp.nameOverride }}-1.{{ .Values.global.pdp.nameOverride }}.{{ include "common.namespace" . }}.svc.cluster.local:{{ .Values.config.pdpPort }}/pdp/ +PAP_PDP_URL=http://{{ .Release.Name }}-{{ .Values.global.pdp.nameOverride }}-0.{{ .Values.global.pdp.nameOverride }}.{{ include "common.namespace" . }}.svc.cluster.local:{{ .Values.config.pdpPort }}/pdp/,testpdp,alpha123;http://{{ .Release.Name }}-{{ .Values.global.pdp.nameOverride }}-1.{{ .Values.global.pdp.nameOverride }}.{{ include "common.namespace" . }}.svc.cluster.local:{{ .Values.config.pdpPort }}/pdp/,testpdp,alpha123;http://{{ .Release.Name }}-{{ .Values.global.pdp.nameOverride }}-2.{{ .Values.global.pdp.nameOverride }}.{{ include "common.namespace" . }}.svc.cluster.local:{{ .Values.config.pdpPort }}/pdp/,testpdp,alpha123;http://{{ .Release.Name }}-{{ .Values.global.pdp.nameOverride }}-3.{{ .Values.global.pdp.nameOverride }}.{{ include "common.namespace" . }}.svc.cluster.local:{{ .Values.config.pdpPort }}/pdp/ PAP_PDP_HTTP_USER_ID=testpdp PAP_PDP_HTTP_PASSWORD=alpha123 diff --git a/kubernetes/policy/resources/config/pe/paplp.conf b/kubernetes/policy/resources/config/pe/paplp.conf index 205497c35d..3d59d818c9 100644 --- a/kubernetes/policy/resources/config/pe/paplp.conf +++ b/kubernetes/policy/resources/config/pe/paplp.conf @@ -18,8 +18,8 @@ LOGPARSER_X_MS_MB=1024 LOGPARSER_X_MX_MB=1024 SERVER=http://{{ include "common.servicename" . }}:{{.Values.service.externalPort2}}/pap/ -LOGPATH=/opt/app/policy/servers/pap/logs/pap-rest.log -PARSERLOGPATH=IntegrityMonitor.log +LOGPATH=/var/log/onap/policy/pap/pap-rest.log +PARSERLOGPATH=/opt/app/policy/servers/paplp/bin/IntegrityMonitor.log node_type=logparser # the java property is RESOURCE_NAME (uppercase), but the conf parameter is lowercase diff --git a/kubernetes/policy/resources/config/pe/push-policies.sh b/kubernetes/policy/resources/config/pe/push-policies.sh index 5172086d8a..dcd3afb9ad 100644 --- a/kubernetes/policy/resources/config/pe/push-policies.sh +++ b/kubernetes/policy/resources/config/pe/push-policies.sh @@ -22,7 +22,7 @@ echo "Upload BRMS Param Template" sleep 2 -wget -O cl-amsterdam-template.drl https://git.onap.org/policy/drools-applications/plain/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl +wget -O cl-amsterdam-template.drl https://git.onap.org/policy/drools-applications/plain/controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl?h=beijing sleep 2 diff --git a/kubernetes/policy/values.yaml b/kubernetes/policy/values.yaml index d7dfbcfac7..6aa8c7e61a 100644 --- a/kubernetes/policy/values.yaml +++ b/kubernetes/policy/values.yaml @@ -40,7 +40,7 @@ global: ################################################################# # application image repository: nexus3.onap.org:10001 -image: onap/policy-pe:1.2.0 +image: onap/policy-pe:1.2.3 pullPolicy: Always subChartsOnly: |