Writing Plugins
Cloudify communicates with external services via plugins.
Examples of external services include:
- Cloud services, such as AWS, GCP, Azure, Openstack, and VSphere.
- Container-management systems, such as Kubernetes.
- Configuration management tools, such as Ansible, Chef, and Puppet.
- Other methods used for communicating with service endpoints, such as HTTP and SSH.
For example, if your blueprint defines an Azure VM, you need the Azure plugin. If your blueprint defines a Kubernetes Deployment, you need the Kubernetes plugin.
Many services can be supported with a generic existing plugin, such as Cloudify’s built-in script plugin, for more information, see:
- How to work with Configuration Management
- How to work with Containers
Distribution
Cloudify distributes plugins in Wagon format. Wagon packages sets of Python Wheels for dependency management. Cloudify publishes official wagons, which are found on plugins download page.
Note: The Script plugin is distributed with Cloudify.
Plugin Installation
The first step to using a plugin is to upload the plugin to your Cloudify Manager tenant.
To upload a plugin:
- For UI usage, see managing system resources.
- For CLI usage, see cfy plugins upload.
Local Python Path Installation
You can also install the wagon in your local Python path:
$ wagon install -s [path-to-wagon-file]
Note: This method is available when working in a Local CLI profile.
Usage
Plugin usage inside of blueprints varies. However, these two general rules apply:
- Your blueprint must add an import statement for the plugins that are in use. See importing plugins for more information
- We still support importing the
plugin.yaml
of the plugins you want to use. See spec-plugins. - If you don’t use the
plugin:
import statement, either theplugin.yaml
or your blueprint will map node lifecycle operations to appropriate plugin functions.
See specific plugin documentation for complete usage information.
Plugin Development
Cloudify plugins are Python projects with functions that that may be called by Cloudify.
For more information, see creating your own plugin.
For a plugin template, see plugin template.
For information on packaging a plugin in wagon format, see creating wagons.