Using Pools

Overview

Pool is used by provisioners to group nodes and know if an application can bedeployed in these nodes. Users can choose which pool to deploy in tsuruapp-create.

Tsuru has three types of pool: team, public and default.

Team’s pool are segregated by teams, and cloud administrator should setteams in this pool manually. This pool are just accessible by team’smembers.

Public pools are accessible by any user.

Default pool is where apps are deployed when app’s team owner don’t have a poolassociated with it or when app’s creator don’t choose any public pool. Ideallythis pool is for experimentation and low profile apps, like service dashboardand “in development” apps. You can just have one default pool. This is the oldfallback pool, but with a explicit flag.

Adding a pool

In order to create a pool, you should invoke tsuru pool-add:

  1. $ tsuru pool-add pool1

If you want to create a public pool you can do:

  1. $ tsuru pool-add pool1 -p

If you want a default pool, you can create it with:

  1. $ tsuru pool-add pool1 -d

You can overwrite default pool by setting the flag -f:

  1. $ tsuru pool-add new-default-pool -d -f

Adding teams to a pool

Then you can use tsuru pool-constraint-set to add teams to the pool thatyou’ve just created:

  1. $ tsuru pool-constraint-set pool1 team team1 team2 --append
  2.  
  3. $ tsuru pool-constraint-set pool2 team team3 --append

Listing pools

To list pools you do:

  1. $ tsuru pool-list
  2. +-------+-------------+
  3. | Pools | Teams |
  4. +-------+-------------+
  5. | pool1 | team1 team2 |
  6. | pool2 | team3 |
  7. +-------+-------------+

Removing a pool

If you want to remove a pool, use tsuru pool-remove:

  1. $ tsuru pool-remove pool1

Removing teams from a pool

You can remove one or more teams from a pool using the command tsuru pool-constraint-set:

  1. $ tsuru pool-constraint-set pool1 team team1 --blacklist
  2.  
  3. $ tsuru pool-constraint-set pool1 team team1 team2 team3 --blacklist

Removing services from a pool

You can remove one or more services from a pool using the command tsuru pool-constraint-set:

  1. $ tsuru pool-constraint-set <pool> service <service1> <service2> <serviceN> --blacklist
  2.  
  3. $ tsuru pool-constraint-set dev_pool service mongo_prod mysql_prod --blacklist

Moving apps between pools and teams

You can move apps from poolA to poolB and from teamA to teamB even when they dont have permission to see each other’s pools, this is made by using tsuru app-update:

  1. $ tsuru app-update -a <app> -t <teamB> -o <poolB>

By default the app will be set to both teams, so teamA can still see the app just in case that the user may have made some mistake. If you wish to remove the old teamA from the app, It’s possible using tsuru app-revoke:

  1. $ tsuru app-revoke teamA -a <app>

原文: https://docs.tsuru.io/1.6/managing/using-pools.html