[k8splugin] Add support to move CMPv2 keystore in place of AAFCertMan
[dcaegen2/platform/plugins.git] / k8s / k8splugin_types.yaml
1 # ================================================================================
2 # Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
3 # Copyright (c) 2020 Pantheon.tech. All rights reserved.
4 # Copyright (c) 2020 Nokia. All rights reserved.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #     http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
18 #
19
20 tosca_definitions_version: cloudify_dsl_1_3
21
22 plugins:
23   k8s:
24     executor: 'central_deployment_agent'
25     package_name: k8splugin
26     package_version: 3.4.1
27
28 data_types:
29
30   dcae.types.LoggingInfo:
31     description: >
32       Information for setting up centralized logging via ELK using a "sidecar" container.
33       If 'log_directory' is not provided, the plugin will not set up ELK logging.
34       (The properties all have to be declared as not required, otherwise the
35       'log_info' property on the node would also be required.)
36     properties:
37       log_directory:
38         description: >
39           The path in the container where the component writes its logs.
40           If the component is following the EELF requirements, this would be
41           the directory where the four EELF files are being written.
42           (Other logs can be placed in the directory--if their names in '.log',
43           they'll also be sent into ELK.)
44         type: string
45         required: false
46       alternate_fb_path:
47         description: >
48           Hope not to use this.  By default, the plugin will mount the log volume
49           at /var/log/onap/<component_type> in the sidecar container's file system.
50           'alternate_fb_path' allows overriding the default.  Will affect how the log
51           data can be found in the ELK system.
52         type: string
53         required: false
54
55   dcae.types.TLSInfo:
56     description: >
57       Information for using TLS (HTTPS).  (The properties all have to be declared as not
58       required, otherwise the tls_info property on the node would also be required.)
59     properties:
60       cert_directory:
61         description: >
62           The path in the container where the component expects to find TLS-related data.
63         type: string
64         required: false
65       use_tls:
66         description: >
67           Flag indicating whether TLS (HTTPS) is to be used
68         type: boolean
69         required: false
70
71   dcae.types.ExternalCertParameters:
72     description: >
73       Certificate parameters for external TLS info
74     properties:
75       common_name:
76         description: >
77           Common name which should be present in certificate
78         type: string
79         required: false
80         default: ""
81       sans:
82         description: >
83           List of Subject Alternative Names (SANs) which should be present in certificate
84         type: string
85         required: false
86         default: ""
87
88   dcae.types.ExternalTLSInfo:
89     description: >
90       Information for using external TLS.
91     properties:
92       external_cert_directory:
93         description: >
94           The path in the container where the component expects to find TLS-related data.
95         type: string
96         required: false
97         default: "/opt/app/dcae-certificate/external"
98       use_external_tls:
99         description: >
100           Flag indicating whether external TLS is to be used
101         type: boolean
102         required: false
103         default: false
104       ca_name:
105         description: >
106           Name of Certificate Authority configured on CertService side
107         type: string
108         required: false
109         default: "RA"
110       cert_type:
111         description: >
112           Type of output certificates
113         type: string
114         required: false
115         default: "P12"
116       external_certificate_parameters:
117         description: >
118           Certificate parameters for external TLS info
119         type: dcae.types.ExternalCertParameters
120         required: false
121
122 node_types:
123     dcae.nodes.ContainerizedComponent:
124     # Base type for all containerized components
125     # Captures common properties and interfaces
126         derived_from: cloudify.nodes.Root
127         properties:
128             image:
129                 type: string
130                 description: Full uri of the Docker image
131
132             application_config:
133                 default: {}
134                 description: >
135                   Application configuration for this component. The data structure is
136                   expected to be a complex map (native YAML) and to be constructed and filled
137                   by the creator of the blueprint.
138
139             docker_config:
140                 default: {}
141                 description: >
142                   Copied from the auxiliary portion of the component spec that contains things
143                   like healthcheck definitions for the component. Health checks are
144                   optional.
145
146             resource_config:
147                 default: {}
148                 description: >
149                   This is used to specify the cpu and memory request and limit for container.
150                   Please specify "requests" property and/or a "limits" property, with subproproperties
151                   for cpu and memory. (https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/)
152
153             log_info:
154               type: dcae.types.LoggingInfo
155               description: >
156                 Information for setting up centralized logging via ELK.
157               required: false
158
159             tls_info:
160               type: dcae.types.TLSInfo
161               description: >
162                 Information for setting up TLS (HTTPS).
163               required: false
164
165             external_cert:
166               type: dcae.types.ExternalTLSInfo
167               description: >
168                 Information for setting up external TLS
169               required: false
170
171             replicas:
172               type: integer
173               description: >
174                 The number of instances of the component that should be launched initially
175               default: 1
176
177             always_pull_image:
178               type: boolean
179               description: >
180                 Set to true if the orchestrator should always pull a new copy of the image
181                 before deploying.  By default the orchestrator pulls only if the image is
182                 not already present on the host where the container is being launched.
183               default: false
184
185             location_id:
186               type: string
187               description: >
188                 The identifier for the location where the component is to be deployed.
189                 If absent, the plugin uses its configured default location, typically the location
190                 where the plugin is running (the central site).  Also used to supply a location to
191                 the DMaaP bus controller if the component is being provisioned as a publisher or
192                 subscriber to a DMaaP feed or topic.
193               required: false
194
195         interfaces:
196             dcae.interfaces.update:
197                 scale:
198                     implementation: k8s.k8splugin.scale
199                 update_image:
200                     implementation: k8s.k8splugin.update_image
201
202     # The ContainerizedServiceComponent node type is to be used for DCAE service components.
203     #
204     # The plugin deploys the component into a Kubernetes cluster with a very specific choice
205     # of Kubernetes elements that are deliberately not under the control of the blueprint author.
206     # The idea is to deploy all service components in a consistent way, with the details abstracted
207     # away from the blueprint author.  The plugin is responsible for:
208     #   * Generation of the service component name
209     #   * Managing of service component configuration information
210     dcae.nodes.ContainerizedServiceComponent:
211         derived_from: dcae.nodes.ContainerizedComponent
212         properties:
213             service_component_type:
214                 type: string
215                 description: Service component type of the application being run in the container
216
217             service_id:
218                 type: string
219                 description: >
220                   Unique id for this DCAE service instance this component belongs to. This value
221                   will be applied as a tag in the registration of this component with Consul.
222                 default: Null
223
224             location_id:
225                 type: string
226                 description: >
227                   Location id of where to run the container.  Not used by the plugin.  Here for backward compatibility.
228                 default: Null
229                 required: False
230
231             service_component_name_override:
232                 type: string
233                 description: >
234                     Manually override and set the name for this component. If this
235                     is set, then the name will not be auto-generated.  Using this feature provides
236                     a service component with a fixed name that's known in advance, but care must be taken
237                     to avoid attempting to deploy two components with the same name.  If the component
238                     exposes any ports, the k8s Service created by the plugin will use service_component_name_override
239                     as the DNS host name.
240                 default: Null
241
242         interfaces:
243             cloudify.interfaces.lifecycle:
244                 create:
245                     # Generate service component name and populate config into Consul
246                     implementation: k8s.k8splugin.create_for_components
247                 start:
248                     # Create k8s entities for the component and start
249                     implementation: k8s.k8splugin.create_and_start_container_for_components
250                 stop:
251                     # Stop and remove k8s entities associated with the component
252                     implementation: k8s.k8splugin.stop_and_remove_container
253                 delete:
254                     # Delete configuration from Consul
255                     implementation: k8s.k8splugin.cleanup_discovery
256             dcae.interfaces.policy:
257                 # This is to be invoked by the policy handler upon policy updates
258                 policy_update:
259                     implementation: k8s.k8splugin.policy_update
260
261     # This node type is intended for DCAE service components that use DMaaP and must use the
262     # DMaaP plugin.
263     dcae.nodes.ContainerizedServiceComponentUsingDmaap:
264         derived_from: dcae.nodes.ContainerizedServiceComponent
265         properties:
266             streams_publishes:
267                 description: >
268                   List of DMaaP streams used for publishing.
269
270                   Message router items look like:
271
272                     name: topic00
273                     location: mtc5
274                     client_role: XXXX
275                     type: message_router
276
277                   Data router items look like:
278
279                     name: feed00
280                     location: mtc5
281                     type: data_router
282
283                   This information is forwarded to the dmaap plugin to provision
284                 default: []
285             streams_subscribes:
286                 description: >
287                   List of DMaaP streams used for subscribing.
288
289                   Message router items look like:
290
291                     name: topic00
292                     location: mtc5
293                     client_role: XXXX
294                     type: message_router
295
296                   Data router items look like:
297
298                     name: feed00
299                     location: mtc5
300                     type: data_router
301                     username: king
302                     password: 123456
303                     route: some-path
304                     scheme: https
305
306                   Note that username and password is optional. If not provided or null then the
307                   plugin will generate them.
308
309                 default: []
310         interfaces:
311             cloudify.interfaces.lifecycle:
312                 create:
313                     # Generate service component name, populate config into Consul, set up runtime properties for DMaaP plugin
314                     implementation: k8s.k8splugin.create_for_components_with_streams
315
316     # ContainerizedApplication is intended to be more of an all-purpose Docker container node
317     # for non-componentized applications.
318     dcae.nodes.ContainerizedApplication:
319         derived_from: cloudify.nodes.Root
320         properties:
321             name:
322                 type: string
323                 description: Name of the Docker container to be given
324             image:
325                 type: string
326                 description: Full uri of the Docker image
327         interfaces:
328             cloudify.interfaces.lifecycle:
329                 start:
330                     # Create Docker container and start
331                     implementation: k8s.k8splugin.create_and_start_container
332                 stop:
333                     # Stop and remove Docker container
334                     implementation: k8s.k8splugin.stop_and_remove_container
335             dcae.interfaces.scale:
336                 scale:
337                     implementation: k8s.k8splugin.scale
338             dcae.interfaces.update:
339                 update_image:
340                     implementation: k8s.k8splugin.update_image