Broker Configuration
February 27, 2023 ยท View on GitHub
The broker can be configured though environment variables or configuration files or a combo of both.
Configuration File
A configuration file can be provided at run time to the broker.
cloud-service-broker serve --config <config file name>
A configuration file can be YAML or JSON. Config file values that are . delimited represent hierarchy in the config file.
Example:
db:
host: hostname
represents a config file value of db.host
Database Configuration Properties
Connection details for the backing database for the service broker.
You can configure the following values:
| Environment Variable | Config File Value | Type | Description |
|---|---|---|---|
| DB_HOST * | db.host | string | Database host |
| DB_USERNAME | db.user | string | Database username |
| DB_PASSWORD | db.password | secret | Database password |
| DB_PORT * | db.port | string | Database port (defaults to 3306) Default: |
| DB_NAME * | db.name | string | Database name Default: |
| CA_CERT | db.ca.cert | text | Server CA cert |
| CLIENT_CERT | db.client.cert | text | Client cert |
| CLIENT_KEY | db.client.key | text | Client key |
Broker Service Configuration
Broker service configuration values:
| Environment Variable | Config File Value | Type | Description |
|---|---|---|---|
| SECURITY_USER_NAME * | api.user | string | Broker authentication username |
| SECURITY_USER_PASSWORD * | api.password | string | Broker authentication password |
| PORT | api.port | string | Port to bind broker to |
Credhub Configuration
The broker supports passing credentials to apps via credhub references, thus keeping them private to the application (they won't show up in cf env app_name output.)
| Environment Variable | Config File Value | Type | Description |
|---|---|---|---|
| CH_CRED_HUB_URL | credhub.url | URL | credhub service URL - usually https://credhub.service.cf.internal:8844 |
| CH_UAA_URL | credhub.uaa_url | URL | uaa service URL - usually https://uaa.service.cf.internal:8443 |
| CH_UAA_CLIENT_NAME | credhub.uaa_client_name | string | uaa username - usually credhub_admin_client |
| CH_UAA_CLIENT_SECRET | credhub.uaa_client_secret | string | uaa client secret - "Credhub Admin Client Credentials" from Operations Manager > PAS > Credentials tab. |
| CH_SKIP_SSL_VALIDATION | credhub.skip_ssl_validation | boolean | skip SSL validation if true |
| CH_CA_CERT_FILE | credhub.ca_cert_file | path | path to cert file |
Brokerpak Configuration
Brokerpak configuration values:
| Environment Variable | Config File Value | Type | Description |
|---|---|---|---|
| GSB_BROKERPAK_BUILTIN_PATH | brokerpak.builtin.path | string | Path to search for .brokerpak files, default: |
| GSB_BROKERPAK_CONFIG | brokerpak.config | string | JSON global config for broker pak services |
| GSB_PROVISION_DEFAULTS | provision.defaults | string | JSON global provision defaults |
| GSB_SERVICE_SERVICE_NAME_PROVISION_DEFAULTS | service.service-name.provision.defaults | string | JSON provision defaults override for service-name |
| GSB_SERVICE_SERVICE_NAME_PLANS | service.service-name.plans | string | JSON plan collection to augment plans for service-name |
| GSB_COMPATIBILITY_ENABLE_BETA_SERVICES | compatibility.enable-beta-services | bool | Enable services tagged with beta. Default: false |
Google Configuration
The GCP brokerpak supports default values for tenant, subscription and service principal credentials.
| Environment Variable | Config File Value | Type | Description |
|---|---|---|---|
| GOOGLE_CREDENTIALS | gcp.credentials | string | the string version of the credentials file created for the Owner level Service Account |
| GOOGLE_PROJECT | gcp.project | string | gcp project id |
config file example
gcp:
credentials: |
<credentials json as string>
project: your-project-id
db:
host: your mysql host
password: your mysql password
user: your mysql username
api:
user: someusername
password: somepassword
credhub:
url: ...
uaa_url: ...
uaa_client_name: ...
uaa_client_secret: ...
Global Config Example
Services for a given IaaS should have common parameter names for service wide platform resources (like location)
GCP services support global region and authorized_network_id parameters:
provision:
defaults: '{
"region": "europe-west1",
"authorized_network_id": https://www.googleapis.com/compute/v1/projects/<GCP_PROJECT>/global/networks/<GCP_PAS_NETWORK>"
}'
Plans Example
Plans should be added to the brokerpak configuration:
service:
csb-csb-google-postgres:
plans: '[
{
"name":"small",
"id":"5b45de36-cb90-11ec-a755-77f8be95a49d",
"description":"PostgreSQL with default version, shared CPU, minimum 0.6GB ram, 10GB storage",
"display_name":"small",
"tier":"db-f1-micro",
"storage_gb":10
}
]'