8. BOSH Deployment General Workflow
4
Infrastructure
Director
LoaderBalancer
Cloud ConfigBOSH CLI
9. BOSH Deployment General Workflow
4
Infrastructure
Director
LoaderBalancer
Stemcell
Cloud ConfigBOSH CLI
10. BOSH Deployment General Workflow
4
Infrastructure
Director
LoaderBalancer
Stemcell
BOSH Release
Cloud ConfigBOSH CLI
11. BOSH Deployment General Workflow
4
Infrastructure
Director
LoaderBalancer
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
12. BOSH Deployment General Workflow
4
Infrastructure
Director
BOSH VMs
LoaderBalancer
BOSH VMs
BOSH VMs
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
13. BOSH Deployment General Workflow
4
Infrastructure
Director
BOSH VMs
LoaderBalancer
BOSH VMs
BOSH VMs
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
14. BOSH Deployment General Workflow
4
Infrastructure
Director
BOSH VMs
LoaderBalancer
BOSH VMs
BOSH VMs
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
15. BOSH Deployment General Workflow
4
Infrastructure
Director
BOSH VMs
LoaderBalancer
BOSH VMs
BOSH VMs
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
16. BOSH Deployment General Workflow
4
Infrastructure
Director
BOSH VMs
LoaderBalancer
BOSH VMs
BOSH VMs
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
17. BOSH CLI v2
5
• Executable binary 🙌 by Golang (Ruby for v1 ...😒)
• bosh create-env to initialize an environment
• operation-files
https://bosh.io/docs/cli-v2.html
$ brew install cloudfoundry/tap/bosh-cli
18. Differences v1 and v2
6
$ bosh target <Director IP>
$ bosh login <client> <secret>
$ bosh status
https://bosh.io/docs/cli-v2-diff.html
Before
$ export BOSH_CLIENT=<client>
$ export BOSH_CLIENT_SECRET=<secret>
$ export BOSH_CA_CERT=...
$ export BOSH_ENVIRONMENT=<Director IP>
$ bosh env
After
19. Differences v1 and v2
7
$ bosh update cloud-config cloud.yml
$ bosh upload stemcell stemcell.tgz
$ bosh upload release foo.tgz
$ bosh deployment foo.yml
$ bosh deploy
https://bosh.io/docs/cli-v2-diff.html
$ bosh update-cloud-config cloud.yml
$ bosh upload-stemcell stemcell.tgz
$ bosh upload-release foo.tgz
$ bosh deploy -d foo foo.yml
Before
After
20. Differences v1 and v2
8
$ bosh vms
$ bosh instances --ps
https://bosh.io/docs/cli-v2-diff.html
$ bosh vms
$ bosh instances --ps
Before
After
21. Differences v1 and v2
9
$ bosh deployment foo.yml
$ bosh logs job
https://bosh.io/docs/cli-v2-diff.html
$ bosh logs -d foo job
$ bosh logs -d foo job -f # tailing 🙌
Before
After
22. Maintaining YAML file (Before)
10
$ bosh deployment foo.yml
instance_groups:
- name: worker
instances: 1
vm_type: default
azs: [z1]
networks: [{name:default}]
Official YAML (from Github)
instance_groups:
- name: worker
instances: 1
vm_type: default
azs: [z1]
networks: [{name:private}]
instance_groups:
- name: worker
instances: 3
vm_type: m4.xlarge
azs: [z1, z2]
networks: [{name:default}]
Copy for my env1
Copy for my env2
25. Operation files (YAML Composition)
12
$ bosh deploy -d foo foo.yml
-o high-availalitiy.yml
-o multi-az.yml
-o enable-feature-X.yml
-o change-vm-type-for-me.yml
-o change-properties-for-me.yml
BOSH release maintainer can provide some
types of configuration without copy-and-paste.
26. Operation files (YAML Composition)
12
$ bosh deploy -d foo foo.yml
-o high-availalitiy.yml
-o multi-az.yml
-o enable-feature-X.yml
-o change-vm-type-for-me.yml
-o change-properties-for-me.yml
You can maintain and compose
only your customizations ☺
BOSH release maintainer can provide some
types of configuration without copy-and-paste.
27. Download BOSH releases (Before)
13
releases:
- name: concourse
version: 3.4.1
- name: garden-runc
version: 1.6.0
bosh upload-release
https://bosh.io/d/github.com/concourse/concourse?v=3.4.1
bosh upload-release
https://bosh.io/d/github.com/cloudfoundry/garden-runc-release?v=1.6.0
bosh deploy -d concourse concourse.yml
33. Variables Interpolation + CredHub
19
bosh deploy -d concourse concourse.yml
https://github.com/cloudfoundry-incubator/credhub
Director CredHub
Director VM
/my-director/concourse/ui_password u98vzinh4y8gfcr1h6g0
34. How to provision Director?
20
Infrastructure
Director
BOSH VMs
LoaderBalancer
BOSH VMs
BOSH VMs
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
37. 22
$ git clone https://github.com/cloudfoundry/bosh-deployment.git
$ bosh create-env bosh-deployment/bosh.yml
--state=state.json
--vars-store=creds.yml
-o bosh-deployment/aws/cpi.yml
-v director_name=bosh-1
-v internal_cidr=10.0.0.0/24
-v internal_gw=10.0.0.1
-v internal_ip=10.0.0.6
-v subnet_id=subnet-ait8g34t
-v access_key_id=AKI...
-v ...
Bootstrapping BOSH Director (After)
Base template
Environment
configuration
38. 23
$ bosh create-env bosh-deployment/bosh.yml
-o bosh-deployment/aws/cpi.yml
-v director_name=bosh-1
-v internal_cidr=10.0.0.0/24
-v internal_gw=10.0.0.1
-v internal_ip=10.0.0.6
-v subnet_id=subnet-ait8g34t
-v access_key_id=AKI...
-v ...
BOSH Director for AWS
39. 24
$ bosh create-env bosh-deployment/bosh.yml
-o bosh-deployment/gcp/cpi.yml
-v director_name=bosh-1
-v internal_cidr=10.0.0.0/24
-v internal_gw=10.0.0.1
-v internal_ip=10.0.0.6
-v project_id=moonlight-2389ry3
--var-file gcp_credentials_json=~/Downloads/gcp.json
-v ...
BOSH Director for GCP
40. 25
$ bosh create-env bosh-deployment/bosh.yml
-o bosh-deployment/gcp/cpi.yml
-o bosh-deployment/uaa.yml
-v director_name=bosh-1
-v ...
BOSH Director with UAA
41. 26
$ bosh create-env bosh-deployment/bosh.yml
-o bosh-deployment/gcp/cpi.yml
-o bosh-deployment/uaa.yml
-o bosh-deployment/credhub.yml
-v director_name=bosh-1
-v ...
BOSH Director with UAA + CredHub
42. 27
$ bosh create-env bosh-deployment/bosh.yml
-o bosh-deployment/virtualbox/cpi.yml
-o bosh-deployment/virtualbox/outbound-network.yml
-o bosh-deployment/bosh-lite.yml
-o bosh-deployment/bosh-lite-runc.yml
-v ...
BOSH Director for VirtualBox (a.k.a BOSH Lite)
43. 28
$ bosh create-env bosh-deployment/bosh.yml
-o bosh-deployment/virtualbox/cpi.yml
-o bosh-deployment/virtualbox/outbound-network.yml
-o bosh-deployment/bosh-lite.yml
-o bosh-deployment/bosh-lite-runc.yml
-o bosh-deployment/uaa.yml
-v ...
BOSH Lite with UAA
44. 29
$ bosh create-env bosh-deployment/bosh.yml
-o bosh-deployment/virtualbox/cpi.yml
-o bosh-deployment/virtualbox/outbound-network.yml
-o bosh-deployment/bosh-lite.yml
-o bosh-deployment/bosh-lite-runc.yml
-o bosh-deployment/uaa.yml
-o bosh-deployment/credhub.yml
-v ...
BOSH Lite with UAA + CredHub
45. 30
$ bosh create-env bosh-deployment/bosh.yml
-o bosh-deployment/gcp/cpi.yml
-o bosh-deployment/bosh-lite.yml
-o bosh-deployment/bosh-lite-runc.yml
-o bosh-deployment/uaa.yml
-o bosh-deployment/credhub.yml
-v ...
BOSH Lite with UAA + CredHub for GCP
46. Concourse (Single VM) without BOSH Director
31
$ git clone https://github.com/concourse/concourse-deployment
$ bosh create-env concourse-deployment/concourse.yml
-o concourse-deployment/infrastructures/virtualbox.yml
--vars-store vbox-creds.yml
--state vbox-state.json
-v internal_cidr=192.168.50.0/24
-v internal_gw=192.168.50.1
-v internal_ip=192.168.50.4
-v public_ip=192.168.50.4
48. How to provision Infrastructure?
33
Infrastructure
Director
BOSH VMs
LoaderBalancer
BOSH VMs
BOSH VMs
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
49. BOSH Boot Loader (a.k.a. bbl)
34
• bbl bootstraps a CloudFoundry or Concourse
installation on AWS and GCP (and Azure).
• terraform is used internally
https://github.com/cloudfoundry/bosh-bootloader
$ brew install cloudfoundry/tap/bbl
54. Bootstrapping without BOSH Director
39
$ bbl up --no-director
$ bosh create-env bosh-deployment/bosh.yml
-o bosh-deployment/aws/cpi.yml
-o bosh-deployment/uaa.yml
-o bosh-deployment/credhub.yml
-l <(bbl bosh-deployment-vars)
$ bosh update-cloud-config <(bbl cloud-config)
https://github.com/cloudfoundry/bosh-bootloader/blob/master/docs/advanced.md
55. Bootstrapping with Operation Files
40
$ bbl up --ops-file=bosh-deployment/uaa.yml
$ cat uaa.yml credhub.yml > your-ops.yml
$ bbl up --ops-file=your-ops.yml
Multi-ops file is not supported at this moment...
56. How to provision Infrastructure?
41
Infrastructure
Director
BOSH VMs
LoaderBalancer
BOSH VMs
BOSH VMs
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
57. How to provision Infrastructure?
41
Infrastructure
Director
BOSH VMs
LoaderBalancer
BOSH VMs
BOSH VMs
Stemcell
BOSH Release
Manifest
Cloud ConfigBOSH CLI
$ bbl create-lbs --type cf
--cert cert.pem
--key key.pem
# or
$ bbl create-lbs --type concourse
69. Transition path from cf-release
52
https://github.com/cloudfoundry/cf-deployment-transition
70. Bonus topics ... (not today)
53
• CredHub
• BOSH Backup and Restore (a.k.a. bbr)
71. Summary
54
• bbl up to bootstrap IaaS
• bosh create-env to provision BOSH Director
• bosh deploy -d cf cf.yml to deploy a cluster (Cloud
Foundry)
• bosh deploy -d cf cf.yml -o ops.yml to compose
configuration
Thank you!