Uplift from ONAP
[nonrtric/plt/a1policymanagementservice.git] / dpo / blueprints / k8s-policy-agent.yaml
1 #  ============LICENSE_START===============================================
2 #  Copyright (C) 2020-2022 Nordix Foundation. All rights reserved.
3 #  ========================================================================
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15 #  ============LICENSE_END=================================================
16 #
17
18 #description: Docker application of Policy Agent managing policies
19 #blueprint_version: 1.0.0
20 ---
21 tosca_definitions_version: cloudify_dsl_1_3
22 description: Docker application to collect log file from PNF
23 imports:
24   - http://www.getcloudify.org/spec/cloudify/4.3.1/types.yaml
25   - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R5/k8splugin/1.6.0/k8splugin_types.yaml
26   - https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/dmaap/dmaap.yaml
27 inputs:
28   policy-agent_cpu_limit:
29     type: string
30     default: "250m"
31   policy-agent_cpu_request:
32     type: string
33     default: "250m"
34   policy-agent_memory_limit:
35     type: string
36     default: "256Mi"
37   policy-agent_memory_request:
38     type: string
39     default: "256Mi"
40   envs:
41     default: {}
42   external_port:
43     type: string
44     default: ":0"
45   publish_topic_name:
46     type: string
47     default: "A1-POLICY-AGENT-WRITE"
48   subscribe_topic_name:
49     type: string
50     default: "A1-POLICY-AGENT-READ"
51   consumer_group:
52     type: string
53     default: "users"
54   consumer_id:
55     type: string
56     default: "policy-agent"
57   log_directory:
58     type: string
59     default: "/var/log/policy-agent"
60   replicas:
61     type: integer
62     description: number of instances
63     default: 1
64   tag_version:
65     type: string
66     default: "nexus3.o-ran-sc.org:10004/o-ran-sc/nonrtric-policy-agent:1.0.0"
67 node_templates:
68   policy-agent:
69     type: dcae.nodes.ContainerizedServiceComponentUsingDmaap
70     interfaces:
71       cloudify.interfaces.lifecycle:
72         start:
73           inputs:
74             envs:
75               get_input: envs
76     properties:
77       application_config:
78         ric:
79           - name: ric1
80             baseUrl: http://localhost:8083/
81             managedElementIds:
82               - kista_1
83               - kista_2
84           - name: ric2
85             baseUrl: http://localhost:8085/
86             managedElementIds:
87               - kista_3
88               - kista_4
89       docker_config:
90         healthcheck:
91           interval: 15s
92           timeout: 1s
93           type: http
94           endpoint: /status
95         ports:
96           - concat: ["8081", { get_input: external_port }]
97       image:
98         get_input: tag_version
99       service_component_type: policy-agent
100       log_info:
101         log_directory:
102           get_input: log_directory
103       replicas:
104         get_input: replicas
105       resource_config:
106         limits:
107           cpu:
108             get_input: policy-agent_cpu_limit
109           memory:
110             get_input: policy-agent_memory_limit
111         requests:
112           cpu:
113             get_input: policy-agent_cpu_request
114           memory:
115             get_input: policy-agent_memory_request