diff options
Diffstat (limited to 'compose')
-rw-r--r-- | compose/config/nginx/nginx.conf | 18 | ||||
-rw-r--r-- | compose/docker-compose.pdp.scale.yml | 52 | ||||
-rw-r--r-- | compose/metrics/prometheus.yml | 124 | ||||
-rwxr-xr-x | compose/start-multiple-pdp.sh | 36 | ||||
-rwxr-xr-x | compose/stop-compose.sh | 2 |
5 files changed, 167 insertions, 65 deletions
diff --git a/compose/config/nginx/nginx.conf b/compose/config/nginx/nginx.conf new file mode 100644 index 00000000..08d65627 --- /dev/null +++ b/compose/config/nginx/nginx.conf @@ -0,0 +1,18 @@ +user nginx; + +events { + worker_connections 1000; +} + +http { + upstream pdps { + server apexpdp:6969; + server apexpdp:23324; + } + server { + listen 30001; + location / { + proxy_pass http://pdps; + } + } +} diff --git a/compose/docker-compose.pdp.scale.yml b/compose/docker-compose.pdp.scale.yml new file mode 100644 index 00000000..53376ab2 --- /dev/null +++ b/compose/docker-compose.pdp.scale.yml @@ -0,0 +1,52 @@ +# +# ===========LICENSE_START==================================================== +# Copyright (C) 2023 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===================================================== +# + +version: '2' +services: + apexpdp: + image: ${CONTAINER_LOCATION}onap/policy-apex-pdp:${POLICY_APEX_PDP_VERSION} + depends_on: + - mariadb + - simulator + - pap + hostname: policy-apex-pdp + expose: + - 6969 + - 23324 + deploy: + mode: replicated + replicas: ${REPLICAS} + volumes: + - ./config/apex-pdp/OnapPfConfig.json:/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json:ro + - ./config/apex-pdp/logback.xml:/opt/app/policy/apex-pdp/etc/logback.xml:ro + - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro + entrypoint: /opt/app/policy/bin/wait_for_port.sh + command: [ + '-c', '/opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json', + 'mariadb', '3306', + 'message-router', '3904', + 'pap', '6969' + ] + nginx: + image: ${CONTAINER_LOCATION}library/nginx:latest + volumes: + - ./config/nginx/nginx.conf:/etc/nginx/nginx.conf:ro + depends_on: + - apexpdp + ports: + - ${APEX_PORT}:${APEX_PORT} diff --git a/compose/metrics/prometheus.yml b/compose/metrics/prometheus.yml index 789cfc2a..c3d87f57 100644 --- a/compose/metrics/prometheus.yml +++ b/compose/metrics/prometheus.yml @@ -24,78 +24,74 @@ global: # Alertmanager configuration alerting: alertmanagers: - - static_configs: - - targets: - # - alertmanager:9093 + - static_configs: + - targets: + # - alertmanager:9093 # scrape config scrape_configs: - - job_name: "api-metrics" - metrics_path: /policy/api/v1/metrics - static_configs: - - targets: ["policy-api:6969"] - basic_auth: - username: "policyadmin" - password: "zb!XztG34" +- job_name: "api-metrics" + metrics_path: /policy/api/v1/metrics + static_configs: + - targets: ["policy-api:6969"] + basic_auth: + username: "policyadmin" + password: "zb!XztG34" - - job_name: "pap-metrics" - metrics_path: /policy/pap/v1/metrics - static_configs: - - targets: ["policy-pap:6969"] - basic_auth: - username: "policyadmin" - password: "zb!XztG34" +- job_name: "pap-metrics" + metrics_path: /policy/pap/v1/metrics + static_configs: + - targets: ["policy-pap:6969"] + basic_auth: + username: "policyadmin" + password: "zb!XztG34" - - job_name: "apex-pdp-metrics" - static_configs: - - targets: - - "policy-apex-pdp:6969" - basic_auth: - username: "policyadmin" - password: "zb!XztG34" +- job_name: "apex-pdp-metrics" + static_configs: + - targets: + - "policy-apex-pdp:6969" + basic_auth: + username: "policyadmin" + password: "zb!XztG34" - - job_name: "drools-apps-metrics" - static_configs: - - targets: - - "drools-apps:9696" - basic_auth: - username: "demo@people.osaaf.org" - password: "demo123456!" +- job_name: "drools-apps-metrics" + static_configs: + - targets: + - "drools-apps:9696" + basic_auth: + username: "demo@people.osaaf.org" + password: "demo123456!" - - job_name: "drools-pdp-metrics" - static_configs: - - targets: - - "drools:9696" - basic_auth: - username: "demo@people.osaaf.org" - password: "demo123456!" +- job_name: "drools-pdp-metrics" + static_configs: + - targets: + - "drools:9696" + basic_auth: + username: "demo@people.osaaf.org" + password: "demo123456!" - - job_name: "distribution-metrics" - static_configs: - - targets: - - "policy-distribution:6969" - basic_auth: - username: "policyadmin" - password: "zb!XztG34" +- job_name: "distribution-metrics" + static_configs: + - targets: + - "policy-distribution:6969" + basic_auth: + username: "policyadmin" + password: "zb!XztG34" - - job_name: "xacml-pdp-metrics" - static_configs: - - targets: - - "policy-xacml-pdp:6969" - basic_auth: - username: "policyadmin" - password: "zb!XztG34" +- job_name: "xacml-pdp-metrics" + static_configs: + - targets: + - "policy-xacml-pdp:6969" + basic_auth: + username: "policyadmin" + password: "zb!XztG34" - - job_name: "acm-metrics" - metrics_path: "/onap/policy/clamp/acm/prometheus" - static_configs: - - targets: - - "policy-clamp-runtime-acm:6969" - basic_auth: - username: "runtimeUser" - password: "zb!XztG34" - - - job_name: "node" - static_configs: - - targets: ["node-exporter:9100"] +- job_name: "acm-metrics" + metrics_path: "/onap/policy/clamp/acm/prometheus" + static_configs: + - targets: + - "policy-clamp-runtime-acm:6969" + basic_auth: + username: "runtimeUser" + password: "zb!XztG34" diff --git a/compose/start-multiple-pdp.sh b/compose/start-multiple-pdp.sh new file mode 100755 index 00000000..30572875 --- /dev/null +++ b/compose/start-multiple-pdp.sh @@ -0,0 +1,36 @@ +#!/bin/bash +# +# ============LICENSE_START==================================================== +# Copyright (C) 2023 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. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END====================================================== + +if [ -z "${WORKSPACE}" ]; then + WORKSPACE=$(git rev-parse --show-toplevel) + export WORKSPACE +fi +COMPOSE_FOLDER="${WORKSPACE}"/compose + +cd ${COMPOSE_FOLDER} + +echo "Configuring docker compose..." +source export-ports.sh > /dev/null 2>&1 +source get-versions.sh > /dev/null 2>&1 + +export REPLICAS=${1} +docker-compose -f docker-compose.yml -f docker-compose.pdp.scale.yml up -d apexpdp nginx grafana + +cd ${WORKSPACE}
\ No newline at end of file diff --git a/compose/stop-compose.sh b/compose/stop-compose.sh index 810c9fe0..a8185215 100755 --- a/compose/stop-compose.sh +++ b/compose/stop-compose.sh @@ -33,4 +33,4 @@ docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml logs > docker_compose.l cat docker_compose.log echo "Tearing down containers..." -docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml down -v +docker-compose -f "${COMPOSE_FOLDER}"/docker-compose.yml down -v --remove-orphans |