This repository contains blueprints for installing Node Cellar on several cloud and other environments. It is a simple two-node deployment that is useful for learning how to use Cloudify and how to write blueprints, for testing Cloudify installations, and for testing cloud environments.
In addition to installing the application's resources and dependencies, the blueprints will also install a Cloudify agent that reports statistics and allows a Cloudify Manager to better control the hosts. (The exception is the local blueprint, which does not install the agent.)
First install the Cloudify CLI.
The local blueprint allows you to install Node Cellar on your local host. (Note that it does not require nor use a Cloudify Manager.)
First, let's initialize your working directory to work with the given blueprint.
cfy local init -p local-blueprint.yaml
Now, you can run any type of workflow using this blueprint.
Let's run the install workflow:
cfy local execute -w install
This command will install all the application components on you local machine. (Everything will be safely installed installed under the tmp directory.) Once it's done, you should be able to browse to http://localhost:8080 and see the application.
To uninstall the application we run the uninstall workflow:
cfy local execute -w uninstall
For pre-provisioned hosts:
- Simple - deploy on arbitrary hosts with known IP addresses
- Host pool - deploy on arbitrary hosts with IP addresses managed by a Host Pool Service; see also the the plugin documentation
With provisioning of hosts:
- OpenStack
- OpenStack HAProxy
- OpenStack Nova
- Apache CloudStack
- Amazon EC2
- VMWare vCloud
- VMWare vSphere
- IBM SoftLayer
The cloud blueprints require access to a Cloudify Manager instance. You can get one by deploying one of the ready-to-run images or bootstrapping your own, including on a local virtual machine.
These blueprints assume a topology of two hosts:
- A Node.js server, running the JavaScript application
- A MongoDB instance
(The exception is the OpenStack HAProxy blueprint, which adds a third host for HAProxy.)
Tell the CLI to use the Manager:
cfy use -t <Manager IP address>
cfy blueprints upload -b <choose a blueprint ID> -p <blueprint filename.yaml>
Every one of these blueprints has inputs, which can be populated for a deployment using input files. Templates for such input files are located inside the inputs directory. Note that these templates only contain the mandatory inputs, those for which the blueprint does not define a default value. Look inside the blueprints for documentation about additional inputs.
cp inputs/<inputs filename.yaml.template> <inputs filename.yaml>
After you filled the input file corresponding to your blueprint, create the deployment:
cfy deployments create -b <blueprint ID used above> -d <choose a deployment ID> -i <inputs filename.yaml>
Once the deployment is created, we can start running workflows:
cfy executions start -w install -d <deployment ID used above>
This install workflow will create all the resources and run all the lifecycles tasks needed for deployment in the environment, including:
- Virtual machines
- Floating IP addresses
- Security groups
Once the workflow execution is complete, we can view the application endpoint by running:
cfy deployments outputs -d <deployment ID>
One of the outputs should be the application's URL. Browse it to see Node Cellar in action!
Now lets run the uninstall workflow, which will uninstall the application as well as the resources:
cfy executions start -w uninstall -d <deployment ID>
It's best to delete deployments we are no longer using, since they take up space on the management machine:
cfy deployments delete -d <deployment_id>
If you have no further use for your Cloudify Manager, you can tear it down (together with the resources created by the bootstrap process) by running:
cfy teardown -f
Visit the Cloudify community website at getcloudify.org for more guides and tutorials.