1 # ================================================================================
2 # Copyright (c) 2017-2019 AT&T Intellectual Property. All rights reserved.
3 # Copyright (c) 2020 Pantheon.tech. All rights reserved.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ============LICENSE_END=========================================================
18 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
20 tosca_definitions_version: cloudify_dsl_1_3
24 executor: 'central_deployment_agent'
25 package_name: k8splugin
26 package_version: 2.0.0
30 dcae.types.MSBRegistration:
32 Information for registering an HTTP service into MSB. It's optional to do so,
33 but if MSB registration is desired at least the port property must be provided.
34 If 'port' property is not provided, the plugin will not do the registration.
35 (The properties all have to be declared as not required, otherwise the
36 'msb_registration' property on the node would also be required.)
39 description: The container port at which the service is exposed
43 description: The version identifier for the service
47 description: The URL path (e.g., "/api", not the full URL) to the service endpoint
51 description: Set to true if service endpoint uses SSL (TLS)
55 dcae.types.LoggingInfo:
57 Information for setting up centralized logging via ELK using a "sidecar" container.
58 If 'log_directory' is not provided, the plugin will not set up ELK logging.
59 (The properties all have to be declared as not required, otherwise the
60 'log_info' property on the node would also be required.)
64 The path in the container where the component writes its logs.
65 If the component is following the EELF requirements, this would be
66 the directory where the four EELF files are being written.
67 (Other logs can be placed in the directory--if their names in '.log',
68 they'll also be sent into ELK.)
73 Hope not to use this. By default, the plugin will mount the log volume
74 at /var/log/onap/<component_type> in the sidecar container's file system.
75 'alternate_fb_path' allows overriding the default. Will affect how the log
76 data can be found in the ELK system.
82 Information for using TLS (HTTPS). (The properties all have to be declared as not
83 required, otherwise the tls_info property on the node would also be required.)
87 The path in the container where the component expects to find TLS-related data.
92 Flag indicating whether TLS (HTTPS) is to be used
97 dcae.nodes.ContainerizedComponent:
98 # Base type for all containerized components
99 # Captures common properties and interfaces
100 derived_from: cloudify.nodes.Root
104 description: Full uri of the Docker image
109 Application configuration for this Docker component. The data structure is
110 expected to be a complex map (native YAML) and to be constructed and filled
111 by the creator of the blueprint.
116 Copied from the auxiliary portion of the component spec that contains things
117 like healthcheck definitions for the Docker component. Health checks are
123 This is used to specify the cpu and memory request and limit for container.
124 Please specify "requests" property and/or a "limits" property, with subproproperties
125 for cpu and memory. (https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/)
128 type: dcae.types.LoggingInfo
130 Information for setting up centralized logging via ELK.
134 type: dcae.types.TLSInfo
136 Information for setting up TLS (HTTPS).
142 The number of instances of the component that should be launched initially
148 Set to true if the orchestrator should always pull a new copy of the image
149 before deploying. By default the orchestrator pulls only if the image is
150 not already present on the Docker host where the container is being launched.
156 The identifier for the location where the component is to be deployed.
157 If absent, the plugin uses its configured default location, typically the location
158 where the plugin is running (the central site). Also used to supply a location to
159 the DMaaP bus controller if the component is being provisioned as a publisher or
160 subscriber to a DMaaP feed or topic.
164 dcae.interfaces.update:
166 implementation: k8s.k8splugin.scale
168 implementation: k8s.k8splugin.update_image
170 # The ContainerizedServiceComponent node type is to be used for DCAE service components that
171 # are to be run in a Docker container. This node type goes beyond that of a ordinary Docker
172 # plugin where it has DCAE platform specific functionality:
174 # * Generation of the service component name
175 # * Managing of service component configuration information
177 # The plugin deploys the container into a Kubernetes cluster with a very specific choice
178 # of Kubernetes elements that are deliberately not under the control of the blueprint author.
179 # The idea is to deploy all service components in a consistent way, with the details abstracted
180 # away from the blueprint author.
181 dcae.nodes.ContainerizedServiceComponent:
182 derived_from: dcae.nodes.ContainerizedComponent
184 service_component_type:
186 description: Service component type of the application being run in the container
191 Unique id for this DCAE service instance this component belongs to. This value
192 will be applied as a tag in the registration of this component with Consul.
198 Location id of where to run the container. Not used by the plugin. Here for backward compatibility.
202 service_component_name_override:
205 Manually override and set the name for this Docker container node. If this
206 is set, then the name will not be auto-generated. Using this feature provides
207 a service component with a fixed name that's known in advance, but care must be taken
208 to avoid attempting to deploy two components with the same name.
212 cloudify.interfaces.lifecycle:
214 # Generate service component name and populate config into Consul
215 implementation: k8s.k8splugin.create_for_components
217 # Create Docker container and start
218 implementation: k8s.k8splugin.create_and_start_container_for_components
220 # Stop and remove Docker container
221 implementation: k8s.k8splugin.stop_and_remove_container
223 # Delete configuration from Consul
224 implementation: k8s.k8splugin.cleanup_discovery
225 dcae.interfaces.policy:
226 # This is to be invoked by the policy handler upon policy updates
228 implementation: k8s.k8splugin.policy_update
230 # This node type is intended for DCAE service components that use DMaaP and must use the
232 dcae.nodes.ContainerizedServiceComponentUsingDmaap:
233 derived_from: dcae.nodes.ContainerizedServiceComponent
237 List of DMaaP streams used for publishing.
239 Message router items look like:
246 Data router items look like:
252 This information is forwarded to the dmaap plugin to provision
256 List of DMaaP streams used for subscribing.
258 Message router items look like:
265 Data router items look like:
275 Note that username and password is optional. If not provided or null then the
276 plugin will generate them.
280 cloudify.interfaces.lifecycle:
282 # Generate service component name, populate config into Consul, set up runtime properties for DMaaP plugin
283 implementation: k8s.k8splugin.create_for_components_with_streams
285 # ContainerizedPlatformComponent is intended for DCAE platform services. Unlike the components,
286 # platform services have well-known names and well-known ports.
287 dcae.nodes.ContainerizedPlatformComponent:
288 derived_from: dcae.nodes.ContainerizedComponent
292 Container name used to register with Consul
296 Name to be registered in the DNS for the service provided by the container.
297 If not provided, the 'name' field is used.
298 This is a work-around for the Kubernetes restriction on having '_' in a DNS name.
299 Having this field allows a component to look up its configuration using a name that
300 includes a '_' while providing a legal Kubernetes DNS name.
305 Network port that the platform service is expecting to expose on the host
311 Network port that the platform service exposes in the container
315 type: dcae.types.MSBRegistration
317 Information for registering with MSB
321 cloudify.interfaces.lifecycle:
323 # Populate config into Consul
324 implementation: k8s.k8splugin.create_for_platforms
326 # Create Docker container and start
327 implementation: k8s.k8splugin.create_and_start_container_for_platforms
329 # Stop and remove Docker container
330 implementation: k8s.k8splugin.stop_and_remove_container
332 # Delete configuration from Consul
333 implementation: k8s.k8splugin.cleanup_discovery
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
354 dcae.interfaces.scale:
356 implementation: k8s.k8splugin.scale
357 dcae.interfaces.update:
359 implementation: k8s.k8splugin.update_image