|
| 1 | +# Deploying Add-ons |
| 2 | + |
| 3 | +The goal of `deis addons` is to give users the power to provision consumable services such as |
| 4 | +a postgres database, a minio bucket, or a logstash connection to their applications. `deis addons` |
| 5 | +can work with both common on-premise services such as a local mysql database or a Redis server |
| 6 | +for a "private" or on-premise [service broker][broker], or with public SaaS applications such as |
| 7 | +MongoLab or Papertrail for a public service offering. |
| 8 | + |
| 9 | +`deis addons` is backed by a project called [service-catalog][]. service-catalog brings integration |
| 10 | +with [service brokers][broker] to the Kubernetes ecosystem via the [Open Service Broker API][]. |
| 11 | + |
| 12 | +Users of Workflow use `deis addons` to provision an add-on offered by [service brokers][broker] for |
| 13 | +their applications. The end-goal is to provide a way for users to consume services from brokers and |
| 14 | +have their applications use those services without needing detailed knowledge about how those |
| 15 | +services are created or managed. |
| 16 | + |
| 17 | +As an example, most applications deployed by Workflow need a data store of some kind. `deis addons` |
| 18 | +allows applications to consume services like databases that exist somewhere via common environment |
| 19 | +variables like `DATABASE_URL`. |
| 20 | + |
| 21 | +## Listing Available Add-ons |
| 22 | + |
| 23 | +A user can use `deis addons:list` to see if they have a database provisioned and what plan it |
| 24 | +is using. |
| 25 | + |
| 26 | +``` |
| 27 | +$ deis addons:list | grep -i postgresql |
| 28 | +deis-postgresql:m4.large |
| 29 | +``` |
| 30 | + |
| 31 | +If a user wishes to see all available addons, they can use `deis addons:catalog`. |
| 32 | + |
| 33 | +``` |
| 34 | +$ deis addons:catalog |
| 35 | +name description |
| 36 | +--------------- ---------------------- |
| 37 | +bonsai Bonsai Elasticsearch |
| 38 | +deis-postgresql Deis Workflow Postgres |
| 39 | +librato Librato |
| 40 | +``` |
| 41 | + |
| 42 | +To view what plans are available for a given service, use `deis addons:plans <service>`. |
| 43 | + |
| 44 | +``` |
| 45 | +$ deis addons:plans deis-postgresql |
| 46 | +name free? description |
| 47 | +------ ----- ------------------------------------------------------------------------ |
| 48 | +t2.micro yes 1 vCPU, 1GB memory, poor network performance. |
| 49 | +t2.small no 1 vCPU, 2GB memory, poor network performance. |
| 50 | +m4.large no 2 vCPUs, 8GB memory, PIOPS-Optimized, moderate network performance. |
| 51 | +m4.xlarge no 4 vCPUs, 16GB memory, PIOPS-Optimized, high network performance. |
| 52 | +m4.10xlarge no 40 vCPUs, 160GB memory, PIOPS-Optimized, 10 Gigabit network performance. |
| 53 | +``` |
| 54 | + |
| 55 | +To see more information about the plans, use the `--raw` flag to dump the raw JSON to stdout for |
| 56 | +future parsing with tools like [`jq`](https://stedolan.github.io/jq/). |
| 57 | + |
| 58 | +## Provisioning the Add-on |
| 59 | + |
| 60 | +Most service brokers offers a variety of plans, usually spread across different tiers of service: |
| 61 | +hobby, standard, premium, and enterprise. For a detailed breakdown on the available plans, check |
| 62 | +the documentation for the applicable service broker to help choose the right service tier for the |
| 63 | +application. |
| 64 | + |
| 65 | +For example, to provision a `m4.large` plan database: |
| 66 | + |
| 67 | +``` |
| 68 | +$ deis addons:create deis-postgresql:m4.large --app wooden-rowboat |
| 69 | +Creating deis-postgresql:m4.large... done |
| 70 | +Binding deis-postgresql:m4.large to wooden-rowboat... done, v5 |
| 71 | +``` |
| 72 | + |
| 73 | +Once the instance has been attached to the application, a DATABASE_URL environment variable will be |
| 74 | +available in the application's environment and will contain the URL used to access the newly |
| 75 | +provisioned service. The environment variables exposed by the instance will be viewable through |
| 76 | +`deis config:list`. |
| 77 | + |
| 78 | +## Deprovisioning the Add-on |
| 79 | + |
| 80 | +To deprovision a `m4.large` plan database: |
| 81 | + |
| 82 | +``` |
| 83 | +$ deis addons:destroy deis-postgresql:m4.large |
| 84 | +Un-binding deis-postgresql:m4.large from wooden-rowboat... done, v6 |
| 85 | +Destroying deis-postgresql:m4.large... done |
| 86 | +``` |
| 87 | + |
| 88 | + |
| 89 | +[broker]: ../reference-guide/terms.md#service-broker |
| 90 | +[Open Service Broker API]: https://github.com/openservicebrokerapi/servicebroker |
| 91 | +[service-catalog]: https://github.com/kubernetes-incubator/service-catalog |
0 commit comments