director changes for manifests and releases


Dmitriy Kalinin
 

hey all,

i want to highlight two small but important changes we recently made in the
director that you could apply to your releases and deployment manifests:

(...we are backwards compatible of course...)


1) previously your deployment manifest described jobs and templates. that
naming is misleading since "job" already means something in a context of a
release. recent director versions correct this word reuse. here is an
example:

before:

```
jobs:
- name: cloud_controller
instances: 4
templates:
- {name: cloud_controller_ng, release: cf}
- {name: metron_agent, release: loggregator}
resource_pool: ...

- name: postgres
instances: 4
templates:
- {name: postgres, release: cf}
- {name: metron_agent, release: loggregator}
resource_pool: ...
```

after:

```
instance_groups: # <---
- name: cloud_controller
instances: 4
jobs: # <--- correctly named since metron_agent is
a job in loggregator release
- {name: cloud_controller_ng, release: cf}
- {name: metron_agent, release: loggregator}
resource_pool: ...

- name: postgres
instances: 4
jobs:
- {name: postgres, release: cf}
- {name: metron_agent, release: loggregator}
resource_pool: ...
```

tldr: deployment jobs renamed to instance groups, and templates are now
jobs (as they should be since they reference jobs from each release). more
info: https://bosh.io/docs/manifest-v2.html#instance-groups


2) most jobs namespace their properties under job and/or release name (e.g.
cloud_controll.max_connections). this is of course repetitive for the
release authors and does not make it very clear to the operators which
property belongs to which job. to solve this problem we now support job
level properties. job level properties are not merged with instance group
or top level properties. here is an example:

before:

```
# spec in the release
name: cloud_controller
templates:
ctl.erb: bin/ctl
conf.erb: config/conf
packages: [cloud_controller]
properties:
cloud_controller.max_connections:
description: "Maximum connections"
default: 10
```

and its use in the manifest:

```
instance_groups:
- name: cloud_controller
instances: 4
jobs:
- {name: cloud_controller_ng, release: cf}
- {name: metron_agent, release: loggregator}
resource_pool: ...
properties:
cloud_controller:
max_connections: 11
```

after:

```
# spec in the release
name: cloud_controller
templates:
ctl.erb: bin/ctl
conf.erb: config/conf
packages: [cloud_controller]
properties:
max_connections: # <--- drop the namespace
description: "Maximum connections"
default: 10
```

and its use in the manifest:

```
instance_groups:
- name: cloud_controller
instances: 4
jobs:
- name: cloud_controller_ng
release: cf
properties: # <--- job level properties, only visible to
cloud_controller_ng job
max_connections: 11
- name: metron_agent
release: loggregator
properties: {}
resource_pool: ...
```

by using job level properties unnecessary namespace is removed and it's
now clear which job read which property. more info:
https://bosh.io/docs/manifest-v2.html#instance-groups


I want to encourage everyone to use these new features (and others) in your
manifests and releases to make your manifests clearer.

dmitriy

Join {cf-bosh@lists.cloudfoundry.org to automatically receive all group messages.