Building a manifest file

Overview

A manifest file allows you to be more explicit about your application composition and control settings that are not usually available through the user interface or Cloud 66 toolbelt.

The file describes the setup of the components that run your application. See Getting started with manifest files for an introduction.

In Maestro there are two opportunities to edit your manifest file:

Important

It is vital that you understand the limits and caveats of manifest settings. Please read our reference guide before you start creating your own manifest files.

Once you’re ready, start by going through each section below to build your manifest file.

Problems upgrading?

If you explicitly set the version of any component in your manifest file, we will respect that setting even if it conflicts with other system changes or upgrades (for example upgrading Ubuntu). If you are having trouble upgrading any component of your application, remember to check your manifest file to ensure you have not previously locked the version of that component or one of its dependents.

Which environment?

The first level of your manifest file is the environment - this allows you to use the same manifest.yml for multiple applications with different environments. Some examples are:

You can also use your own custom environment names in your manifest file.

Which component?

Next, select which component you would like to specify settings for. You can choose from the following:

Docker

Examples

production:
  docker:
    configuration:
      version: 1.7.0
      weave_version: 1.0.3
      vpc_id: vpc-64872001
      root_disk_size: 100
      root_disk_type: ssd
      image_keep_count: 5
      nameservers: ['8.8.8.8', '8.8.4.4']
production:
  docker:
    configuration:
      version: 1.12.0
      weave_version: 1.0.3
      vn_name: your_vn_name
      root_disk_size: 100
      root_disk_type: ssd
      image_keep_count: 15

ElasticSearch

production:
  elasticsearch:
    configuration:
      version: 0.90.7
      root_disk_size: 100
      root_disk_type: ssd

Gateway

Note

The gateway should be defined and open before you can use it in manifest.

production:
  gateway:
    name: aws_bastion
	username: ec2-user

GlusterFS

The version of GlusterFS currently offered via the Cloud 66 Add-in is not supported by Ubuntu 18.04. To use this add-in please ensure that all of your application components are installed on servers running Ubuntu 16.04.

Available settings for a volume are:

After you change the volume list, you need to redeploy your application for new configuration be applied to your application.

Notes

- You can not change replica_count after GlusterFS added to your application.
- You can not use glusterfs group or any of its servers in mount_targets.

Warning

Renaming a volume will actually delete that volume and create a new one.

production:
  glusterfs:
    configuration:
      version: 3.7
      replica_count: 2
      mount_targets: ['app','redis']
      volumes:
      - volume:
        name: images-data
        mount: "/mnt/images"
        access_control:
          read: ['web', 'api']
          write: ['web']
      - volume:
        name: videos
        mount: /mnt-data/videos
        access_control:
          read: ['web']
          write: ['web']

Memcached

production:
  memcached:
    configuration:
      memory: 1024
      port: 11211
      listen_ip: 127.0.0.1

MongoDB

production:
  mongodb:
    configuration:
      version: 2.4.8
      root_disk_size: 100
      root_disk_type: ssd

MySQL

production:
  mysql:
    configuration:
      version: 5.7
      root_disk_size: 100
      root_disk_type: ssd
      engine: percona

Nginx

production:
  rails:
    configuration:
      nginx:
        cors: true
        extra-build-arguments: "--add-module=/path/to/module"
        perfect_forward_secrecy: true # deprecated

CORS configuration

If required, you can also specify the allowed origin (as ‘*’ or a single origin) and methods. For applications created since 21st September 2016, you can also specify a comma-seperated list of origins, headers, and whether to allow credentials for CORS.

production:
  rails:
    configuration:
      nginx:
        cors:
          origin: '*'
          methods: 'GET, OPTIONS'
          headers: 'Custom-Header, Another-Header'
          credentials: true

PostgreSQL

production:
  postgresql:
    configuration:
      version: 9.3.4
      postgis: true
      root_disk_size: 100
      root_disk_type: ssd

PostGIS


Redis

production:
  redis:
    configuration:
      version: 5.0.5
      root_disk_size: 100
      root_disk_type: ssd

Load balancers

AWS load balancer

Use a manifest file to customize the AWS load balancer deployed by Cloud 66. These changes will only apply when you create a new load balancer.

Available settings:

production:
  load_balancer:
    configuration:
      httpchk: /

GCE load balancer

Use a manifest file to customize the GCE load balancer deployed by Cloud 66. These changes will only apply when you create a new load balancer.

Available settings (refer to the GCE documentation for more information):

production:
  load_balancer:
    configuration:
      httpchk: /
      balance: CLIENT_IP_PROTO

HAProxy

Use a manifest file to configure and define your HAProxy load balancer deployed by Cloud 66. These changes will be either be applied when you redeploy an application with more than one server, rebuild HAProxy or edit HAProxy CustomConfig.

Available settings (refer to the HAProxy documentation for more information):

Server definitions

Configuration

production:
  load_balancer:
    servers:
    - server:
        unique_name: bananana
        size: 1gb
        region: ams2
        vendor: digitalocean
        key_name: Default
    configuration:
      httpchk: HEAD / HTTP/1.1\r\nHost:haproxy  #default value
      balance: roundrobin #default value
      errorfile_400: /etc/haproxy/errors/400.http
      errorfile_403: /etc/haproxy/errors/403.http
      errorfile_408: /etc/haproxy/errors/408.http
      errorfile_500: /etc/haproxy/errors/500.http
      errorfile_502: /etc/haproxy/errors/502.http
      errorfile_503: /etc/haproxy/errors/503.http
      errorfile_504: /etc/haproxy/errors/504.https

Linode Nodebalancer

Use a manifest file to the Linode Nodebalancer deployed by Cloud 66. These changes will only apply when you create a new load balancer.

Available settings (refer to the Linode documentation for more information):

production:
  load_balancer:
    configuration:
      httpchk: /
      balance: leastconn

Rackspace load balancer

Use a manifest file to customize the Rackspace load balancer deployed by Cloud 66. These changes will only apply when you create a new load balancer.

Available settings (refer to the Rackspace documentation for more information):

production:
  load_balancer:
    configuration:
      balance: LEAST_CONNECTIONS

Which server?

Every component defined in the manifest file must be bound to a server. However, if you’d like configurations to apply to all your servers, you don’t need to specify a server type.

Servers can be deployed specifically to host a single component, be shared between multiple components (e.g. Rails and MySQL on the same server) or be an external server (e.g. using an external database).

Here is an example of a server definition:

production:
  rails:
    servers:
    - server:
      unique_name: app

These are the parameters that the server section can take:

Important

Only a single cloud vendor and region is supported for servers used by an application.

production:
  rails:
    servers:
      server:
        unique_name: app
        vendor: aws
        key_name: Default
        region: us-east-1
        size: m3.medium
        root_disk_size: 100
        root_disk_type: ssd
        subnet_id: subnet-40000000
        availability_zone: us-east-1c

Deploy to your own server

production:
  rails:
    server:
      unique_name: frontend
      address: 123.123.123.123

Shared Servers

You can share a server between two components. This could be in cases like using the same server for both your Rails app and the MySQL server behind it.

Each shared server definition specifies the name of another server definition in the manifest file for which the components will then share the physical server:

production:
  rails:
    server:
      same_as: *another_existing_servers_unique_name*

External Servers

If you would like to use an external server for a component (like using your own MySQL or AWS RDS instance, for example), you can define that server as external.

External server definitions specify that the component is hosted on a server external to Cloud 66. This is not a valid target for your main application (e.g. rails) but may be appropriate for another component (e.g. MongoDB):

production:
  mysql:
    server: external

Important

You are required to specify a server for components, whereas configurations are optional.

Specify environment variables

You can add your environment variables to your manifest files.

Here is an example:

production:
  environment_variables:
    SOME_VARIABLE: value
    ANOTHER_ONE: another_value
    THIRD_ONE: AUTO_GENERATE
    LONG_ONE: AUTO_GENERATE_15

If you need to auto generate a value, you can use the AUTO_GENERATE keyword. It generates a 10 character long random string unless you specify the length after it: AUTO_GENERATE_15 which generates a 15 character random string.

Environment variables set in your manifest file will only apply during the initial build of your application. Please refer to our documentation on environment variables if you’d like to set them beyond this point.

Any environment variable that is generated by the result of the code analysis (like database addresses) will override any value specified in the manifest file. In other words, you cannot specify a value like MYSQL_ADDRESS in your manifest file as it will be ignored.

Processes

Background processes can be deployed and managed by Cloud 66. Any process in a Procfile will be picked up, deployed and monitored by the system.

If you would like more flexibility over the signals used to control the processes, you can use the procfile_metadata section. Here is an example:

production:
  procfile_metadata:
    worker:
      stop_sequence: ttin, 120, term, 5, kill
    web:
      restart_signal: usr1
      stop_sequence: usr1, 30, kill
    nsq:
      restart_on_deploy: false

In this example, a process called worker is stopped using a TTIN signal first. After waiting for 120 seconds, if the process is still running, a TERM signal will be sent. If it is still running after 5 seconds, it will be killed.

As for web or custom_web processes, you can specify a restart_signal which will be sent to the process serving web. This is useful for web servers that can do “phased” or zero-downtime restarts.

All processes restart during each redeployment of the application. If you want to avoid this, you can set restart_on_deploy to false.

Default values for each process type are:

Specify additional LiveLog files

Each component supports the additional partial configuration to add custom live log files for that component. For example:

production:
  rails:
    configuration:
      custom_log_files: ["/tmp/mylog/*/*.log"]

…or

production:
  docker:
    configuration:
      custom_log_files: ["/tmp/mylog/*/*.log"]

For more information about LiveLogs and additional examples, please see the LiveLogs help page.