The term service has different meanings in various Helion Stackato contexts:
To display a list of all system services available on the current Helion Stackato system, as well as a list of provisioned services, run the stackato services command.
A Helion Stackato administrator can configure external data services to work in the same way as core Helion Stackato system services, exposing existing software and infrastructure to Helion Stackato.
Service brokers are RESTful web services that allow Helion Stackato (or any Cloud Foundry-based PaaS) to connect to services that hosted applications can consume.
Stackato's built-in system services have their own service brokers that handle the provisioning of service instances. You can add your own service brokers to provide custom services (databases, message queues, and so on) to users.
The Cloud Foundry v2 Service Broker API provides a simplified mechanism for connecting data services to the system. A service broker is responsible for:
You can use the Universal Service Broker to connect external services to a Helion Stackato cluster.
You can administer the Universal Broker using usbc, a CLI tool available
within Helion Stackato instances.
ssh into the core node.
Add the usb role:
$ kato role add usb
In the following examples, the MSSQL database is added. You can add any number of additional services using a similar process.
Create and configure your external database instance (for example, a standalone MSSQL server, or a SQL Server Express RDS instance on AWS EC2).
Create a driver instance, specifying the driver name and service name, for example:
$ usbc create-driver-instance mssql mssql-dev
Tip
Note the service name. Developers will need to add it to the services: block of their
applications' manifest.yml files and to specify your, for example:
services:
${name}-db: mssql-dev
When prompted, enter the database connection details, for example:
$ usbc create-driver-instance mssql mssql-dev
Insert string value for /server [required]> dev-db.abcdefghi1ab.us-west-2.rds.amazonaws.com
Insert integer value for /port [required]> 1433
Insert string value for /userid [required]> admin
Insert string value for /password [required]> myPassword123
Insert string value for /db_identifier_prefix> stackato-
Note
db_identifier_prefix is unique to the MSSQL database. It allows for the database to be
uniquely identified on the server.
To display a list of available external services, run the usbc services command:
$ usbc services
Service Name Service Id Driver Instance Driver Description Tags
mssql-dev 12abf3c4-5678-90de-1b23-fgh456789b01 mssql-dev mssql mssql-dev
To display a list of available service plans, run the stackato services command, for example:
$ stackato services
============== Service Plans ================
+-----------+---------+-----------------+--------------+------+--------+----------+---------+--------+------+
| Vendor | Plan | Description | Details | Free | Public | Provider | Version | Broker | Orgs |
+-----------+---------+-----------------+--------------+------+--------+----------+---------+--------+------+
| mssql-dev | default | Default service | default plan | yes | yes | | | usb | |
+-----------+---------+-----------------+--------------+------+--------+----------+---------+--------+------+
=========== Provisioned Services ============
Note
The Provisioned Services section remains empty until the service is provisioned by an application.
You can use the open-source service broker library cf-services-connector to create custom service brokers for Helion Stackato.
ssh into a DEA and install the library:
$ npm install cf-services-connector
Note
You can also include the library in the package.json file of your service broker
implementation. For more information, see the documentation of the cf-services-connector library.
Clone or download the echo-service sample application.
Navigate to the /cf-services-connector-nodejs/example/echo-service/config directory and
enter the values for authUser, authPassword, and database:encryptionKey into the
echo-service.json file,
Tip
For detailed description of the configuration of the services: block, see the Cloud Foundry
documentation:
Push the echo-service application to Helion Stackato (or any web server that supports Node.js).
Start the application using the node server.js command.
As an administrator, add the service broker to Helion Stackato using the the stackato add-service-broker command, for example:
$ stackato add-service-broker
Enter name: echo-broker
Enter url: http://echo-service-broker.example.com
Enter username: admin
Enter password: myPassword123
Creating new service broker [echo-broker] ... OK
The service broker is added to Helion Stackato.
To display a list of the available services, run the stackato services command:
============== Service Plans ================
+-----------------+-----------+-----------------------+----------------------------+------+--------+----------+---------+-------------+------+
| Vendor | Plan | Description | Details | Free | Public | Provider | Version | Broker | Orgs |
+-----------------+-----------+-----------------------+----------------------------+------+--------+----------+---------+-------------+------+
| Echo Service | default | Echo Service - echoes | This is the first plan | yes | yes | | | echo-broker | |
| Echo Service | secondary | Echo Service - echoes | This is the secondary plan | no | no | | | echo-broker | |
+-----------------+-----------+-----------------------+----------------------------+------+--------+----------+---------+-------------+------+
By default, service plans are created as private. To make the plan available to your organization, run the update-service-plan command, for example:
$ stackato update-service-plan --vendor "Echo Service" --public default