Skip to content

HappyTobi/cf-puppeteer

Repository files navigation

CF-Puppeteer

Go Report Card APACHE-2 License Github All Releases Github All Releases Documentation Actions Status

cf plugin for hands-off, zero downtime application deploys

Documentation / Website

CF-Puppeteer Website.

Notice

This project was forked from contraband.

It was renamed to cf-puppeteer and is being further developed under the new name.

Changelog

To get an overview of the changes between versions, read the changelog.

Version

The latest version of CF-Puppeteer is 1.2.2. It works with and is based on Cloud Foundry CLI version 6.43.0.

For more details on the most recent release, check out the changelog.

Cf installation

Download the latest version from the releases page and make it executable.

$ cf install-plugin path/to/downloaded/binary

Usage

$ cf zero-downtime-push \
    -f path/to/new_manifest.yml \
    -p path/to/new/path
    -t 120

To get more information go to CF-Puppeteer homepage

Passing an application name

To override the application name from the manifest, specify it as command line argument. For example:

$ cf zero-downtime-push application-to-replace \
    -f path/to/new_manifest.yml \
    -p path/to/new/path
    -t 120

Changing the health check settings

To have more control over the health checks of your application, CF-Puppeteer supports additional parameters. For example:

$ cf zero-downtime-push application-to-replace \
    -f path/to/new_manifest.yml \
    -p path/to/new/path
    -t 120
    --health-check-type http
    --health-check-http-endpoint /health
    --invocation-timeout 10

While CF-Puppeteer gives precedence to command line parameters, you can also specify health-check-type and health-check-http-endpoint in the application manifest. However, Cloud Foundry currently does not support invocation-timeout in application manifests. Therefore, if you want to set it, always use the command line.

Specifying Routes

CF-Puppeteer will not create default routes for each application like cf push normally would. To ensure your applications have the proper routing, make sure you include at least one in your manifest.yml

applications:
  - ...
    routes:
      - route: my-app.example.com

Method

CF-Puppeteer takes a different approach compared to other zero-downtime plugins. It does not perform any complex route re-mappings. Instead it uses the manifest feature of the Cloud Foundry CLI. The method also has the advantage of treating a manifest as the source of truth and will converge the state of the system towards that. This makes the plugin ideal for continuous delivery environments.

  1. The old application is renamed to <APP-NAME>-venerable. It keeps its old route mappings. This change is invisible to users.

  2. The new application is pushed to <APP-NAME> (assuming that the name has not been changed in the manifest). It binds to the same routes as the old application (due to them being defined in the manifest) and traffic begins to be load-balanced between the two applications.

  3. The old application is deleted along with its route mappings. All traffic now goes to the new application.

Local development

for local development you need to install govendor

Known issues

You can't push an Application-Manifest with a wildcard in tha path deceleration. That only works with the option --legacy-push

To fix that issue, please remove the path from your manifest and pass the Artifact / Folder with the -p option.

If there is a problem while pushing you application you can see the complete trace by setting

Windows: CF_TRACE=true

Unix: CF_TRACE=/dev/stdout