Scale deployment
With BOSH it is easy to scale deployments. All you need to do is modify number of instances in manifest file.
Open manifest.yml and change number of instances under job from 1 to 2. Add another IP to list of job static IPs: 10.244.0.6.
jobs:
- name: app
templates:
- name: app
# Add another instance of the app
instances: 2
resource_pool: default
networks:
- name: default
static_ips:
- 10.244.0.2
# Add a static IP - 10.244.0.6
- 10.244.0.6
properties: {}
Deploy the updated manifest
$ bosh deploy
Acting as user 'admin' on deployment 'learn-bosh' on 'Bosh Lite Director'
Getting deployment properties from director...
Detecting deployment changes
----------------------------
jobs:
- name: app
instances: 1
instances: 2
networks:
- name: default
static_ips:
- 10.244.0.6
Please review all changes carefully
Deploying
---------
Are you sure you want to deploy? (type 'yes' to continue): yes
Director task 9
Started preparing deployment > Preparing deployment. Done (00:00:00)
Started preparing package compilation > Finding packages to compile. Done (00:00:00)
Started creating missing vms > app/1 (5f702b9b-0dde-4f25-acca-5b8c227449fb). Done (00:00:06)
Started updating job app > app/1 (5f702b9b-0dde-4f25-acca-5b8c227449fb) (canary). Done (00:01:12)
Task 9 done
Started 2017-03-13 01:33:23 UTC
Finished 2017-03-13 01:34:41 UTC
Duration 00:01:18
Deployed 'learn-bosh' to 'Bosh Lite Director'
Verify the new jobs appear in the deployment
$ bosh vms
Acting as user 'admin' on 'Bosh Lite Director'
Deployment 'learn-bosh'
Director task 10
Task 10 done
+----------------------------------------------+---------+-----+---------+------------+
| VM | State | AZ | VM Type | IPs |
+----------------------------------------------+---------+-----+---------+------------+
| app/0 (6eeb6429-e1a3-493e-b9e7-020398f49ab7) | running | n/a | default | 10.244.0.2 |
| app/1 (5f702b9b-0dde-4f25-acca-5b8c227449fb) | running | n/a | default | 10.244.0.6 |
+----------------------------------------------+---------+-----+---------+------------+
VMs total: 2
$ curl 10.244.0.6:8080
Hello, Maria from be21624a-26b7-4e35-9a09-c28d7df30204
111