Cloud Foundry has released an experimental CF-BOSH release for Docker as an open source project, providing the same functionality as the original BOSH project, deployment and lifecycle management of large scale distributed services, but applied to Docker containers.
Cloud Foundry BOSH is a general tool chain that can orchestrate multi-node applications on top of IaaS and manage its lifecycle including stateful data, while providing monitoring, alerting and self-healing capabilities. It manages the VM templates, called stemcells in Cloud Foundry terminology, software releases and deployments. BOSH takes a YAML manifest and creates and manages a pool of VMs, picking a VM from the pool for each job of the release, and updating its configuration according to the deployment manifest.
Ferran Rodenas, platform engineer at the Cloud Foundry team, lists some of the benefits of the BOSH release for Docker:
-
Multiple Docker containers can be orchestrated into multiple virtual machines.
-
Containers can be deployed to a choice of IaaS (AWS, OpenStack, VSphere, VCHS, CloudStack or Google Compute Engine).
-
Containers are monitored automatically and restarted in case of failures.
-
If a container fails, when it is restarted then all of the dependent containers will be restarted too.
-
Virtual machines are automatically monitored and recreated in case of a failure.
-
Host volumes can be bound to Docker containers.
-
Data disks attached to a Docker container can be resized without losing data.
Cloud Foundry BOSH release for Docker uses a declarative approach when deploying, based on a YAML file that defines the jobs, or virtual machines, as well as the Docker containers to deploy. It monitors not only that the Docker daemon process is up and listening, but also that each of the deployed containers are also running. If for some reason the Docker daemon or one of the containers dies, BOSH will automatically detect the failure and restart again the processes without any human intervention until it succeeds.
BOSH includes a health monitor that periodically pings an agent running inside the virtual machine to check its state and will trigger an alert if it is unable to contact the agent or the state of the deployment is not what it was expected. The alert can be sent by different means, such as email or pager, and can also trigger a special "resurrector" responder that will automatically replace the VM, reattach the existing persistent disk, and deploy and start the processes again.
There are some other efforts trying to integrate Docker images or Dockerfiles with Cloud Foundry. The Diego project replaces Cloud Foundry execution agent (DEA) making it more extensible across multiple runtime environments, including Docker. CloudCredo has written Decker, a reimplementation of Cloud Foundry DEA using Docker as a backend.