diff options
Diffstat (limited to 'kubernetes')
21 files changed, 601 insertions, 17 deletions
diff --git a/kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties b/kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties index 026c399287..47c6788f9f 100644 --- a/kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties +++ b/kubernetes/appc/resources/config/appc/opt/onap/appc/data/properties/appc.properties @@ -32,9 +32,9 @@ appc.demo.threads.queuesize.max=1000 appc.demo.threads.poolsize.min=1 appc.demo.threads.poolsize.max=2 appc.demo.provider.user=admin -appc.demo.provider.pass=admin +appc.demo.provider.pass={{.Values.config.odlPassword}} appc.demo.provider.url=http://localhost:8181/restconf/operations/appc-provider -appc.provider.vfodl.url=http://admin:admin@{{.Values.service.name}}:{{.Values.service.externalPort}}/restconf/config/network-topology:network-topology/topology/topology-netconf/node/NODE_NAME/yang-ext:mount/sample-plugin:sample-plugin/pg-streams/ +appc.provider.vfodl.url=http://admin:{{.Values.config.odlPassword}}@{{.Values.service.name}}:{{.Values.service.externalPort}}/restconf/config/network-topology:network-topology/topology/topology-netconf/node/NODE_NAME/yang-ext:mount/sample-plugin:sample-plugin/pg-streams/ # The properties right below are needed to properly call the Master DG to serve demo purposes appc.service.logic.module.name=APPC @@ -80,7 +80,7 @@ appc.LCM.topic.read=APPC-LCM-READ appc.LCM.topic.write=APPC-LCM-WRITE appc.LCM.client.name=APPC-EVENT-LISTENER-TEST appc.LCM.provider.user=admin -appc.LCM.provider.pass=admin +appc.LCM.provider.pass={{.Values.config.odlPassword}} appc.LCM.provider.url=http://localhost:8181/restconf/operations/appc-provider-lcm appc.LCM.scopeOverlap.endpoint=http://localhost:8181/restconf/operations/interfaces-service:execute-service @@ -88,7 +88,7 @@ appc.LCM.scopeOverlap.endpoint=http://localhost:8181/restconf/operations/interfa poolMembers=message-router.{{.Release.Namespace}}:3904 event.pool.members=message-router.{{.Release.Namespace}}:3904 restconf.user=admin -restconf.pass=admin +restconf.pass={{.Values.config.odlPassword}} # properties found in appc-rest-adapter-bundle, appc-chef-adapter-bundle, appc-iaas-adapter-bundle) @@ -127,4 +127,4 @@ appc.OAM.topic.read=testOAM appc.OAM.topic.write=testOAM appc.OAM.client.name=testOAM appc.OAM.provider.user=admin -appc.OAM.provider.pass=admin +appc.OAM.provider.pass={{.Values.config.odlPassword}} diff --git a/kubernetes/appc/values.yaml b/kubernetes/appc/values.yaml index 5ee972132f..0325275e89 100644 --- a/kubernetes/appc/values.yaml +++ b/kubernetes/appc/values.yaml @@ -54,6 +54,7 @@ config: dmaapTopic: SUCCESS logstashServiceName: log-ls logstashPort: 5044 + odlPassword: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U openStackType: OpenStackProvider openStackName: OpenStack openStackKeyStoneUrl: http://localhost:8181/apidoc/explorer/index.html diff --git a/kubernetes/esr/templates/configmap.yaml b/kubernetes/esr/templates/configmap.yaml index 964570b64b..18a4f84773 100644 --- a/kubernetes/esr/templates/configmap.yaml +++ b/kubernetes/esr/templates/configmap.yaml @@ -18,6 +18,11 @@ kind: ConfigMap metadata: name: {{ include "common.fullname" . }}-esr-filebeat namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }} --- @@ -26,6 +31,10 @@ kind: ConfigMap metadata: name: {{ include "common.fullname" . }}-esr-esrserver-log namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/log/esrserver/logback.xml").AsConfig . | indent 2 }} - diff --git a/kubernetes/helm/plugins/deploy/deploy.sh b/kubernetes/helm/plugins/deploy/deploy.sh new file mode 100755 index 0000000000..07455d7db4 --- /dev/null +++ b/kubernetes/helm/plugins/deploy/deploy.sh @@ -0,0 +1,168 @@ +#!/bin/bash + +usage() { +cat << EOF +Install (or upgrade) an umbrella Helm Chart, and its subcharts, as separate Helm Releases + +The umbrella Helm Chart is broken apart into a parent release and subchart releases. +Subcharts the are disabled (<chart>.enabled=false) will not be installed or upgraded. +All releases are grouped and deployed within the same namespace. + + +The deploy arguments must be a release and chart. The chart +argument can be either: a chart reference('stable/onap'), a path to a chart directory, +a packaged chart, or a fully qualified URL. For chart references, the latest +version will be specified unless the '--version' flag is set. + +To override values in a chart, use either the '--values' flag and pass in a file +or use the '--set' flag and pass configuration from the command line, to force string +values, use '--set-string'. + +You can specify the '--values'/'-f' flag multiple times. The priority will be given to the +last (right-most) file specified. For example, if both myvalues.yaml and override.yaml +contained a key called 'Test', the value set in override.yaml would take precedence: + + $ helm deploy demo ./onap --namespace onap -f openstack.yaml -f overrides.yaml + +You can specify the '--set' flag multiple times. The priority will be given to the +last (right-most) set specified. For example, if both 'bar' and 'newbar' values are +set for a key called 'foo', the 'newbar' value would take precedence: + + $ helm deploy demo local/onap --namespace onap -f overrides.yaml --set log.enabled=false --set vid.enabled=false + +Usage: + helm deploy [RELEASE] [CHART] [flags] + +Flags: + --namespace string namespace to install the release into. Defaults to the current kube config namespace. + --set stringArray set values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) + --set-string stringArray set STRING values on the command line (can specify multiple or separate values with commas: key1=val1,key2=val2) + -f, --values valueFiles specify values in a YAML file or a URL(can specify multiple) (default []) +EOF +} + +parse_yaml() { + local prefix=$2 + local s='[[:space:]]*' w='[a-zA-Z0-9_]*' fs=$(echo @|tr @ '\034') + sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \ + -e "s|^\($s\)\($w\)$s:$s\(.*\)$s\$|\1$fs\2$fs\3|p" $1 | + awk -F$fs '{ + indent = length($1)/2; + vname[indent] = $2; + for (i in vname) {if (i > indent) {delete vname[i]}} + if (length($3) > 0) { + vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")} + printf("%s%s%s=\"%s\"\n", "'$prefix'",vn, $2, $3); + } + }' +} + +generate_overrides() { + SUBCHART_NAMES=($(cat $COMPUTED_OVERRIDES | grep -v '^\s\s')) + + for index in "${!SUBCHART_NAMES[@]}"; do + START=${SUBCHART_NAMES[index]} + END=${SUBCHART_NAMES[index+1]} + if [[ $START == "global:" ]]; then + echo "global:" > $GLOBAL_OVERRIDES + cat $COMPUTED_OVERRIDES | sed '/common:/,/consul:/d' \ + | sed -n '/'"$START"'/,/'log:'/p' | sed '1d;$d' >> $GLOBAL_OVERRIDES + else + SUBCHART_DIR="$CACHE_SUBCHART_DIR/$(cut -d':' -f1 <<<"$START")" + if [[ -d "$SUBCHART_DIR" ]]; then + cat $COMPUTED_OVERRIDES | sed -n '/'"$START"'/,/'"$END"'/p' \ + | sed '1d;$d' | cut -c3- > $SUBCHART_DIR/subchart-overrides.yaml + fi + fi + done +} + +deploy() { + RELEASE=$1 + CHART_URL=$2 + FLAGS=${@:3} + CHART_REPO="$(cut -d'/' -f1 <<<"$CHART_URL")" + CHART_NAME="$(cut -d'/' -f2 <<<"$CHART_URL")" + CACHE_DIR=~/.helm/plugins/deploy/cache + CHART_DIR=$CACHE_DIR/$CHART_NAME + CACHE_SUBCHART_DIR=$CHART_DIR-subcharts + # should pass all flags instead + NAMESPACE="$(echo $FLAGS | sed -n 's/.*\(namespace\).\s*/\1/p' | cut -c10-)" + + # clear previously cached charts + rm -rf $CACHE_DIR + + # fetch umbrella chart (parent chart containing subcharts) + if [[ -d "$CHART_URL" ]]; then + mkdir -p $CHART_DIR + cp -R $CHART_URL/* $CHART_DIR/ + + cd $CHART_DIR/charts/ + for subchart in * ; do + tar xzf ${subchart} + done + rm -rf *.tgz + else + helm fetch $CHART_URL --untar --untardir $CACHE_DIR + fi + + # move out subcharts to process separately + mkdir -p $CACHE_SUBCHART_DIR + mv $CHART_DIR/charts/* $CACHE_SUBCHART_DIR/ + # temp hack - parent chart needs common subchart + mv $CACHE_SUBCHART_DIR/common $CHART_DIR/charts/ + + # disable dependencies + rm $CHART_DIR/requirements.lock + mv $CHART_DIR/requirements.yaml $CHART_DIR/requirements.deploy + + # compute overrides for parent and all subcharts + COMPUTED_OVERRIDES=$CACHE_DIR/$CHART_NAME/computed-overrides.yaml + helm upgrade -i $RELEASE $CHART_DIR $FLAGS --dry-run --debug \ + | sed -n '/COMPUTED VALUES:/,/HOOKS:/p' | sed '1d;$d' > $COMPUTED_OVERRIDES + + # extract global overrides to apply to parent and all subcharts + GLOBAL_OVERRIDES=$CHART_DIR/global-overrides.yaml + generate_overrides $COMPUTED_OVERRIDES $GLOBAL_OVERRIDES + + # upgrade/install parent chart first + helm upgrade -i $RELEASE $CHART_DIR --namespace $NAMESPACE -f $COMPUTED_OVERRIDES + + # parse computed overrides - will use to determine if a subchart is "enabled" + eval $(parse_yaml $COMPUTED_OVERRIDES "computed_") + + # upgrade/install each "enabled" subchart + cd $CACHE_SUBCHART_DIR + for subchart in * ; do + VAR="computed_${subchart}_enabled" + COMMAND="$"$VAR + eval "SUBCHART_ENABLED=$COMMAND" + if [[ $SUBCHART_ENABLED == "true" ]]; then + SUBCHART_OVERRIDES=$CACHE_SUBCHART_DIR/$subchart/subchart-overrides.yaml + helm upgrade -i "${RELEASE}-${subchart}" $CACHE_SUBCHART_DIR/$subchart \ + --namespace $NAMESPACE -f $GLOBAL_OVERRIDES -f $SUBCHART_OVERRIDES + fi + done +} + +if [[ $# < 2 ]]; then + usage + exit 0 +fi + +case "${1:-"help"}" in + "help") + usage + ;; + "--help") + usage + ;; + "-h") + usage + ;; + *) + deploy $1 $2 ${@:3} + ;; +esac + +exit 0
\ No newline at end of file diff --git a/kubernetes/helm/plugins/deploy/plugin.yaml b/kubernetes/helm/plugins/deploy/plugin.yaml new file mode 100644 index 0000000000..fc7f7d0f88 --- /dev/null +++ b/kubernetes/helm/plugins/deploy/plugin.yaml @@ -0,0 +1,7 @@ +name: "deploy" +version: "1.0.0" +usage: "install (upgrade if release exists) parent chart and subcharts as separate +but related releases" +description: "install (upgrade if release exists) parent charty and all subcharts as separate +but related releases" +command: "$HELM_PLUGIN_DIR/deploy.sh"
\ No newline at end of file diff --git a/kubernetes/helm/plugins/undeploy/plugin.yaml b/kubernetes/helm/plugins/undeploy/plugin.yaml new file mode 100644 index 0000000000..02999fd04c --- /dev/null +++ b/kubernetes/helm/plugins/undeploy/plugin.yaml @@ -0,0 +1,7 @@ +name: "undeploy" +version: "1.0.0" +usage: "delete parent chart and subcharts that were deployed as separate +releases" +description: "delete parent chart and subcharts that were deployed as separate +releases" +command: "$HELM_PLUGIN_DIR/undeploy.sh"
\ No newline at end of file diff --git a/kubernetes/helm/plugins/undeploy/undeploy.sh b/kubernetes/helm/plugins/undeploy/undeploy.sh new file mode 100755 index 0000000000..02b5d34c65 --- /dev/null +++ b/kubernetes/helm/plugins/undeploy/undeploy.sh @@ -0,0 +1,52 @@ +#!/bin/bash + +usage() { +cat << EOF +Delete an umbrella Helm Chart, and its subcharts, that was previously deployed using 'Helm deploy'. + +Example of deleting all Releases that have the prefix 'demo'. + $ helm undeploy demo + + $ helm undeploy demo --purge + +Usage: + helm undeploy [RELEASE] [flags] + +Flags: + --purge remove the releases from the store and make its name free for later use +EOF +} + +undeploy() { + RELEASE=$1 + FLAGS=$2 + + array=($(helm ls -q | grep $RELEASE)) + n=${#array[*]} + for (( i = n-1; i >= 0; i-- )) + do + helm del "${array[i]}" $FLAGS + done +} + +if [[ $# < 1 ]]; then + echo "Error: command 'undeploy' requires a release name" + exit 0 +fi + +case "${1:-"help"}" in + "help") + usage + ;; + "--help") + usage + ;; + "-h") + usage + ;; + *) + undeploy $1 ${@:2} + ;; +esac + +exit 0
\ No newline at end of file diff --git a/kubernetes/multicloud/charts/multicloud-ocata/templates/configmap.yaml b/kubernetes/multicloud/charts/multicloud-ocata/templates/configmap.yaml index 16355ee513..7dd8fa5bd0 100644 --- a/kubernetes/multicloud/charts/multicloud-ocata/templates/configmap.yaml +++ b/kubernetes/multicloud/charts/multicloud-ocata/templates/configmap.yaml @@ -20,5 +20,10 @@ kind: ConfigMap metadata: name: {{ include "common.fullname" . }}-log-configmap namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }} diff --git a/kubernetes/multicloud/charts/multicloud-vio/templates/configmap.yaml b/kubernetes/multicloud/charts/multicloud-vio/templates/configmap.yaml index 411c445695..0b39a5c93e 100644 --- a/kubernetes/multicloud/charts/multicloud-vio/templates/configmap.yaml +++ b/kubernetes/multicloud/charts/multicloud-vio/templates/configmap.yaml @@ -20,5 +20,10 @@ kind: ConfigMap metadata: name: {{ include "common.fullname" . }}-log-configmap namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }} diff --git a/kubernetes/multicloud/charts/multicloud-windriver/templates/configmap.yaml b/kubernetes/multicloud/charts/multicloud-windriver/templates/configmap.yaml index 411c445695..0b39a5c93e 100644 --- a/kubernetes/multicloud/charts/multicloud-windriver/templates/configmap.yaml +++ b/kubernetes/multicloud/charts/multicloud-windriver/templates/configmap.yaml @@ -20,5 +20,10 @@ kind: ConfigMap metadata: name: {{ include "common.fullname" . }}-log-configmap namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/log/*").AsConfig . | indent 2 }} diff --git a/kubernetes/multicloud/templates/configmap.yaml b/kubernetes/multicloud/templates/configmap.yaml index bdbbc9b776..e2b789d5dd 100644 --- a/kubernetes/multicloud/templates/configmap.yaml +++ b/kubernetes/multicloud/templates/configmap.yaml @@ -20,6 +20,11 @@ kind: ConfigMap metadata: name: multicloud-filebeat-configmap namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/log/filebeat/*").AsConfig . | indent 2 }} --- @@ -28,6 +33,11 @@ kind: ConfigMap metadata: name: {{ include "common.fullname" . }}-log-configmap namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/log/framework/*").AsConfig . | indent 2 }} --- @@ -36,5 +46,10 @@ kind: ConfigMap metadata: name: {{ include "common.fullname" . }}-provider-plugin-configmap namespace: {{ include "common.namespace" . }} + labels: + app: {{ include "common.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} data: {{ tpl (.Files.Glob "resources/config/provider-plugin.json").AsConfig . | indent 2 }} diff --git a/kubernetes/policy/resources/config/pe/push-policies.sh b/kubernetes/policy/resources/config/pe/push-policies.sh index a86a5fcbd1..44f3b36abe 100644 --- a/kubernetes/policy/resources/config/pe/push-policies.sh +++ b/kubernetes/policy/resources/config/pe/push-policies.sh @@ -148,12 +148,45 @@ sleep 2 echo "Create MicroServicevCPE Policy" curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ - "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevCPE\", \"description\": \"MicroService vCPE Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"Measurement_vGMUX\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ABATED\" }, { \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"GREATER\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" }] }] } } }", + "configBody": "{ \"service\": \"tca_policy\", \"location\": \"SampleServiceLocation\", \"uuid\": \"test\", \"policyName\": \"MicroServicevCPE\", \"description\": \"MicroService vCPE Policy\", \"configName\": \"SampleConfigName\", \"templateVersion\": \"OpenSource.version.1\", \"version\": \"1.1.0\", \"priority\": \"1\", \"policyScope\": \"resource=SampleResource,service=SampleService,type=SampleType,closedLoopControlName=ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"riskType\": \"SampleRiskType\", \"riskLevel\": \"1\", \"guard\": \"False\", \"content\": { \"tca_policy\": { \"domain\": \"measurementsForVfScaling\", \"metricsPerEventName\": [{ \"eventName\": \"Measurement_vGMUX\", \"controlLoopSchemaType\": \"VNF\", \"policyScope\": \"DCAE\", \"policyName\": \"DCAE.Config_tca-hi-lo\", \"policyVersion\": \"v0.0.1\", \"thresholds\": [{ \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"EQUAL\", \"severity\": \"MAJOR\", \"closedLoopEventStatus\": \"ABATED\" }, { \"closedLoopControlName\": \"ControlLoop-vCPE-48f0c2c3-a172-4192-9ae3-052274181b6e\", \"version\": \"1.0.2\", \"fieldPath\": \"$.event.measurementsForVfScalingFields.additionalMeasurements[*].arrayOfFields[0].value\", \"thresholdValue\": 0, \"direction\": \"GREATER\", \"severity\": \"CRITICAL\", \"closedLoopEventStatus\": \"ONSET\" }] }] } } }", "policyConfigType": "MicroService", "policyName": "com.MicroServicevCPE", "onapName": "DCAE" }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' +#########################################Create SDNC Naming Policies########################################## + +echo "Create SDNC Naming Policies" + +sleep 2 + +echo "Create SDNC vFW Naming Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "configBody": "{\"service\":\"SDNC-GenerateName\",\"version\":\"CSIT\",\"content\":{\"policy-instance-name\":\"ONAP_VFW_NAMING_TIMESTAMP\",\"naming-models\":[{\"naming-properties\":[{\"property-name\":\"AIC_CLOUD_REGION\"},{\"property-name\":\"nfRole\"},{\"property-name\":\"TIMESTAMP\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNF\",\"nfRole\":\"vFW\",\"naming-recipe\":\"AIC_CLOUD_REGION|DELIMITER|nfRole|DELIMITER|TIMESTAMP\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"ENTIRETY\",\"start-value\":\"001\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}},{\"property-name\":\"NFC_NAMING_CODE\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNFC\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"},{\"property-name\":\"VF_MODULE_LABEL\"},{\"property-name\":\"VF_MODULE_TYPE\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"PRECEEDING\",\"start-value\":\"01\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}}],\"naming-type\":\"VF-MODULE\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"}],\"naming-type\":\"KEY\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"protected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"protected_private_net_id\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"unprotected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"unprotected_private_net_id\",\"nfRole\":\"vFW\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"}]}}", + "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP", + "policyConfigType": "MicroService", + "onapName": "SDNC", + "riskLevel": "4", + "riskType": "test", + "guard": "false", + "priority": "4", + "description": "ONAP_VFW_NAMING_TIMESTAMP" +}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' + +sleep 2 + +echo "Create SDNC vPG Naming Policy" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "configBody": "{\"service\":\"SDNC-GenerateName\",\"version\":\"CSIT\",\"content\":{\"policy-instance-name\":\"ONAP_VPG_NAMING_TIMESTAMP\",\"naming-models\":[{\"naming-properties\":[{\"property-name\":\"AIC_CLOUD_REGION\"},{\"property-name\":\"nfRole\"},{\"property-name\":\"TIMESTAMP\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNF\",\"nfRole\":\"vPG\",\"naming-recipe\":\"AIC_CLOUD_REGION|DELIMITER|nfRole|DELIMITER|TIMESTAMP\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"ENTIRETY\",\"start-value\":\"001\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}},{\"property-name\":\"NFC_NAMING_CODE\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"VNFC\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|NFC_NAMING_CODE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"},{\"property-name\":\"VF_MODULE_LABEL\"},{\"property-name\":\"VF_MODULE_TYPE\"},{\"property-name\":\"SEQUENCE\",\"increment-sequence\":{\"max\":\"zzz\",\"scope\":\"PRECEEDING\",\"start-value\":\"01\",\"length\":\"3\",\"increment\":\"1\",\"sequence-type\":\"alpha-numeric\"}}],\"naming-type\":\"VF-MODULE\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|VF_MODULE_LABEL|DELIMITER|VF_MODULE_TYPE|DELIMITER|SEQUENCE\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"}],\"naming-type\":\"KEY\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"protected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"protected_private_net_id\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"},{\"naming-properties\":[{\"property-name\":\"VNF_NAME\"},{\"property-value\":\"unprotected\",\"property-name\":\"CONSTANT\"},{\"property-value\":\"_\",\"property-name\":\"DELIMITER\"}],\"naming-type\":\"unprotected_private_net_id\",\"nfRole\":\"vPG\",\"naming-recipe\":\"VNF_NAME|DELIMITER|CONSTANT\"}]}}", + "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP", + "policyConfigType": "MicroService", + "onapName": "SDNC", + "riskLevel": "4", + "riskType": "test", + "guard": "false", + "priority": "4", + "description": "ONAP_VPG_NAMING_TIMESTAMP" +}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/createPolicy' #########################################Creating Decision Guard policy######################################### @@ -262,3 +295,24 @@ curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'A "policyName": "com.MicroServicevCPE", "policyType": "MicroService" }' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' + +#########################################Pushing SDNC Naming Policies########################################## +echo "Pushing SDNC Naming Policies" + +sleep 2 + +echo "pushPolicy : PUT : SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "SDNC_Policy.ONAP_VFW_NAMING_TIMESTAMP", + "policyType": "MicroService" +}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' + +sleep 10 + +echo "pushPolicy : PUT : SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP" +curl -k -v --silent -X PUT --header 'Content-Type: application/json' --header 'Accept: text/plain' --header 'ClientAuth: cHl0aG9uOnRlc3Q=' --header 'Authorization: Basic dGVzdHBkcDphbHBoYTEyMw==' --header 'Environment: TEST' -d '{ + "pdpGroup": "default", + "policyName": "SDNC_Policy.ONAP_VPG_NAMING_TIMESTAMP", + "policyType": "MicroService" +}' 'https://{{.Values.global.pdp.nameOverride}}:{{.Values.config.pdpPort}}/pdp/api/pushPolicy' diff --git a/kubernetes/pomba/charts/pomba-kibana/resources/config/default.json b/kubernetes/pomba/charts/pomba-kibana/resources/config/default.json index f58be68ddc..d54dbfe686 100644 --- a/kubernetes/pomba/charts/pomba-kibana/resources/config/default.json +++ b/kubernetes/pomba/charts/pomba-kibana/resources/config/default.json @@ -204,7 +204,7 @@ "index-pattern": { "title": "service-validations*", "timeFieldName": "validationTimestamp", - "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"modelInvariantId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"modelName\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"modelVersionId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"result\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"serviceInstanceId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"validationId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"validationTimestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.category\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.errorMessage\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.modelName\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.severity\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.validationRule\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*]-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*]-type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].nf-naming-code\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vf-module-list.invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vf-module-list.max-instances\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vf-module-list.min-instances\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vf-module-list.uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vnfc-list.name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vnfc-list.nfc-naming-code\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf[*]-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf[*]-type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-service-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vf-module-list.invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vf-module-list.max-instances\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vf-module-list.min-instances\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vf-module-list.uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vnfc-list.invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vnfc-list.name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vnfc-list.nfc-naming-code\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vnfc-list.uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdnc-vf-list[*]-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdnc-vf-list[*]-type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdnc-vf[*]-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdnc-vf[*]-type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationTimestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationType\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false}]" + "fields": "[{\"name\":\"_id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_index\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"_score\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_source\",\"type\":\"_source\",\"count\":0,\"scripted\":false,\"searchable\":false,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"_type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":false},{\"name\":\"modelInvariantId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"modelName\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"modelVersionId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"result\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"serviceInstanceId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"validationId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"validationTimestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.category\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.errorMessage\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.modelName\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.severity\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.validationRule\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*]-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*]-type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].nf-naming-code\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vf-module-list.invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vf-module-list.max-instances\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vf-module-list.min-instances\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vf-module-list.uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vnfc-list.name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf-list[*].vnfc-list.nfc-naming-code\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf[*]-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-aai-vf[*]-type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-service-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vf-module-list.invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vf-module-list.max-instances\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vf-module-list.min-instances\",\"type\":\"number\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vf-module-list.uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vnfc-list.invariant-id\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vnfc-list.name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vnfc-list.nfc-naming-code\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdc-vf-list[*].vnfc-list.uuid\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdnc-vf-list[*]-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdnc-vf-list[*]-type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdnc-vf[*]-name\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationDetails.context-list-sdnc-vf[*]-type\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"violations.violationTimestamp\",\"type\":\"date\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":true,\"readFromDocValues\":true},{\"name\":\"violations.violationType\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"client\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false},{\"name\":\"requestId\",\"type\":\"string\",\"count\":0,\"scripted\":false,\"searchable\":true,\"aggregatable\":false,\"readFromDocValues\":false}]" } } }{ @@ -236,4 +236,4 @@ } } } -}
\ No newline at end of file +} diff --git a/kubernetes/pomba/charts/pomba-kibana/resources/config/validationsDump.json b/kubernetes/pomba/charts/pomba-kibana/resources/config/validationsDump.json index e9ebad77e7..ae01e9679f 100644 --- a/kubernetes/pomba/charts/pomba-kibana/resources/config/validationsDump.json +++ b/kubernetes/pomba/charts/pomba-kibana/resources/config/validationsDump.json @@ -178,9 +178,15 @@ "type": "text" } } + }, + "client": { + "type": "text" + }, + "requestId": { + "type": "text" } } } } } -}
\ No newline at end of file +} diff --git a/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy b/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy new file mode 100644 index 0000000000..c6699091f7 --- /dev/null +++ b/kubernetes/pomba/charts/pomba-validation-service/resources/bundleconfig/etc/rules/poa-event/default-rules.groovy @@ -0,0 +1,226 @@ +/* + * ============LICENSE_START=================================================== + * Copyright (c) 2018 Amdocs + * ============================================================================ + * 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===================================================== + */ + +entity { + name 'POA-EVENT' + indexing { + indices 'default-rules' + } + validation { + + // NDCB-AAI comparison: Context level + useRule { + name 'NDCB-AAI-attribute-comparison' + attributes 'context-list.ndcb', 'context-list.aai' + } + + // NDCB-AAI comparison: Service entity + useRule { + name 'NDCB-AAI-attribute-comparison' + attributes 'context-list.ndcb.service', 'context-list.aai.service' + } + + // NDCB-AAI comparison: VF list + useRule { + name 'NDCB-AAI-attribute-comparison' + attributes 'context-list.ndcb.vfList[*]', 'context-list.aai.vfList[*]' + } + + // NDCB-AAI comparison: VF-Module list + useRule { + name 'NDCB-AAI-attribute-comparison' + attributes 'context-list.ndcb.vfList[*].vfModuleList[*]', 'context-list.aai.vfList[*].vfModuleList[*]' + } + + // NDCB-AAI comparison: VNFC list + useRule { + name 'NDCB-AAI-attribute-comparison' + attributes 'context-list.ndcb.vfList[*].vnfcList[*]', 'context-list.aai.vfList[*].vnfcList[*]' + } + + // NDCB-AAI comparison: VM list + useRule { + name 'NDCB-AAI-attribute-comparison' + attributes 'context-list.ndcb.vfList[*].vfModuleList[*].vmList[*]', 'context-list.aai.vfList[*].vfModuleList[*].vmList[*]' + } + + // NDCB-AAI comparison: Network list + useRule { + name 'NDCB-AAI-attribute-comparison' + attributes 'context-list.ndcb.vfList[*].vfModuleList[*].networkList[*]', 'context-list.aai.vfList[*].vfModuleList[*].networkList[*]' + } + + // SDC-AAI VNFC type + useRule { + name 'SDC-AAI-vnfc-type' + attributes 'context-list.sdc.vfList[*].vnfcList[*]', 'context-list.aai.vfList[*].vnfcList[*]' + } + + // SDC-AAI VNFC node count + useRule { + name 'SDC-AAI-vnfc-node-count' + attributes 'context-list.sdc.vfList[*].vnfcList[*]', 'context-list.aai.vfList[*].vnfcList[*]' + } + + // SDC-AAI VF-Module instance + useRule { + name 'SDC-AAI-vf-module-instance-check' + attributes 'context-list.ndcb.vfList[*].vfModuleList[*]', 'context-list.aai.vfList[*].vfModuleList[*]' + } + } +} + +rule { + name 'SDC-AAI-vnfc-type' + category 'INVALID_VALUE' + description 'Validate that each VNFC instance in AAI conforms to a VNFC type defined in SDC model' + errorText 'AAI VNFC instance includes non-specified type in design SDC model' + severity 'ERROR' + attributes 'sdcList', 'aaiList' + validate ''' + def getVnfcTypes = { parsedData -> + parsedData.collect{ it.findResult{ k, v -> if(k.equals("type")) {return "$v"}}} + } + + def slurper = new groovy.json.JsonSlurper() + def sdcTypes = getVnfcTypes(slurper.parseText(sdcList.toString())) + def aaiTypes = getVnfcTypes(slurper.parseText(aaiList.toString())) + + // each type in AAI must exist in SDC + return aaiTypes.containsAll(sdcTypes) + ''' +} + +rule { + name 'SDC-AAI-vnfc-node-count' + category 'INVALID_VALUE' + description 'Validate that for each VNFC node defined in SDC model, there is at least one VNFC instance in AAI' + errorText 'Design has specified types but not all of them exist in AAI' + severity 'WARNING' + attributes 'sdcList', 'aaiList' + validate ''' + def getVnfcNodes = { parsedData -> + parsedData.collect { new Tuple2( + it.findResult{ k, v -> if(k.equals("name")) {return "$v"}}, + it.findResult{ k, v -> if(k.equals("type")) {return "$v"}}) + } + } + + def slurper = new groovy.json.JsonSlurper() + def sdcNodes = getVnfcNodes(slurper.parseText(sdcList.toString())) + def aaiNodes = getVnfcNodes(slurper.parseText(aaiList.toString())) + + // each node in AAI must exist in SDC + return aaiNodes.containsAll(sdcNodes) + ''' +} + +rule { + name 'SDC-AAI-vf-module-instance-check' + category 'INVALID_VALUE' + description 'Validate that each VF module instance in AAI conforms to a VF module defined in SDC service model' + errorText 'One or more AAI VF module instance(s) not defined in SDC model' + severity 'CRITICAL' + attributes 'sdcList', 'aaiList' + validate ''' + def getVfModules = { parsedData -> + parsedData.collect{ it.findResult{ k, v -> if(k.equals("name")) {return "$v"}}} + } + + def slurper = new groovy.json.JsonSlurper() + def sdcVfModules = getVfModules(slurper.parseText(sdcList.toString())) + def aaiVfModules = getVfModules(slurper.parseText(aaiList.toString())) + + // all VF modules in AAI must exist in SDC + return aaiVfModules.containsAll(sdcVfModules) + ''' +} + +rule { + name 'NDCB-AAI-attribute-comparison' + category 'INVALID_VALUE' + description 'Verify that every attribute in Network-Discovery is the same as in AAI' + errorText 'Some attributes in Network-Discovery are not equal to attributes in AAI' + severity 'ERROR' + attributes 'ndcbItems', 'aaiItems' + validate ''' + Closure<java.util.Map> getAttributes = { parsedData -> + java.util.Map attributeMap = new java.util.HashMap() + + def isAttributeDataQualityOk = { attribute -> + attribute.findResult{ k, v -> if(k.equals("dataQuality") ) {return v.get("status")}}.equals("ok") + } + + def addToMap = { attrKey, attrValue -> + java.util.Set values = attributeMap.get("$attrKey") + if(values == null) { + values = new java.util.HashSet() + attributeMap.put("$attrKey", values) + } + values.add("$attrValue") + } + + def addAttributeToMap = { attribute -> + if(isAttributeDataQualityOk(attribute)) { + String key, value + attribute.each { k, v -> + if(k.equals("name")) {key = "$v"} + if(k.equals("value")) {value = "$v"} + } + addToMap("$key", "$value") + } + } + + def processKeyValue = { key, value -> + if(value instanceof java.util.ArrayList) { + if(key.equals("attributeList")) { + value.each { + addAttributeToMap(it) + } + } + } else if(!(value instanceof groovy.json.internal.LazyMap)) { + // only add key-value attributes, skip the rest + addToMap("$key", "$value") + } + } + + if(parsedData instanceof java.util.ArrayList) { + parsedData.each { + it.each { key, value -> processKeyValue(key, value) } + } + } else { + parsedData.each { key, value -> processKeyValue(key, value) } + } + return attributeMap + } + + def slurper = new groovy.json.JsonSlurper() + java.util.Map ndcb = getAttributes(slurper.parseText(ndcbItems.toString())) + java.util.Map aai = getAttributes(slurper.parseText(aaiItems.toString())) + + ndcb.each{ ndcbKey, ndcbValueList -> + def aaiValueList = aai.get("$ndcbKey") + aaiValueList.each{ aaiValue -> + if(!ndcbValueList.any{ it == "$aaiValue" }) { + return false + } + } + } + return true + ''' +}
\ No newline at end of file diff --git a/kubernetes/pomba/charts/pomba-validation-service/templates/configmap.yaml b/kubernetes/pomba/charts/pomba-validation-service/templates/configmap.yaml index e66afdc71e..d3bfd813e6 100644 --- a/kubernetes/pomba/charts/pomba-validation-service/templates/configmap.yaml +++ b/kubernetes/pomba/charts/pomba-validation-service/templates/configmap.yaml @@ -35,3 +35,11 @@ metadata: namespace: {{ include "common.namespace" . }} data: {{ tpl (.Files.Glob "resources/appconfig/topics/*.properties").AsConfig . | indent 2 }} +--- +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "common.fullname" . }}-rules + namespace: {{ include "common.namespace" . }} +data: +{{ tpl (.Files.Glob "resources/bundleconfig/etc/rules/poa-event/*.groovy").AsConfig . | indent 2 }} diff --git a/kubernetes/pomba/charts/pomba-validation-service/templates/deployment.yaml b/kubernetes/pomba/charts/pomba-validation-service/templates/deployment.yaml index 550223b4e9..5faa45357c 100644 --- a/kubernetes/pomba/charts/pomba-validation-service/templates/deployment.yaml +++ b/kubernetes/pomba/charts/pomba-validation-service/templates/deployment.yaml @@ -72,6 +72,8 @@ spec: name: config-auth - mountPath: {{ .Values.config.configTopicsDir }}/ name: config-topics + - mountPath: {{ .Values.config.rulesDir }}/ + name: rules resources: {{ toYaml .Values.resources | indent 12 }} {{- if .Values.nodeSelector }} @@ -125,5 +127,12 @@ spec: path: topic-poa-audit-result.properties - key: topic-poa-rule-validation.properties path: topic-poa-rule-validation.properties + - name: rules + configMap: + name: {{ include "common.fullname" . }}-rules + defaultMode: 0644 + items: + - key: default-rules.groovy + path: default-rules.groovy imagePullSecrets: - name: "{{ include "common.namespace" . }}-docker-registry-key" diff --git a/kubernetes/pomba/charts/pomba-validation-service/values.yaml b/kubernetes/pomba/charts/pomba-validation-service/values.yaml index 775527f4b8..9607671e45 100644 --- a/kubernetes/pomba/charts/pomba-validation-service/values.yaml +++ b/kubernetes/pomba/charts/pomba-validation-service/values.yaml @@ -43,6 +43,7 @@ config: configDir: /opt/app/validation-service/appconfig configAuthDir: /opt/app/validation-service/appconfig/auth configTopicsDir: /opt/app/validation-service/appconfig/topics + rulesDir: /opt/app/validation-service/bundleconfig/etc/rules/poa-event maxHeap: 1024 # username: myusername # password: mypassword diff --git a/kubernetes/vid/templates/deployment.yaml b/kubernetes/vid/templates/deployment.yaml index 3a7bdcaa43..5c98b04ae8 100644 --- a/kubernetes/vid/templates/deployment.yaml +++ b/kubernetes/vid/templates/deployment.yaml @@ -59,10 +59,6 @@ spec: - name: {{ include "common.name" . }} image: "{{ include "common.repository" . }}/{{ .Values.image }}" imagePullPolicy: {{ .Values.global.pullPolicy | default .Values.pullPolicy }} - lifecycle: - postStart: - exec: - command: ["/bin/sh", "-c", "export LOG=wait_logback.log; touch $LOG; export SRC=/tmp/logback.xml; export DST=/usr/local/tomcat/webapps/vid/WEB-INF/classes/; while [ ! -e $DST ]; do echo 'Waiting for $DST...' >> $LOG; sleep 5; done; sleep 2; /bin/cp -f $SRC $DST; echo 'Done' >> $LOG"] ports: - containerPort: {{ .Values.service.internalPort }} # disable liveness probe when breakpoints set in debugger diff --git a/kubernetes/vid/templates/service.yaml b/kubernetes/vid/templates/service.yaml index 3d1097f7ff..36b35e40da 100644 --- a/kubernetes/vid/templates/service.yaml +++ b/kubernetes/vid/templates/service.yaml @@ -29,10 +29,16 @@ spec: - port: {{ .Values.service.internalPort }} nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort }} name: {{ .Values.service.portName }} + - port: {{ .Values.service.internalPort2 }} + nodePort: {{ .Values.global.nodePortPrefix | default .Values.nodePortPrefix }}{{ .Values.service.nodePort2 }} + name: {{ .Values.service.portName2 }} {{- else -}} - port: {{ .Values.service.externalPort }} targetPort: {{ .Values.service.internalPort }} name: {{ .Values.service.portName }} + - port: {{ .Values.service.externalPort2 }} + targetPort: {{ .Values.service.internalPort2 }} + name: {{ .Values.service.portName2 }} {{- end}} selector: app: {{ include "common.name" . }} diff --git a/kubernetes/vid/values.yaml b/kubernetes/vid/values.yaml index 812f74e1ce..4e5f403391 100644 --- a/kubernetes/vid/values.yaml +++ b/kubernetes/vid/values.yaml @@ -28,7 +28,7 @@ subChartsOnly: # application image repository: nexus3.onap.org:10001 -image: onap/vid:2.0.0 +image: onap/vid:3.0.0 pullPolicy: Always # mariadb image for initializing @@ -80,9 +80,13 @@ service: type: NodePort name: vid portName: vid - externalPort: "00" - nodePort: "00" + externalPort: 8443 internalPort: 8443 + nodePort: "00" + portName2: vid-http + externalPort2: 8080 + internalPort2: 8080 + nodePort2: "38" ingress: enabled: false |