1 # ================================================================================
2 # Copyright (c) 2017-2018 AT&T Intellectual Property. 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
8 # http://www.apache.org/licenses/LICENSE-2.0
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=========================================================
17 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
19 tosca_definitions_version: cloudify_dsl_1_3
22 - http://www.getcloudify.org/spec/cloudify/3.4/types.yaml
26 executor: 'central_deployment_agent'
27 package_name: k8splugin
28 package_version: 1.2.0
32 dcae.types.MSBRegistration:
34 Information for registering an HTTP service into MSB. It's optional to do so,
35 but if MSB registration is desired at least the port property must be provided.
36 If 'port' property is not provided, the plugin will not do the registration.
37 (The properties all have to be declared as not required, otherwise the
38 'msb_registration' property on the node would also be required.)
41 description: The container port at which the service is exposed
45 description: The version identifier for the service
49 description: The URL path (e.g., "/api", not the full URL) to the service endpoint
53 description: Set to true if service endpoint uses SSL (TLS)
57 dcae.types.LoggingInfo:
59 Information for setting up centralized logging via ELK using a "sidecar" container.
60 If 'log_directory' is not provided, the plugin will not set up ELK logging.
61 (The properties all have to be declared as not required, otherwise the
62 'log_info' property on the node would also be required.)
66 The path in the container where the component writes its logs.
67 If the component is following the EELF requirements, this would be
68 the directory where the four EELF files are being written.
69 (Other logs can be placed in the directory--if their names in '.log',
70 they'll also be sent into ELK.)
75 Hope not to use this. By default, the plugin will mount the log volume
76 at /var/log/onap/<component_type> in the sidecar container's file system.
77 'alternate_fb_path' allows overriding the default. Will affect how the log
78 data can be found in the ELK system.
83 # The ContainerizedServiceComponent node type is to be used for DCAE service components that
84 # are to be run in a Docker container. This node type goes beyond that of a ordinary Docker
85 # plugin where it has DCAE platform specific functionality:
87 # * Generation of the service component name
88 # * Managing of service component configuration information
90 # The plugin deploys the container into a Kubernetes cluster with a very specific choice
91 # of Kubernetes elements that are deliberately not under the control of the blueprint author.
92 # The idea is to deploy all service components in a consistent way, with the details abstracted
93 # away from the blueprint author.
94 dcae.nodes.ContainerizedServiceComponent:
95 derived_from: cloudify.nodes.Root
97 service_component_type:
99 description: Service component type of the application being run in the container
104 Unique id for this DCAE service instance this component belongs to. This value
105 will be applied as a tag in the registration of this component with Consul.
111 Location id of where to run the container. Not used by the plugin. Here for backward compatibility.
115 service_component_name_override:
118 Manually override and set the name for this Docker container node. If this
119 is set, then the name will not be auto-generated. Platform services are the
120 specific use cases for using this parameter because they have static
121 names for example the CDAP broker.
127 Application configuration for this Docker component. The data structure is
128 expected to be a complex map (native YAML) and to be constructed and filled
129 by the creator of the blueprint.
134 This is what is the auxilary portion of the component spec that contains things
135 like healthcheck definitions for the Docker component. Health checks are
140 description: Full uri of the Docker image
143 type: dcae.types.LoggingInfo
145 Information for setting up centralized logging via ELK.
151 The number of instances of the component that should be launched initially
157 Set to true if the orchestrator should always pull a new copy of the image
158 before deploying. By default the orchestrator pulls only if the image is
159 not already present on the Docker host where the container is being launched.
163 cloudify.interfaces.lifecycle:
165 # Generate service component name and populate config into Consul
166 implementation: k8s.k8splugin.create_for_components
168 # Create Docker container and start
169 implementation: k8s.k8splugin.create_and_start_container_for_components
171 # Stop and remove Docker container
172 implementation: k8s.k8splugin.stop_and_remove_container
174 # Delete configuration from Consul
175 implementation: k8s.k8splugin.cleanup_discovery
176 dcae.interfaces.policy:
177 # This is to be invoked by the policy handler upon policy updates
179 implementation: k8s.k8splugin.policy_update
180 dcae.interfaces.scale:
182 implementation: k8s.k8splugin.scale
185 # This node type is intended for DCAE service components that use DMaaP and must use the
187 dcae.nodes.ContainerizedServiceComponentUsingDmaap:
188 derived_from: dcae.nodes.ContainerizedServiceComponent
192 List of DMaaP streams used for publishing.
194 Message router items look like:
201 Data router items look like:
207 This information is forwarded to the dmaap plugin to provision
211 List of DMaaP streams used for subscribing.
213 Message router items look like:
220 Data router items look like:
230 Note that username and password is optional. If not provided or null then the
231 plugin will generate them.
235 cloudify.interfaces.lifecycle:
237 # Generate service component name and populate config into Consul
238 implementation: k8s.k8splugin.create_for_components_with_streams
240 # Create Docker container and start
241 implementation: k8s.k8splugin.create_and_start_container_for_components_with_streams
244 # ContainerizedPlatformComponent is intended for DCAE platform services. Unlike the components,
245 # platform services have well-known names and well-known ports.
246 dcae.nodes.ContainerizedPlatformComponent:
247 derived_from: cloudify.nodes.Root
251 Container name used to register with Consul
255 Name to be registered in the DNS for the service provided by the container.
256 If not provided, the 'name' field is used.
257 This is a work-around for the Kubernetes restriction on having '_' in a DNS name.
258 Having this field allows a component to look up its configuration using a name that
259 includes a '_' while providing a legal Kubernetes DNS name.
264 Application configuration for this Docker component. The data strcture is
265 expected to be a complex map (native YAML) and to be constructed and filled
266 by the creator of the blueprint.
271 This is what is the auxilary portion of the component spec that contains things
272 like healthcheck definitions for the Docker component. Health checks are
277 description: Full uri of the Docker image
282 Network port that the platform service is expecting to expose on the host
288 Network port that the platform service exposes in the container
292 type: dcae.types.MSBRegistration
294 Information for registering with MSB
298 type: dcae.types.LoggingInfo
300 Information for setting up centralized logging via ELK.
306 The number of instances of the component that should be launched initially
312 Set to true if the orchestrator should always pull a new copy of the image
313 before deploying. By default the orchestrator pulls only if the image is
314 not already present on the Docker host where the container is being launched.
318 cloudify.interfaces.lifecycle:
320 # Populate config into Consul
321 implementation: k8s.k8splugin.create_for_platforms
323 # Create Docker container and start
324 implementation: k8s.k8splugin.create_and_start_container_for_platforms
326 # Stop and remove Docker container
327 implementation: k8s.k8splugin.stop_and_remove_container
329 # Delete configuration from Consul
330 implementation: k8s.k8splugin.cleanup_discovery
331 dcae.interfaces.scale:
333 implementation: k8s.k8splugin.tasks.scale
335 # ContainerizedApplication is intended to be more of an all-purpose Docker container node
336 # for non-componentized applications.
337 dcae.nodes.ContainerizedApplication:
338 derived_from: cloudify.nodes.Root
342 description: Name of the Docker container to be given
345 description: Full uri of the Docker image
347 cloudify.interfaces.lifecycle:
349 # Create Docker container and start
350 implementation: k8s.k8splugin.create_and_start_container
352 # Stop and remove Docker container
353 implementation: k8s.k8splugin.stop_and_remove_container