aboutsummaryrefslogtreecommitdiffstats
path: root/blueprints/k8s-pmsh.yaml
blob: 39e0d95a3592305cbed5e00dbd2d643d0182b043 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
#
# ============LICENSE_START=======================================================
#  Copyright (C) 2020 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=========================================================
#

tosca_definitions_version: cloudify_dsl_1_3

imports:
  - 'http://www.getcloudify.org/spec/cloudify/4.5.5/types.yaml'
  - 'https://nexus.onap.org/service/local/repositories/raw/content/org.onap.dcaegen2.platform.plugins/R6/k8splugin/1.7.2/k8splugin_types.yaml'
  - 'https://nexus.onap.org/service/local/repositories/raw/content/org.onap.ccsdk.platform.plugins/type_files/pgaas/1.1.0/pgaas_types.yaml'

inputs:
  tag_version:
    type: string
    description: Docker image to be used
    default: 'nexus3.onap.org:10001/onap/org.onap.dcaegen2.services.pmsh:1.0.3'
  replicas:
    type: integer
    description: Number of instances
    default: 1
  operational_policy_name:
    type: string
    default: 'pmsh-operational-policy'
  control_loop_name:
    type: string
    default: 'pmsh-control-loop'
  pmsh_publish_topic_name:
    type: string
    default: 'unauthenticated.DCAE_CL_OUTPUT'
  policy_feedback_topic_name:
    type: string
    default: 'unauthenticated.PMSH_CL_INPUT'
  aai_notification_topic_name:
    type: string
    default: 'AAI-EVENT'
  publisher_client_role:
    type: string
    description: Client role to request secure access to topic
    default: 'org.onap.dcae.pmPublisher'
  subscriber_client_role:
    type: string
    description: Client role to request secure access to topic
    default: 'org.onap.dcae.pmSubscriber'
  dcae_location:
    type: string
    description: DCAE location for the subscriber, used to set up routing
    default: 'san-francisco'
  cpu_limit:
    type: string
    default: '1000m'
  cpu_request:
    type: string
    default: '1000m'
  memory_limit:
    type: string
    default: '1024Mi'
  memory_request:
    type: string
    default: '1024Mi'
  pgaas_cluster_name:
    type: string
    default: 'dcae-pg-primary.onap'
node_templates:
  pgaasvm:
    type: dcae.nodes.pgaas.database
    properties:
      writerfqdn: { get_input: pgaas_cluster_name }
      name: 'pmsh'
  pmsh:
    type: dcae.nodes.ContainerizedServiceComponentUsingDmaap
    interfaces:
      cloudify.interfaces.lifecycle:
        create:
          inputs:
            ports:
              - '8443:0'
            envs:
              PMSH_PG_URL:
                { get_attribute: [ pgaasvm, admin, host ] }
              PMSH_PG_PASSWORD:
                { get_attribute: [ pgaasvm, admin, password ] }
              PMSH_PG_USERNAME:
                { get_attribute: [ pgaasvm, admin, user ] }
              PMSH_DB_NAME:
                { get_attribute: [ pgaasvm, admin, database ] }

    relationships:
      - type: cloudify.relationships.depends_on
        target: pgaasvm

    properties:
      service_component_type: 'dcae-pmsh'
      service_component_name_override: 'dcae-pmsh'
      application_config:
        aaf_identity: 'dcae@dcae.onap.org'
        aaf_password: 'demo123456!'
        operational_policy_name: { get_input: operational_policy_name }
        control_loop_name: { get_input: control_loop_name }
        cert_path: '/opt/app/pmsh/etc/certs/cert.pem'
        key_path: '/opt/app/pmsh/etc/certs/key.pem'
        ca_cert_path: '/opt/app/pmsh/etc/certs/cacert.pem'
        streams_publishes:
          policy_pm_publisher:
            type: message_router
            dmaap_info:
              topic_url: {concat: ["https://message-router:3905/events/", { get_input: pmsh_publish_topic_name }]}
        streams_subscribes:
          policy_pm_subscriber:
            type: message_router
            dmaap_info:
              topic_url: {concat: ["https://message-router:3905/events/", { get_input: policy_feedback_topic_name }]}
          aai_subscriber:
            type: message_router
            dmaap_info:
              topic_url: {concat: ["https://message-router:3905/events/", { get_input: aai_notification_topic_name }]}
      resource_config:
        limits:
          cpu: { get_input: cpu_limit }
          memory: { get_input: memory_limit }
        requests:
          cpu: { get_input: cpu_request }
          memory: { get_input: memory_request }
      docker_config:
        healthcheck:
          endpoint: /healthcheck
          interval: 15s
          timeout: 1s
          type: https
      image: { get_input: tag_version }
      replicas: { get_input: replicas }
      log_info:
        log_directory: '/var/log/ONAP/dcaegen2/services/pmsh'
      tls_info:
        cert_directory: '/opt/app/pmsh/etc/certs'
        use_tls: true