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: 3.0.0
30 dcae.types.LoggingInfo:
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.)
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.)
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.
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.)
62 The path in the container where the component expects to find TLS-related data.
67 Flag indicating whether TLS (HTTPS) is to be used
72 dcae.nodes.ContainerizedComponent:
73 # Base type for all containerized components
74 # Captures common properties and interfaces
75 derived_from: cloudify.nodes.Root
79 description: Full uri of the Docker image
84 Application configuration for this component. The data structure is
85 expected to be a complex map (native YAML) and to be constructed and filled
86 by the creator of the blueprint.
91 Copied from the auxiliary portion of the component spec that contains things
92 like healthcheck definitions for the component. Health checks are
98 This is used to specify the cpu and memory request and limit for container.
99 Please specify "requests" property and/or a "limits" property, with subproproperties
100 for cpu and memory. (https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/)
103 type: dcae.types.LoggingInfo
105 Information for setting up centralized logging via ELK.
109 type: dcae.types.TLSInfo
111 Information for setting up TLS (HTTPS).
117 The number of instances of the component that should be launched initially
123 Set to true if the orchestrator should always pull a new copy of the image
124 before deploying. By default the orchestrator pulls only if the image is
125 not already present on the host where the container is being launched.
131 The identifier for the location where the component is to be deployed.
132 If absent, the plugin uses its configured default location, typically the location
133 where the plugin is running (the central site). Also used to supply a location to
134 the DMaaP bus controller if the component is being provisioned as a publisher or
135 subscriber to a DMaaP feed or topic.
139 dcae.interfaces.update:
141 implementation: k8s.k8splugin.scale
143 implementation: k8s.k8splugin.update_image
145 # The ContainerizedServiceComponent node type is to be used for DCAE service components.
147 # The plugin deploys the component into a Kubernetes cluster with a very specific choice
148 # of Kubernetes elements that are deliberately not under the control of the blueprint author.
149 # The idea is to deploy all service components in a consistent way, with the details abstracted
150 # away from the blueprint author. The plugin is responsible for:
151 # * Generation of the service component name
152 # * Managing of service component configuration information
153 dcae.nodes.ContainerizedServiceComponent:
154 derived_from: dcae.nodes.ContainerizedComponent
156 service_component_type:
158 description: Service component type of the application being run in the container
163 Unique id for this DCAE service instance this component belongs to. This value
164 will be applied as a tag in the registration of this component with Consul.
170 Location id of where to run the container. Not used by the plugin. Here for backward compatibility.
174 service_component_name_override:
177 Manually override and set the name for this component. If this
178 is set, then the name will not be auto-generated. Using this feature provides
179 a service component with a fixed name that's known in advance, but care must be taken
180 to avoid attempting to deploy two components with the same name. If the component
181 exposes any ports, the k8s Service created by the plugin will use service_component_name_override
182 as the DNS host name.
186 cloudify.interfaces.lifecycle:
188 # Generate service component name and populate config into Consul
189 implementation: k8s.k8splugin.create_for_components
191 # Create k8s entities for the component and start
192 implementation: k8s.k8splugin.create_and_start_container_for_components
194 # Stop and remove k8s entities associated with the component
195 implementation: k8s.k8splugin.stop_and_remove_container
197 # Delete configuration from Consul
198 implementation: k8s.k8splugin.cleanup_discovery
199 dcae.interfaces.policy:
200 # This is to be invoked by the policy handler upon policy updates
202 implementation: k8s.k8splugin.policy_update
204 # This node type is intended for DCAE service components that use DMaaP and must use the
206 dcae.nodes.ContainerizedServiceComponentUsingDmaap:
207 derived_from: dcae.nodes.ContainerizedServiceComponent
211 List of DMaaP streams used for publishing.
213 Message router items look like:
220 Data router items look like:
226 This information is forwarded to the dmaap plugin to provision
230 List of DMaaP streams used for subscribing.
232 Message router items look like:
239 Data router items look like:
249 Note that username and password is optional. If not provided or null then the
250 plugin will generate them.
254 cloudify.interfaces.lifecycle:
256 # Generate service component name, populate config into Consul, set up runtime properties for DMaaP plugin
257 implementation: k8s.k8splugin.create_for_components_with_streams
259 # ContainerizedApplication is intended to be more of an all-purpose Docker container node
260 # for non-componentized applications.
261 dcae.nodes.ContainerizedApplication:
262 derived_from: cloudify.nodes.Root
266 description: Name of the Docker container to be given
269 description: Full uri of the Docker image
271 cloudify.interfaces.lifecycle:
273 # Create Docker container and start
274 implementation: k8s.k8splugin.create_and_start_container
276 # Stop and remove Docker container
277 implementation: k8s.k8splugin.stop_and_remove_container
278 dcae.interfaces.scale:
280 implementation: k8s.k8splugin.scale
281 dcae.interfaces.update:
283 implementation: k8s.k8splugin.update_image