Skip to content

Setting up capacity configs

sbaogang edited this page Feb 14, 2016 · 3 revisions

Where should we deploy to, or what is the deploy targets? The 'Capacity' section in Teletraan configuration page is for specifying individual host names and/or group names to where we will deploy.

  • Teletraan does not define group or maintain the group membership. We rely the host_info file on host to feed in group membership. The host_info file could be provided by the host provisioning process. For example, if you use puppet to provision hosts, you could use puppet role as the group.

  • Notice a host could belong to multiple groups. These groups could form a hierarchy. Teletraan supports deploying multiple services onto the same host. So if you have a service which is common to all your hosts in PROD group, you can actually create a deploy environment and specify PROD as the capacity group. This makes Teletraan deploy especially powerful and flexible.

  • Prefer group names to individual host names. Host can crash or be terminated; new hosts will be added etc. It is hard to maintain capacity with specific host names.

  • Host capacity settings overrides Group. Imagine the following scenario:

    • host-1 belongs to group-1
    • host-1 is defined in myenv/canary capacity section
    • group-1 is defined in myenv/prod capacity section

If we deploy build-1 to myenv/canary and then deploy build-2 to myenv/prod, myenv/canary will still run on build-1. In this case, host-1 will NOT install build-2 even though it belongs to group-1. This is exactly how we set up canary stage at Pinterest - we simply borrow one of two hosts from production group, and set these hosts specifically in canary stage capacity section.

  • It is very important that the host names and/or group names used in Capacity Config must match what is defined in the host-info file on your hosts.
>cat /mnt/deployd/host_info 
groups=prod,servicex
id=i-dcbcee23
host=service-x-001

Using this example, here are some instructions on how to set up this host in your Capacity config.

  1. Navigate to your environment landing page and click 'Configure'. Then click 'Capacity'.

  2. There are two fields on this page, hosts and groups. You could specify the host above in multiple ways:

  • You could simply specify the host individually with its host-info defined name: service-x-001
  • You can also specify the host based on the defined group in host-info. For instance if this environment deploys for hosts in group 'servicex' we can put 'servicex' in the group field.
  1. Click 'Save' to save your changes.