From a59f75a18f26f2f7dea7f5556fc0a27471c8ff66 Mon Sep 17 00:00:00 2001 From: YongchaoWu Date: Tue, 28 Jan 2020 09:43:38 +0100 Subject: [PATCH] Add Policy agent blueprint Policy agent could be on board to ONAP deployment Define stream publishing and subscribing in blueprint Issue-ID: NONRTRIC-104 Signed-off-by: YongchaoWu Change-Id: I3a7a82bea7ce1dea53988dc84ca9629ed4458228 --- policy-agent/dpo/blueprints/k8s-policy-agent.yaml | 111 ++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 policy-agent/dpo/blueprints/k8s-policy-agent.yaml diff --git a/policy-agent/dpo/blueprints/k8s-policy-agent.yaml b/policy-agent/dpo/blueprints/k8s-policy-agent.yaml new file mode 100644 index 00000000..0121d27f --- /dev/null +++ b/policy-agent/dpo/blueprints/k8s-policy-agent.yaml @@ -0,0 +1,111 @@ + +#description: Docker application of policy agent managing policies +#blueprint_version: 1.0.0 +--- +tosca_definitions_version: cloudify_dsl_1_3 +description: Docker application to collect log file from PNF +imports: + - http://www.getcloudify.org/spec/cloudify/4.3.1/types.yaml + - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R5/k8splugin/1.6.0/k8splugin_types.yaml + - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/dmaap/dmaap.yaml +inputs: + policy-agent_cpu_limit: + type: string + default: "250m" + policy-agent_cpu_request: + type: string + default: "250m" + policy-agent_memory_limit: + type: string + default: "256Mi" + policy-agent_memory_request: + type: string + default: "256Mi" + envs: + default: {} + external_port: + type: string + default: ":0" + publish_topic_name: + type: string + default: "A1-POLICY-AGENT-WRITE" + subscribe_topic_name: + type: string + default: "A1-POLICY-AGENT-READ" + consumer_group: + type: string + default: "users" + consumer_id: + type: string + default: "policy-agent" + log_directory: + type: string + default: "/var/log/policy-agent" + replicas: + type: integer + description: number of instances + default: 1 + tag_version: + type: string + default: "nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent:1.0.0" +node_templates: + policy-agent: + type: dcae.nodes.ContainerizedServiceComponentUsingDmaap + interfaces: + cloudify.interfaces.lifecycle: + start: + inputs: + envs: + get_input: envs + properties: + application_config: + streams_publishes: + dmaap_publisher: + dmaap_info: + topic_url: { concat: ['https://message-router:3905/events/',{ get_input: publish_topic_name }] } + type: message_router + streams_subscribes: + dmaap_subscriber: + dmaap_info: + topic_url: { concat: ['https://message-router:3905/events/',{ get_input: subscribe_topic_name }, '/', { get_input: consumer_group }, "/", { get_input: consumer_id }] } + type: message_router + ric: + - name: ric1 + baseUrl: http://localhost:8083/ + managedElementIds: + - kista_1 + - kista_2 + - name: ric2 + baseUrl: http://localhost:8085/ + managedElementIds: + - kista_3 + - kista_4 + docker_config: + healthcheck: + interval: 15s + timeout: 1s + type: http + endpoint: /status + ports: + - concat: ["8081", {get_input: external_port}] + image: + get_input: tag_version + service_component_type: policy-agent + log_info: + log_directory: + get_input: log_directory + replicas: + get_input: replicas + resource_config: + limits: + cpu: + get_input: policy-agent_cpu_limit + memory: + get_input: policy-agent_memory_limit + requests: + cpu: + get_input: policy-agent_cpu_request + memory: + get_input: policy-agent_memory_request + + -- 2.16.6