-
Notifications
You must be signed in to change notification settings - Fork 23
/
runtime-config.html.md.erb
139 lines (102 loc) · 5.14 KB
/
runtime-config.html.md.erb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
---
title: Managing Runtime Configs
owner: Services
---
<strong><%= modified_date %></strong>
This topic explains how to define and manage named runtime configs with your service tile for Pivotal Cloud Foundry (PCF).
Tile authors can [create a new runtime config](#create) in an existing product tile, [delete a runtime config](#delete) from a tile, or add a tile that contains a [runtime config only](#config-only).
See the [BOSH documentation](https://bosh.io/docs/runtime-config.html) for more information about runtime configs.
## <a id="overview"></a>Overview
A runtime config is a section of the tile metadata that can define global deployment configurations. When a tile author includes a runtime config as a top-level key in the tile metadata, BOSH applies the runtime config to every VM in the deployment.
To the operator, a runtime config appears in Ops Manager as a tile with minimal configuration options. Runtime config tiles contain no stemcell, network, availability zone (AZ), or resource config information.
![Runtime Config Tile on the Ops Manager Installation Dashboard](img/runtime-config-dashboard.png)
When you click **Apply Changes**, Ops Manager combines the runtime config information from every tile in the deployment and assigns each named runtime config a unique identifier. Ops Manager creates the name using the tile name, a generated GUID, and the runtime config name defined in the metadata in the following format:
```
TILE_NAME-GUID-RUNTIME_CONFIG_NAME
```
## <a id="create"></a>Create a Runtime Config
Tile authors can add `runtime_configs` as a top-level key in tile metadata. In this key, the tile author defines configuration properties that Ops Manager applies to all deployments. A tile can support any number of runtime configs.
A named runtime config, such as `MY-RUNTIME-CONFIG` in the example below, can contain any number of addons. Each addon can contain any number of jobs.
To add a runtime config to a tile, add the following section to the tile metadata:
```
runtime_configs:
- name: MY-RUNTIME-CONFIG
runtime_config: |
releases:
- name: os-conf
version: 15
addons:
- name: MY-ADDON-NAME
jobs:
- name: MY-RUNTIME-CONFIG-JOB
release: os-conf
properties:
MY-ADDON-NAME:
...
```
Replace the text in the example above with the following:
* `MY-RUNTIME-CONFIG`: Choose a name for the runtime config.
* `MY-ADDON-NAME`: Choose a name for the addon that contains the runtime config job.
* `MY-RUNTIME-CONFIG-JOB`: Choose a name for the job the runtime config describes.
<p class="note important"><strong>Important</strong>: The names you choose must be unique across a deployment. Pivotal recommends appending your product name or another unique identifier to each of the named items in the <code>runtime_configs</code> section.</p>
Define the runtime config job properties in the `properties` section.
## <a id="delete"></a>Delete a Runtime Config
Tile authors can remove an existing runtime config from a tile by removing the reference from the metadata.
When the operator upgrades the tile, Ops Manager detects the missing reference and deletes the runtime config.
## <a id="config-only"></a>Create a Runtime Config-Only Tile
Tile authors can create a tile that only contains a runtime config. The only release that a tile author must include in a runtime config tile is `os-conf`. When creating a runtime config-only tile, a tile author is not required to define the following top-level keys:
* `post_deploy_errands`
* `pre_delete_errands`
* `job_types`
### <a id="example"></a>Example Runtime Config-Only Tile
The following example shows a runtime config-only tile with minimal configuration:
```
---
name: runtime-config-only-example-product
product_version: "3.4"
minimum_version_for_upgrade: "2.0"
metadata_version: "2.0"
label: 'Runtime Config Only Example Product'
description: An example product to demonstrate runtime config features
rank: 1
service_broker: false # Default value
stemcell_criteria:
os: ubuntu-trusty
version: STEMCELL-VERSION
releases:
- name: os-conf
file: os-conf
version: '15'
post_deploy_errands: []
pre_delete_errands: []
form_types:
- name: example_form
label: 'Example form'
description: 'An example form'
property_inputs:
- reference: .properties.example_string
label: 'Example string'
property_blueprints:
- name: example_string
type: string
configurable: true
default: Pizza
job_types: []
runtime_configs:
- name: example-runtime-config
runtime_config: |
releases:
- name: os-conf
version: 15
addons:
- name: login
jobs:
- name: login-banner
release: os-conf
properties:
login_banner:
text: |
(( .properties.example_string.value )).
```
In the example runtime config above, the `login-banner` job prints a banner when a user logs into any VM in the deployment. The operator can use the default value defined in the `form_types` section of the metadata or configure the banner by editing the **Example string** value in Ops Manager.
![Runtime Config Tile Information](img/runtime-config-tile.png)