1 # ================================================================================
2 # Copyright (c) 2017-2019 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
23 executor: 'central_deployment_agent'
24 package_name: k8splugin
25 package_version: 1.7.1
29 dcae.types.MSBRegistration:
31 Information for registering an HTTP service into MSB. It's optional to do so,
32 but if MSB registration is desired at least the port property must be provided.
33 If 'port' property is not provided, the plugin will not do the registration.
34 (The properties all have to be declared as not required, otherwise the
35 'msb_registration' property on the node would also be required.)
38 description: The container port at which the service is exposed
42 description: The version identifier for the service
46 description: The URL path (e.g., "/api", not the full URL) to the service endpoint
50 description: Set to true if service endpoint uses SSL (TLS)
54 dcae.types.LoggingInfo:
56 Information for setting up centralized logging via ELK using a "sidecar" container.
57 If 'log_directory' is not provided, the plugin will not set up ELK logging.
58 (The properties all have to be declared as not required, otherwise the
59 'log_info' property on the node would also be required.)
63 The path in the container where the component writes its logs.
64 If the component is following the EELF requirements, this would be
65 the directory where the four EELF files are being written.
66 (Other logs can be placed in the directory--if their names in '.log',
67 they'll also be sent into ELK.)
72 Hope not to use this. By default, the plugin will mount the log volume
73 at /var/log/onap/<component_type> in the sidecar container's file system.
74 'alternate_fb_path' allows overriding the default. Will affect how the log
75 data can be found in the ELK system.
81 Information for using TLS (HTTPS). (The properties all have to be declared as not
82 required, otherwise the tls_info property on the node would also be required.)
86 The path in the container where the component expects to find TLS-related data.
91 Flag indicating whether TLS (HTTPS) is to be used
96 dcae.nodes.ContainerizedComponent:
97 # Base type for all containerized components
98 # Captures common properties and interfaces
99 derived_from: cloudify.nodes.Root
103 description: Full uri of the Docker image
108 Application configuration for this Docker component. The data structure is
109 expected to be a complex map (native YAML) and to be constructed and filled
110 by the creator of the blueprint.
115 Copied from the auxiliary portion of the component spec that contains things
116 like healthcheck definitions for the Docker component. Health checks are
122 This is used to specify the cpu and memory request and limit for container.
123 Please specify "requests" property and/or a "limits" property, with subproproperties
124 for cpu and memory. (https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/)
127 type: dcae.types.LoggingInfo
129 Information for setting up centralized logging via ELK.
133 type: dcae.types.TLSInfo
135 Information for setting up TLS (HTTPS).
141 The number of instances of the component that should be launched initially
147 Set to true if the orchestrator should always pull a new copy of the image
148 before deploying. By default the orchestrator pulls only if the image is
149 not already present on the Docker host where the container is being launched.
155 The identifier for the location where the component is to be deployed.
156 If absent, the plugin uses its configured default location, typically the location
157 where the plugin is running (the central site). Also used to supply a location to
158 the DMaaP bus controller if the component is being provisioned as a publisher or
159 subscriber to a DMaaP feed or topic.
163 dcae.interfaces.update:
165 implementation: k8s.k8splugin.scale
167 implementation: k8s.k8splugin.update_image
169 # The ContainerizedServiceComponent node type is to be used for DCAE service components that
170 # are to be run in a Docker container. This node type goes beyond that of a ordinary Docker
171 # plugin where it has DCAE platform specific functionality:
173 # * Generation of the service component name
174 # * Managing of service component configuration information
176 # The plugin deploys the container into a Kubernetes cluster with a very specific choice
177 # of Kubernetes elements that are deliberately not under the control of the blueprint author.
178 # The idea is to deploy all service components in a consistent way, with the details abstracted
179 # away from the blueprint author.
180 dcae.nodes.ContainerizedServiceComponent:
181 derived_from: dcae.nodes.ContainerizedComponent
183 service_component_type:
185 description: Service component type of the application being run in the container
190 Unique id for this DCAE service instance this component belongs to. This value
191 will be applied as a tag in the registration of this component with Consul.
197 Location id of where to run the container. Not used by the plugin. Here for backward compatibility.
201 service_component_name_override:
204 Manually override and set the name for this Docker container node. If this
205 is set, then the name will not be auto-generated. Using this feature provides
206 a service component with a fixed name that's known in advance, but care must be taken
207 to avoid attempting to deploy two components with the same name.
211 cloudify.interfaces.lifecycle:
213 # Generate service component name and populate config into Consul
214 implementation: k8s.k8splugin.create_for_components
216 # Create Docker container and start
217 implementation: k8s.k8splugin.create_and_start_container_for_components
219 # Stop and remove Docker container
220 implementation: k8s.k8splugin.stop_and_remove_container
222 # Delete configuration from Consul
223 implementation: k8s.k8splugin.cleanup_discovery
224 dcae.interfaces.policy:
225 # This is to be invoked by the policy handler upon policy updates
227 implementation: k8s.k8splugin.policy_update
229 # This node type is intended for DCAE service components that use DMaaP and must use the
231 dcae.nodes.ContainerizedServiceComponentUsingDmaap:
232 derived_from: dcae.nodes.ContainerizedServiceComponent
236 List of DMaaP streams used for publishing.
238 Message router items look like:
245 Data router items look like:
251 This information is forwarded to the dmaap plugin to provision
255 List of DMaaP streams used for subscribing.
257 Message router items look like:
264 Data router items look like:
274 Note that username and password is optional. If not provided or null then the
275 plugin will generate them.
279 cloudify.interfaces.lifecycle:
281 # Generate service component name, populate config into Consul, set up runtime properties for DMaaP plugin
282 implementation: k8s.k8splugin.create_for_components_with_streams
284 # ContainerizedPlatformComponent is intended for DCAE platform services. Unlike the components,
285 # platform services have well-known names and well-known ports.
286 dcae.nodes.ContainerizedPlatformComponent:
287 derived_from: dcae.nodes.ContainerizedComponent
291 Container name used to register with Consul
295 Name to be registered in the DNS for the service provided by the container.
296 If not provided, the 'name' field is used.
297 This is a work-around for the Kubernetes restriction on having '_' in a DNS name.
298 Having this field allows a component to look up its configuration using a name that
299 includes a '_' while providing a legal Kubernetes DNS name.
304 Network port that the platform service is expecting to expose on the host
310 Network port that the platform service exposes in the container
314 type: dcae.types.MSBRegistration
316 Information for registering with MSB
320 cloudify.interfaces.lifecycle:
322 # Populate config into Consul
323 implementation: k8s.k8splugin.create_for_platforms
325 # Create Docker container and start
326 implementation: k8s.k8splugin.create_and_start_container_for_platforms
328 # Stop and remove Docker container
329 implementation: k8s.k8splugin.stop_and_remove_container
331 # Delete configuration from Consul
332 implementation: k8s.k8splugin.cleanup_discovery
334 # ContainerizedApplication is intended to be more of an all-purpose Docker container node
335 # for non-componentized applications.
336 dcae.nodes.ContainerizedApplication:
337 derived_from: cloudify.nodes.Root
341 description: Name of the Docker container to be given
344 description: Full uri of the Docker image
346 cloudify.interfaces.lifecycle:
348 # Create Docker container and start
349 implementation: k8s.k8splugin.create_and_start_container
351 # Stop and remove Docker container
352 implementation: k8s.k8splugin.stop_and_remove_container
353 dcae.interfaces.scale:
355 implementation: k8s.k8splugin.scale
356 dcae.interfaces.update:
358 implementation: k8s.k8splugin.update_image