1 # ================================================================================
2 # Copyright (c) 2017-2020 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=========================================================
19 tosca_definitions_version: cloudify_dsl_1_3
23 executor: 'central_deployment_agent'
24 package_name: k8splugin
25 package_version: 3.0.0
29 dcae.types.LoggingInfo:
31 Information for setting up centralized logging via ELK using a "sidecar" container.
32 If 'log_directory' is not provided, the plugin will not set up ELK logging.
33 (The properties all have to be declared as not required, otherwise the
34 'log_info' property on the node would also be required.)
38 The path in the container where the component writes its logs.
39 If the component is following the EELF requirements, this would be
40 the directory where the four EELF files are being written.
41 (Other logs can be placed in the directory--if their names in '.log',
42 they'll also be sent into ELK.)
47 Hope not to use this. By default, the plugin will mount the log volume
48 at /var/log/onap/<component_type> in the sidecar container's file system.
49 'alternate_fb_path' allows overriding the default. Will affect how the log
50 data can be found in the ELK system.
56 Information for using TLS (HTTPS). (The properties all have to be declared as not
57 required, otherwise the tls_info property on the node would also be required.)
61 The path in the container where the component expects to find TLS-related data.
66 Flag indicating whether TLS (HTTPS) is to be used
71 dcae.nodes.ContainerizedComponent:
72 # Base type for all containerized components
73 # Captures common properties and interfaces
74 derived_from: cloudify.nodes.Root
78 description: Full uri of the Docker image
83 Application configuration for this component. The data structure is
84 expected to be a complex map (native YAML) and to be constructed and filled
85 by the creator of the blueprint.
90 Copied from the auxiliary portion of the component spec that contains things
91 like healthcheck definitions for the component. Health checks are
97 This is used to specify the cpu and memory request and limit for container.
98 Please specify "requests" property and/or a "limits" property, with subproproperties
99 for cpu and memory. (https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/)
102 type: dcae.types.LoggingInfo
104 Information for setting up centralized logging via ELK.
108 type: dcae.types.TLSInfo
110 Information for setting up TLS (HTTPS).
116 The number of instances of the component that should be launched initially
122 Set to true if the orchestrator should always pull a new copy of the image
123 before deploying. By default the orchestrator pulls only if the image is
124 not already present on the host where the container is being launched.
130 The identifier for the location where the component is to be deployed.
131 If absent, the plugin uses its configured default location, typically the location
132 where the plugin is running (the central site). Also used to supply a location to
133 the DMaaP bus controller if the component is being provisioned as a publisher or
134 subscriber to a DMaaP feed or topic.
138 dcae.interfaces.update:
140 implementation: k8s.k8splugin.scale
142 implementation: k8s.k8splugin.update_image
144 # The ContainerizedServiceComponent node type is to be used for DCAE service components.
146 # The plugin deploys the component into a Kubernetes cluster with a very specific choice
147 # of Kubernetes elements that are deliberately not under the control of the blueprint author.
148 # The idea is to deploy all service components in a consistent way, with the details abstracted
149 # away from the blueprint author. The plugin is responsible for:
150 # * Generation of the service component name
151 # * Managing of service component configuration information
152 dcae.nodes.ContainerizedServiceComponent:
153 derived_from: dcae.nodes.ContainerizedComponent
155 service_component_type:
157 description: Service component type of the application being run in the container
162 Unique id for this DCAE service instance this component belongs to. This value
163 will be applied as a tag in the registration of this component with Consul.
169 Location id of where to run the container. Not used by the plugin. Here for backward compatibility.
173 service_component_name_override:
176 Manually override and set the name for this component. If this
177 is set, then the name will not be auto-generated. Using this feature provides
178 a service component with a fixed name that's known in advance, but care must be taken
179 to avoid attempting to deploy two components with the same name. If the component
180 exposes any ports, the k8s Service created by the plugin will use service_component_name_override
181 as the DNS host name.
185 cloudify.interfaces.lifecycle:
187 # Generate service component name and populate config into Consul
188 implementation: k8s.k8splugin.create_for_components
190 # Create k8s entities for the component and start
191 implementation: k8s.k8splugin.create_and_start_container_for_components
193 # Stop and remove k8s entities associated with the component
194 implementation: k8s.k8splugin.stop_and_remove_container
196 # Delete configuration from Consul
197 implementation: k8s.k8splugin.cleanup_discovery
198 dcae.interfaces.policy:
199 # This is to be invoked by the policy handler upon policy updates
201 implementation: k8s.k8splugin.policy_update
203 # This node type is intended for DCAE service components that use DMaaP and must use the
205 dcae.nodes.ContainerizedServiceComponentUsingDmaap:
206 derived_from: dcae.nodes.ContainerizedServiceComponent
210 List of DMaaP streams used for publishing.
212 Message router items look like:
219 Data router items look like:
225 This information is forwarded to the dmaap plugin to provision
229 List of DMaaP streams used for subscribing.
231 Message router items look like:
238 Data router items look like:
248 Note that username and password is optional. If not provided or null then the
249 plugin will generate them.
253 cloudify.interfaces.lifecycle:
255 # Generate service component name, populate config into Consul, set up runtime properties for DMaaP plugin
256 implementation: k8s.k8splugin.create_for_components_with_streams
258 # ContainerizedApplication is intended to be more of an all-purpose Docker container node
259 # for non-componentized applications.
260 dcae.nodes.ContainerizedApplication:
261 derived_from: cloudify.nodes.Root
265 description: Name of the Docker container to be given
268 description: Full uri of the Docker image
270 cloudify.interfaces.lifecycle:
272 # Create Docker container and start
273 implementation: k8s.k8splugin.create_and_start_container
275 # Stop and remove Docker container
276 implementation: k8s.k8splugin.stop_and_remove_container
277 dcae.interfaces.scale:
279 implementation: k8s.k8splugin.scale
280 dcae.interfaces.update:
282 implementation: k8s.k8splugin.update_image