1 # ================================================================================
2 # Copyright (c) 2017-2020 AT&T Intellectual Property. All rights reserved.
3 # Copyright (c) 2020 Pantheon.tech. All rights reserved.
4 # Copyright (c) 2020 Nokia. All rights reserved.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 # ============LICENSE_END=========================================================
20 tosca_definitions_version: cloudify_dsl_1_3
24 executor: 'central_deployment_agent'
25 package_name: k8splugin
26 package_version: 3.4.1
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
71 dcae.types.ExternalCertParameters:
73 Certificate parameters for external TLS info
77 Common name which should be present in certificate
83 List of Subject Alternative Names (SANs) which should be present in certificate
88 dcae.types.ExternalTLSInfo:
90 Information for using external TLS.
92 external_cert_directory:
94 The path in the container where the component expects to find TLS-related data.
97 default: "/opt/app/dcae-certificate/external"
100 Flag indicating whether external TLS is to be used
106 Name of Certificate Authority configured on CertService side
112 Type of output certificates
116 external_certificate_parameters:
118 Certificate parameters for external TLS info
119 type: dcae.types.ExternalCertParameters
123 dcae.nodes.ContainerizedComponent:
124 # Base type for all containerized components
125 # Captures common properties and interfaces
126 derived_from: cloudify.nodes.Root
130 description: Full uri of the Docker image
135 Application configuration for this component. The data structure is
136 expected to be a complex map (native YAML) and to be constructed and filled
137 by the creator of the blueprint.
142 Copied from the auxiliary portion of the component spec that contains things
143 like healthcheck definitions for the component. Health checks are
149 This is used to specify the cpu and memory request and limit for container.
150 Please specify "requests" property and/or a "limits" property, with subproproperties
151 for cpu and memory. (https://kubernetes.io/docs/concepts/configuration/manage-compute-resources-container/)
154 type: dcae.types.LoggingInfo
156 Information for setting up centralized logging via ELK.
160 type: dcae.types.TLSInfo
162 Information for setting up TLS (HTTPS).
166 type: dcae.types.ExternalTLSInfo
168 Information for setting up external TLS
174 The number of instances of the component that should be launched initially
180 Set to true if the orchestrator should always pull a new copy of the image
181 before deploying. By default the orchestrator pulls only if the image is
182 not already present on the host where the container is being launched.
188 The identifier for the location where the component is to be deployed.
189 If absent, the plugin uses its configured default location, typically the location
190 where the plugin is running (the central site). Also used to supply a location to
191 the DMaaP bus controller if the component is being provisioned as a publisher or
192 subscriber to a DMaaP feed or topic.
196 dcae.interfaces.update:
198 implementation: k8s.k8splugin.scale
200 implementation: k8s.k8splugin.update_image
202 # The ContainerizedServiceComponent node type is to be used for DCAE service components.
204 # The plugin deploys the component into a Kubernetes cluster with a very specific choice
205 # of Kubernetes elements that are deliberately not under the control of the blueprint author.
206 # The idea is to deploy all service components in a consistent way, with the details abstracted
207 # away from the blueprint author. The plugin is responsible for:
208 # * Generation of the service component name
209 # * Managing of service component configuration information
210 dcae.nodes.ContainerizedServiceComponent:
211 derived_from: dcae.nodes.ContainerizedComponent
213 service_component_type:
215 description: Service component type of the application being run in the container
220 Unique id for this DCAE service instance this component belongs to. This value
221 will be applied as a tag in the registration of this component with Consul.
227 Location id of where to run the container. Not used by the plugin. Here for backward compatibility.
231 service_component_name_override:
234 Manually override and set the name for this component. If this
235 is set, then the name will not be auto-generated. Using this feature provides
236 a service component with a fixed name that's known in advance, but care must be taken
237 to avoid attempting to deploy two components with the same name. If the component
238 exposes any ports, the k8s Service created by the plugin will use service_component_name_override
239 as the DNS host name.
243 cloudify.interfaces.lifecycle:
245 # Generate service component name and populate config into Consul
246 implementation: k8s.k8splugin.create_for_components
248 # Create k8s entities for the component and start
249 implementation: k8s.k8splugin.create_and_start_container_for_components
251 # Stop and remove k8s entities associated with the component
252 implementation: k8s.k8splugin.stop_and_remove_container
254 # Delete configuration from Consul
255 implementation: k8s.k8splugin.cleanup_discovery
256 dcae.interfaces.policy:
257 # This is to be invoked by the policy handler upon policy updates
259 implementation: k8s.k8splugin.policy_update
261 # This node type is intended for DCAE service components that use DMaaP and must use the
263 dcae.nodes.ContainerizedServiceComponentUsingDmaap:
264 derived_from: dcae.nodes.ContainerizedServiceComponent
268 List of DMaaP streams used for publishing.
270 Message router items look like:
277 Data router items look like:
283 This information is forwarded to the dmaap plugin to provision
287 List of DMaaP streams used for subscribing.
289 Message router items look like:
296 Data router items look like:
306 Note that username and password is optional. If not provided or null then the
307 plugin will generate them.
311 cloudify.interfaces.lifecycle:
313 # Generate service component name, populate config into Consul, set up runtime properties for DMaaP plugin
314 implementation: k8s.k8splugin.create_for_components_with_streams
316 # ContainerizedApplication is intended to be more of an all-purpose Docker container node
317 # for non-componentized applications.
318 dcae.nodes.ContainerizedApplication:
319 derived_from: cloudify.nodes.Root
323 description: Name of the Docker container to be given
326 description: Full uri of the Docker image
328 cloudify.interfaces.lifecycle:
330 # Create Docker container and start
331 implementation: k8s.k8splugin.create_and_start_container
333 # Stop and remove Docker container
334 implementation: k8s.k8splugin.stop_and_remove_container
335 dcae.interfaces.scale:
337 implementation: k8s.k8splugin.scale
338 dcae.interfaces.update:
340 implementation: k8s.k8splugin.update_image