Add Policy agent blueprint 52/2352/3
authorYongchaoWu <yongchao.wu@est.tech>
Tue, 28 Jan 2020 08:43:38 +0000 (09:43 +0100)
committeryongchao <yongchao.wu@est.tech>
Wed, 29 Jan 2020 08:43:10 +0000 (09:43 +0100)
Policy agent could be on board to ONAP deployment
Define stream publishing and subscribing in blueprint

Issue-ID: NONRTRIC-104
Signed-off-by: YongchaoWu <yongchao.wu@est.tech>
Change-Id: I3a7a82bea7ce1dea53988dc84ca9629ed4458228

policy-agent/dpo/blueprints/k8s-policy-agent.yaml [new file with mode: 0644]

diff --git a/policy-agent/dpo/blueprints/k8s-policy-agent.yaml b/policy-agent/dpo/blueprints/k8s-policy-agent.yaml
new file mode 100644 (file)
index 0000000..0121d27
--- /dev/null
@@ -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
+
+