diff options
Diffstat (limited to 'kubernetes/policy/charts/drools')
6 files changed, 85 insertions, 16 deletions
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: |