bosh-bootstrap 0.10.2 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.rspec +1 -0
- data/.travis.yml +0 -1
- data/ChangeLog.md +23 -4
- data/Gemfile +5 -2
- data/Guardfile +2 -0
- data/README.md +209 -197
- data/TODO.md +55 -0
- data/bosh-bootstrap.gemspec +5 -12
- data/lib/bosh/cli/commands/bootstrap.rb +42 -0
- data/lib/bosh-bootstrap/cli/commands/delete.rb +26 -0
- data/lib/bosh-bootstrap/cli/commands/deploy.rb +89 -0
- data/lib/bosh-bootstrap/cli/commands/ssh.rb +32 -0
- data/lib/bosh-bootstrap/cli/helpers/bundle.rb +12 -0
- data/lib/bosh-bootstrap/cli/helpers/interactions.rb +15 -0
- data/lib/bosh-bootstrap/cli/helpers/settings.rb +61 -0
- data/lib/bosh-bootstrap/cli/helpers.rb +11 -0
- data/lib/bosh-bootstrap/key_pair.rb +21 -0
- data/lib/bosh-bootstrap/microbosh.rb +74 -0
- data/lib/bosh-bootstrap/microbosh_providers/aws.rb +104 -0
- data/lib/bosh-bootstrap/microbosh_providers/base.rb +50 -0
- data/lib/bosh-bootstrap/microbosh_providers/openstack.rb +61 -0
- data/lib/bosh-bootstrap/microbosh_providers/vsphere.rb +78 -0
- data/lib/bosh-bootstrap/microbosh_providers.rb +11 -0
- data/lib/bosh-bootstrap/network.rb +33 -0
- data/lib/bosh-bootstrap/network_providers/aws.rb +28 -0
- data/lib/bosh-bootstrap/network_providers/dummy.rb +10 -0
- data/lib/bosh-bootstrap/network_providers/openstack.rb +28 -0
- data/lib/bosh-bootstrap/network_providers.rb +11 -0
- data/lib/bosh-bootstrap/version.rb +1 -1
- data/lib/bosh-bootstrap.rb +3 -4
- data/spec/assets/microbosh_yml/micro_bosh.aws_ec2.yml +37 -0
- data/spec/assets/microbosh_yml/micro_bosh.aws_vpc.yml +39 -0
- data/spec/assets/microbosh_yml/micro_bosh.openstack.yml +30 -0
- data/spec/assets/microbosh_yml/micro_bosh.vsphere.yml +34 -0
- data/spec/integration/aws/aws_ec2_basic_spec.rb +39 -0
- data/spec/integration/aws/aws_helpers.rb +8 -61
- data/spec/spec_helper.rb +8 -3
- data/spec/support/capture_stdout.rb +18 -0
- data/spec/unit/cli/bootstrap_spec.rb +41 -0
- data/spec/unit/commands/delete_spec.rb +20 -0
- data/spec/unit/commands/deploy_spec.rb +64 -0
- data/spec/unit/commands/ssh_spec.rb +19 -0
- data/spec/unit/key_pair_spec.rb +13 -0
- data/spec/unit/microbosh_providers/aws_spec.rb +68 -0
- data/spec/unit/microbosh_providers/openstack_spec.rb +27 -0
- data/spec/unit/microbosh_providers/vsphere_spec.rb +42 -0
- data/spec/unit/microbosh_spec.rb +27 -0
- data/spec/unit/network_providers/aws_spec.rb +29 -0
- data/spec/unit/network_providers/openstack_spec.rb +29 -0
- data/spec/unit/network_spec.rb +17 -0
- metadata +71 -235
- data/CleanupCi.md +0 -8
- data/bin/bosh-bootstrap +0 -8
- data/docs/README.md +0 -3
- data/docs/devstack-openstack-tutorial.md +0 -215
- data/lib/bosh/providers/README.md +0 -5
- data/lib/bosh/providers/aws.rb +0 -258
- data/lib/bosh/providers/base_provider.rb +0 -48
- data/lib/bosh/providers/openstack.rb +0 -79
- data/lib/bosh/providers.rb +0 -21
- data/lib/bosh-bootstrap/cli.rb +0 -1347
- data/lib/bosh-bootstrap/commander/README.md +0 -47
- data/lib/bosh-bootstrap/commander/command.rb +0 -25
- data/lib/bosh-bootstrap/commander/commands.rb +0 -80
- data/lib/bosh-bootstrap/commander/local_server.rb +0 -68
- data/lib/bosh-bootstrap/commander/remote_script_command.rb +0 -51
- data/lib/bosh-bootstrap/commander/remote_server.rb +0 -137
- data/lib/bosh-bootstrap/commander/upload_command.rb +0 -17
- data/lib/bosh-bootstrap/commander.rb +0 -9
- data/lib/bosh-bootstrap/helpers/fog_setup.rb +0 -50
- data/lib/bosh-bootstrap/helpers/settings.rb +0 -99
- data/lib/bosh-bootstrap/helpers/settings_setter.rb +0 -41
- data/lib/bosh-bootstrap/helpers.rb +0 -3
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_delete/bosh_micro_delete +0 -19
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_delete.rb +0 -90
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_deploy/bosh_micro_deploy +0 -79
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_deploy/install_key_pair_for_user +0 -23
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_deploy.rb +0 -146
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_download/download_micro_bosh_stemcell +0 -93
- data/lib/bosh-bootstrap/stages/stage_micro_bosh_download.rb +0 -139
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/configure_git +0 -25
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/create_vcap_user +0 -79
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_base_packages +0 -30
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_bosh +0 -11
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_bosh_plugins +0 -25
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_hub +0 -26
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_ruby +0 -30
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/install_useful_gems +0 -29
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm/validate_bosh_deployer +0 -18
- data/lib/bosh-bootstrap/stages/stage_prepare_inception_vm.rb +0 -69
- data/lib/bosh-bootstrap/stages/stage_salted_password/convert_salted_password +0 -11
- data/lib/bosh-bootstrap/stages/stage_salted_password.rb +0 -51
- data/lib/bosh-bootstrap/stages/stage_setup_new_bosh/setup_bosh_user +0 -29
- data/lib/bosh-bootstrap/stages/stage_setup_new_bosh.rb +0 -51
- data/lib/bosh-bootstrap/stages/stage_validate_inception_vm/validate_ubuntu +0 -6
- data/lib/bosh-bootstrap/stages/stage_validate_inception_vm.rb +0 -39
- data/lib/bosh-bootstrap/stages.rb +0 -10
- data/spec/assets/bosh/public_stemcells/aws_micro.out +0 -7
- data/spec/assets/micro_bosh_yml/micro_bosh.aws_ec2.yml +0 -35
- data/spec/assets/micro_bosh_yml/micro_bosh.aws_vpc.yml +0 -37
- data/spec/integration/aws/aws_basic_spec.rb +0 -39
- data/spec/integration/aws/aws_edge_prebuilt_ami_spec.rb +0 -46
- data/spec/integration/aws/aws_edge_prebuilt_spec.rb +0 -46
- data/spec/integration/aws/aws_edge_spec.rb +0 -45
- data/spec/unit/aws_spec.rb +0 -177
- data/spec/unit/bosh/providers/aws_spec.rb +0 -174
- data/spec/unit/cli_spec.rb +0 -134
- data/spec/unit/cli_ssh_spec.rb +0 -95
- data/spec/unit/cli_upgrade_inception_spec.rb +0 -29
- data/spec/unit/settings_setter_spec.rb +0 -29
- data/vendor/cache/POpen4-0.1.4.gem +0 -0
- data/vendor/cache/Platform-0.4.0.gem +0 -0
- data/vendor/cache/activesupport-3.2.8.gem +0 -0
- data/vendor/cache/awesome_print-1.1.0.gem +0 -0
- data/vendor/cache/aws-s3-0.6.3.gem +0 -0
- data/vendor/cache/blobstore_client-0.4.0.gem +0 -0
- data/vendor/cache/bosh_cli-1.0.3.gem +0 -0
- data/vendor/cache/bosh_common-0.5.4.gem +0 -0
- data/vendor/cache/builder-3.2.0.gem +0 -0
- data/vendor/cache/coderay-1.0.8.gem +0 -0
- data/vendor/cache/diff-lcs-1.1.3.gem +0 -0
- data/vendor/cache/escape-0.0.4.gem +0 -0
- data/vendor/cache/excon-0.20.1.gem +0 -0
- data/vendor/cache/fog-1.8.0.gem +0 -0
- data/vendor/cache/formatador-0.2.4.gem +0 -0
- data/vendor/cache/guard-1.6.2.gem +0 -0
- data/vendor/cache/guard-rspec-2.4.0.gem +0 -0
- data/vendor/cache/highline-1.6.18.gem +0 -0
- data/vendor/cache/httpclient-2.2.4.gem +0 -0
- data/vendor/cache/i18n-0.6.1.gem +0 -0
- data/vendor/cache/json_pure-1.6.8.gem +0 -0
- data/vendor/cache/listen-0.7.2.gem +0 -0
- data/vendor/cache/log4r-1.1.10.gem +0 -0
- data/vendor/cache/lumberjack-1.0.2.gem +0 -0
- data/vendor/cache/method_source-0.8.1.gem +0 -0
- data/vendor/cache/mime-types-1.22.gem +0 -0
- data/vendor/cache/multi_json-1.1.0.gem +0 -0
- data/vendor/cache/net-scp-1.0.4.gem +0 -0
- data/vendor/cache/net-ssh-2.2.2.gem +0 -0
- data/vendor/cache/net-ssh-gateway-1.1.0.gem +0 -0
- data/vendor/cache/netaddr-1.5.0.gem +0 -0
- data/vendor/cache/nokogiri-1.5.9.gem +0 -0
- data/vendor/cache/open4-1.3.0.gem +0 -0
- data/vendor/cache/progressbar-0.9.2.gem +0 -0
- data/vendor/cache/pry-0.9.11.4-java.gem +0 -0
- data/vendor/cache/pry-0.9.11.4.gem +0 -0
- data/vendor/cache/rake-10.0.3.gem +0 -0
- data/vendor/cache/rb-fsevent-0.9.3.gem +0 -0
- data/vendor/cache/redcard-1.0.0.gem +0 -0
- data/vendor/cache/rspec-2.12.0.gem +0 -0
- data/vendor/cache/rspec-core-2.12.2.gem +0 -0
- data/vendor/cache/rspec-expectations-2.12.1.gem +0 -0
- data/vendor/cache/rspec-mocks-2.12.2.gem +0 -0
- data/vendor/cache/ruby-atmos-pure-1.0.5.gem +0 -0
- data/vendor/cache/ruby-hmac-0.4.0.gem +0 -0
- data/vendor/cache/settingslogic-2.0.9.gem +0 -0
- data/vendor/cache/slop-3.4.3.gem +0 -0
- data/vendor/cache/spoon-0.0.1.gem +0 -0
- data/vendor/cache/terminal-table-1.4.5.gem +0 -0
- data/vendor/cache/thor-0.17.0.gem +0 -0
- data/vendor/cache/uuidtools-2.1.3.gem +0 -0
- data/vendor/cache/xml-simple-1.1.2.gem +0 -0
data/.rspec
CHANGED
data/.travis.yml
CHANGED
data/ChangeLog.md
CHANGED
@@ -1,12 +1,31 @@
|
|
1
1
|
# Change Log
|
2
2
|
|
3
|
-
`bosh-bootstrap` is a command line tool that you can run on your laptop and automatically get a microbosh (and an inception VM) deployed on
|
3
|
+
`bosh-bootstrap` is a command line tool that you can run on your laptop and automatically get a microbosh (and an inception VM) deployed on AWS (with OpenStack & vSphere coming soon).
|
4
4
|
|
5
5
|
gem install bosh-bootstrap
|
6
|
-
bosh
|
6
|
+
bosh bootstrap deploy
|
7
|
+
|
8
|
+
## v0.11
|
9
|
+
|
10
|
+
* Complete rewrite of bosh-bootstrap in orphan branch
|
11
|
+
* CodeClimate score changed from 0.82 to 3.85
|
12
|
+
* Initial support for AWS EC2; WIP for OpenStack; initial unit tests for vSphere
|
13
|
+
* Interactive Q&A is extracted into [cyoi](https://github.com/drnic/cyoi) (choose-your-own-infrastructure) library
|
14
|
+
* Accessing settings is much cleaner; functionality moved into fork of settingslogic called [readwritesettings](https://github.com/drnic/readwritesettings)
|
15
|
+
* Inception VM/server is now provisioned via separate CLI project [inception-server](https://github.com/drnic/inception-server)
|
16
|
+
* AWS/us-east-1 uses public AMIs; other regions & other CPIs use stemcells
|
17
|
+
* CLI via bosh plugin (`bosh bootstrap`) rather than a stand alone CLI (`bosh-bootstrap`)
|
18
|
+
* Added `ssh` action to ssh into the microbosh
|
19
|
+
* Added `delete` actions to delete the microbosh (but not the IP address and security groups)
|
7
20
|
|
8
21
|
## v0.10
|
9
22
|
|
23
|
+
Available on branch [v0.10](https://github.com/StarkAndWayne/bosh-bootstrap/tree/v0.10).
|
24
|
+
|
25
|
+
Install using:
|
26
|
+
|
27
|
+
gem install bosh-bootstrap -v "~> 0.10.0"
|
28
|
+
|
10
29
|
* Only using latest pre-release bosh gems & stemcells/amis - do not upgrade if you want the old 2012 gems
|
11
30
|
* AWS us-east-1 uses a pre-built AMI for extra speed
|
12
31
|
* AWS all regions are working (using pre-created stemcell)
|
@@ -54,7 +73,7 @@ Changes:
|
|
54
73
|
|
55
74
|
Work in progress:
|
56
75
|
|
57
|
-
* AWS VPC support was begin by the core
|
76
|
+
* AWS VPC support was begin by the core bosh team; though work has stopped sadly.
|
58
77
|
* Growing number of specs mostly using Fog.mock! mode; tests being run on travis
|
59
78
|
|
60
79
|
### v0.7.1
|
@@ -70,7 +89,7 @@ Work in progress:
|
|
70
89
|
Highlights:
|
71
90
|
|
72
91
|
* Defaults to downloading latest stemcell (rather than stable, which are getting old now).
|
73
|
-
* Installs the Cloud Foundry plugin for
|
92
|
+
* Installs the Cloud Foundry plugin for bosh https://github.com/StarkAndWayne/bosh-cloudfoundry
|
74
93
|
|
75
94
|
Additions:
|
76
95
|
|
data/Gemfile
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
source 'https://rubygems.org'
|
2
2
|
|
3
|
-
# Specify your gem's dependencies in bosh-bootstrap.gemspec
|
4
3
|
gemspec
|
5
4
|
|
5
|
+
if File.directory?("../cyoi")
|
6
|
+
gem "cyoi", path: "../cyoi"
|
7
|
+
end
|
8
|
+
|
6
9
|
group :development do
|
7
10
|
gem "awesome_print"
|
8
11
|
gem "rb-fsevent", "~> 0.9.1"
|
9
12
|
gem "guard-rspec"
|
10
|
-
end
|
13
|
+
end
|
data/Guardfile
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
guard 'rspec', spec_paths: ["spec/unit"] do
|
2
2
|
watch(%r{^spec/unit/(.+_spec)\.rb$})
|
3
|
+
watch(%r{^lib/bosh/cli/commands/(.+)\.rb$}) { |m| "spec/unit/cli" }
|
4
|
+
watch(%r{^lib/bosh-bootstrap/cli/commands/(.+)\.rb$}) { |m| "spec/unit/commands/#{m[1]}_spec.rb" }
|
3
5
|
watch(%r{^lib/bosh-bootstrap/(.+)\.rb$}) { |m| "spec/unit/#{m[1]}_spec.rb" }
|
4
6
|
watch('spec/spec_helper.rb') { "spec/unit" }
|
5
7
|
end
|
data/README.md
CHANGED
@@ -1,32 +1,67 @@
|
|
1
|
-
#
|
1
|
+
# Bosh Bootstrap
|
2
2
|
|
3
|
-
In order to deploy
|
3
|
+
In order to deploy Cloud Foundry, and a growing number of other complex systems, you will need a bosh. bosh provides a complete lifecycle manager/deployer for complex systems. Cloud Foundry is a very complex system when it comes to deployment/upgrades.
|
4
4
|
|
5
|
-
|
5
|
+
Bosh's primary role is orchestration of servers, their persistent storage and networking. It also includes its own packaging and configuration management systems.
|
6
6
|
|
7
|
-
|
7
|
+
Bosh can run on AWS, modern OpenStack, vSphere 5+ and latest vCloud. New infrastructures are being added regularly.
|
8
|
+
|
9
|
+
Bosh Bootstrap is the simplest way to get a micro bosh running and upgrade/destroy it over time. It attempts to auto-detect your infrastructure preferences and asks questions for any information it cannot determine.
|
10
|
+
|
11
|
+
Bosh Bootstrap currently supports AWS, with OpenStack and vSphere coming soon. To "support" one of Bosh's cloud providers is merely to know how to generate a `micro_bosh.yml` file for that Bosh CPI; and add the interactive Q & A to the [cyoi](https://github.com/drnic/cyoi) library.
|
12
|
+
|
13
|
+
It also performs the task as fast as it is possible. On AWS, if a public AMI has been published for your requested region then it will use that (currently: us-east-1/Virginia).
|
8
14
|
|
9
15
|
```
|
10
|
-
$ bosh
|
11
|
-
|
12
|
-
|
16
|
+
$ bosh bootstrap deploy
|
17
|
+
Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
|
18
|
+
1. AWS (default)
|
19
|
+
2. AWS (bosh)
|
20
|
+
3. AWS (starkandwayne)
|
21
|
+
4. AWS (pivotaltravis)
|
22
|
+
5. AWS (swblobstore)
|
23
|
+
6. Alternate credentials
|
24
|
+
Choose an auto-detected infrastructure: 3
|
25
|
+
|
26
|
+
Using provider AWS
|
27
|
+
|
13
28
|
|
14
|
-
|
15
|
-
|
29
|
+
1. *US East (Northern Virginia) Region (us-east-1)
|
30
|
+
2. US West (Oregon) Region (us-west-2)
|
31
|
+
3. US West (Northern California) Region (us-west-1)
|
32
|
+
4. EU (Ireland) Region (eu-west-1)
|
33
|
+
5. Asia Pacific (Singapore) Region (ap-southeast-1)
|
34
|
+
6. Asia Pacific (Sydney) Region (ap-southeast-2)
|
35
|
+
7. Asia Pacific (Tokyo) Region (ap-northeast-1)
|
36
|
+
8. South America (Sao Paulo) Region (sa-east-1)
|
37
|
+
Choose AWS region: 1
|
38
|
+
|
39
|
+
Confirming: Using AWS/us-east-1
|
40
|
+
Acquiring a public IP address... 107.21.194.123
|
41
|
+
|
42
|
+
Confirming: Using address 107.21.194.123
|
43
|
+
|
44
|
+
...
|
45
|
+
|
46
|
+
Generating ~/.bosh-bootstrap/universes/aws-us-east-1/micro_bosh.yml...
|
47
|
+
Deploying micro bosh server...
|
48
|
+
|
49
|
+
$ bosh bootstrap ssh
|
50
|
+
SSH to micro bosh server...
|
16
51
|
|
17
52
|
$ bosh-bootstrap delete
|
18
|
-
Deleting micro
|
53
|
+
Deleting micro bosh VM...
|
19
54
|
```
|
20
55
|
|
21
|
-
It is now very simple to bootstrap a micro
|
56
|
+
It is now very simple to bootstrap a micro bosh from a single, local CLI.
|
22
57
|
|
23
|
-
To be cute about it, the
|
58
|
+
To be cute about it, the Bosh Bootstrap aims to provide lifecycle management for the bosh lifecycle manager. Zing! See the "Deep dive into deploy command" section below for greater understanding why the Bosh Bootstrap is very useful.
|
24
59
|
|
25
60
|
[![Gem Version](https://badge.fury.io/rb/bosh-bootstrap.png)](http://badge.fury.io/rb/bosh-bootstrap) [![Build Status](https://travis-ci.org/StarkAndWayne/bosh-bootstrap.png?branch=master)](https://travis-ci.org/StarkAndWayne/bosh-bootstrap) [![Code Climate](https://codeclimate.com/github/StarkAndWayne/bosh-bootstrap.png)](https://codeclimate.com/github/StarkAndWayne/bosh-bootstrap)
|
26
61
|
|
27
62
|
## Installation
|
28
63
|
|
29
|
-
This
|
64
|
+
This bootstrap tool is distributed as a RubyGem for Ruby 1.9+.
|
30
65
|
|
31
66
|
```
|
32
67
|
$ ruby -v
|
@@ -38,82 +73,84 @@ $ gem install bosh-bootstrap
|
|
38
73
|
|
39
74
|
### First time usage
|
40
75
|
|
41
|
-
The first time you use `bosh
|
76
|
+
The first time you use `bosh bootstrap` it will create everything necessary, including a public IP address, security groups, a private key, and the all-important micro bosh that you want. The example output below includes user prompts.
|
42
77
|
|
43
78
|
```
|
44
|
-
$ bosh
|
45
|
-
|
46
|
-
Stage 1: Choose infrastructure
|
47
|
-
|
48
|
-
Found infrastructure API credentials at ~/.fog (override with --fog)
|
79
|
+
$ bosh bootstrap deploy
|
80
|
+
Auto-detected infrastructure API credentials at ~/.fog (override with $FOG)
|
49
81
|
1. AWS (default)
|
50
82
|
2. AWS (bosh)
|
51
|
-
3.
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
Confirming:
|
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
|
-
|
83
|
+
3. AWS (starkandwayne)
|
84
|
+
4. AWS (pivotaltravis)
|
85
|
+
5. AWS (swblobstore)
|
86
|
+
6. Alternate credentials
|
87
|
+
Choose an auto-detected infrastructure: 3
|
88
|
+
|
89
|
+
Using provider AWS
|
90
|
+
|
91
|
+
|
92
|
+
1. *US East (Northern Virginia) Region (us-east-1)
|
93
|
+
2. US West (Oregon) Region (us-west-2)
|
94
|
+
3. US West (Northern California) Region (us-west-1)
|
95
|
+
4. EU (Ireland) Region (eu-west-1)
|
96
|
+
5. Asia Pacific (Singapore) Region (ap-southeast-1)
|
97
|
+
6. Asia Pacific (Sydney) Region (ap-southeast-2)
|
98
|
+
7. Asia Pacific (Tokyo) Region (ap-northeast-1)
|
99
|
+
8. South America (Sao Paulo) Region (sa-east-1)
|
100
|
+
Choose AWS region: 1
|
101
|
+
|
102
|
+
Confirming: Using AWS/us-east-1
|
103
|
+
Acquiring a public IP address... 107.21.194.123
|
104
|
+
|
105
|
+
Confirming: Using address 107.21.194.123
|
106
|
+
Created security group ssh
|
107
|
+
-> opened ports ports TCP 22..22 from IP range 0.0.0.0/0
|
108
|
+
Created security group bosh_nats_server
|
109
|
+
-> opened ports ports TCP 4222..4222 from IP range 0.0.0.0/0
|
110
|
+
Created security group bosh_agent_http
|
111
|
+
-> opened ports ports TCP 6868..6868 from IP range 0.0.0.0/0
|
112
|
+
Created security group bosh_blobstore
|
113
|
+
-> opened ports ports TCP 25250..25250 from IP range 0.0.0.0/0
|
114
|
+
Created security group bosh_director
|
115
|
+
-> opened ports ports TCP 25555..25555 from IP range 0.0.0.0/0
|
116
|
+
Created security group bosh_registry
|
117
|
+
-> opened ports ports TCP 25777..25777 from IP range 0.0.0.0/0
|
118
|
+
Acquiring a key pair firstbosh... done
|
119
|
+
|
120
|
+
Confirming: Using key pair firstbosh
|
121
|
+
Determining stemcell image/file to use... ami-43f49d2a
|
122
|
+
bundle install
|
123
|
+
...
|
124
|
+
|
125
|
+
bundle exec bosh micro deployment firstbosh
|
126
|
+
WARNING! Your target has been changed to `https://firstbosh:25555'!
|
127
|
+
Deployment set to '/Users/drnic/.microbosh/deployments/firstbosh/micro_bosh.yml'
|
128
|
+
bundle exec bosh -n micro deploy ami-43f49d2a
|
129
|
+
|
130
|
+
Deploy Micro BOSH
|
131
|
+
using existing stemcell (00:00:00)
|
132
|
+
creating VM from ami-43f49d2a (00:01:10)
|
133
|
+
waiting for the agent (00:02:34)
|
134
|
+
create disk (00:00:02)
|
135
|
+
mount disk (00:00:19)
|
136
|
+
fetching apply spec (00:00:00)
|
137
|
+
stopping agent services (00:00:02)
|
138
|
+
applying micro BOSH spec (00:00:16)
|
139
|
+
starting agent services (00:00:00)
|
140
|
+
waiting for the director (00:00:59)
|
141
|
+
Done 11/11 00:05:40
|
142
|
+
WARNING! Your target has been changed to `https://107.21.94.132:25555'!
|
143
|
+
Deployment set to '/Users/drnic/.microbosh/deployments/firstbosh/micro_bosh.yml'
|
144
|
+
Deployed `firstbosh/micro_bosh.yml' to `https://firstbosh:25555', took 00:05:40 to complete
|
109
145
|
```
|
110
146
|
|
111
|
-
|
147
|
+
Finally, target and create a user:
|
112
148
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
149
|
+
```
|
150
|
+
bosh -u admin -p admin target https://107.21.94.132:25555
|
151
|
+
bosh -u admin -p admin create user
|
152
|
+
bosh login
|
153
|
+
```
|
117
154
|
|
118
155
|
### Repeat usage
|
119
156
|
|
@@ -121,185 +158,163 @@ The `deploy` command can be re-run and it will not prompt again for inputs. It a
|
|
121
158
|
|
122
159
|
## SSH access
|
123
160
|
|
124
|
-
You can open an SSH shell
|
161
|
+
You can open an SSH shell to your micro bosh:
|
125
162
|
|
126
163
|
```
|
127
|
-
$ bosh
|
164
|
+
$ bosh bootstrap ssh
|
128
165
|
```
|
129
166
|
|
130
|
-
|
167
|
+
## Deleting micro bosh
|
131
168
|
|
132
|
-
|
133
|
-
$ bosh-bootstrap ssh 'whoami'
|
134
|
-
ubuntu
|
135
|
-
```
|
136
|
-
|
137
|
-
## Deleting micro BOSH
|
138
|
-
|
139
|
-
The `bosh-bootstrap delete` command will delete the target micro-bosh.
|
169
|
+
The `bosh bootstrap delete` command will delete the target micro-bosh.
|
140
170
|
|
141
171
|
```
|
142
|
-
$ bosh
|
143
|
-
Stage 1: Target inception VM to use to delete micro-bosh
|
144
|
-
|
145
|
-
Confirming: Using inception VM ubuntu@ec2-184-73-231-239.compute-1.amazonaws.com
|
146
|
-
|
147
|
-
Stage 2: Deleting micro BOSH
|
148
|
-
Delete micro BOSH
|
149
|
-
stopping agent services (00:00:01)
|
150
|
-
unmount disk (00:00:10)
|
151
|
-
detach disk (00:00:13)
|
152
|
-
delete disk (00:02:35)
|
153
|
-
delete VM (00:00:37)
|
154
|
-
delete stemcell (00:00:00)
|
155
|
-
Done 6/6 00:03:37
|
156
|
-
Deleted deployment 'microbosh-aws-us-east-1', took 00:03:37 to complete
|
172
|
+
$ bosh bootstrap delete
|
157
173
|
```
|
158
174
|
|
159
|
-
## Deep dive into the
|
175
|
+
## Deep dive into the Bosh Bootstrap deploy command
|
160
176
|
|
161
|
-
What is actually happening when you run `bosh
|
177
|
+
What is actually happening when you run `bosh bootstrap deploy`?
|
162
178
|
|
163
|
-
At the heart of `bosh
|
179
|
+
At the heart of `bosh bootstrap deploy` is the execution of the micro bosh deployer, a bosh plugin provided to bootstrap a single VM with all the parts of bosh running on it. If you ran this command yourself you would run:
|
164
180
|
|
165
181
|
```
|
166
|
-
$ gem install bosh-
|
167
|
-
$ bosh
|
168
|
-
$ bosh micro deploy
|
182
|
+
$ gem install bosh_cli_plugin_micro -s https://s3.amazonaws.com/bosh-jenkins-gems/
|
183
|
+
$ bosh micro deployment path/to/manifest/folder
|
184
|
+
$ bosh micro deploy ami-43f49d2a
|
169
185
|
```
|
170
186
|
|
171
|
-
Unfortunately for this simple scenario, there are many little prerequisite steps before those three commands.
|
187
|
+
Unfortunately for this simple scenario, there are many little prerequisite steps before those three commands. Bosh Bootstrap replaces pages and pages of step-by-step instructions with a single command line that does everything. It even allows you to upgrade your micro bosh with newer bosh releases:
|
188
|
+
|
189
|
+
* public machine images (AMIs on AWS)
|
190
|
+
* publicly available stemcells
|
191
|
+
* custom stemcells generated from the bosh repository.
|
172
192
|
|
173
|
-
To understand exactly what the `bosh
|
193
|
+
To understand exactly what the `bosh bootstrap deploy` command is doing, let's start with what the running parts of bosh are and how `bosh micro deploy` deploys them.
|
174
194
|
|
175
|
-
### What is in
|
195
|
+
### What is in bosh?
|
176
196
|
|
177
|
-
A running
|
197
|
+
A running bosh, whether it is running on a single server or a cluster of servers, is a collection of processes. The core of bosh is the Director and the Blobstore. The remaining processes provide support, storage or messaging.
|
178
198
|
|
179
|
-
* The Director, the public API for the bosh CLI and coordinator of
|
199
|
+
* The Director, the public API for the bosh CLI and coordinator of bosh behavior
|
180
200
|
* The Blobstore, to store and retrieve precompiled packages
|
181
201
|
* Agents, run on each server within deployments
|
182
202
|
* The Health Manager, to track the state of deployed systems (the infrastructure and running jobs)
|
183
|
-
* Internal DNS, called PowerDNS, for internal unique naming of servers within
|
203
|
+
* Internal DNS, called PowerDNS, for internal unique naming of servers within bosh deployments
|
184
204
|
* Registry, for example AWS Registry, for tracking the infrastructure that has been provisioned (servers, persistent disks)
|
185
205
|
* PostgreSQL
|
186
206
|
* Redis
|
187
207
|
|
188
|
-
When you deploy a
|
208
|
+
When you deploy a bosh using the bosh micro deployer (`bosh micro deploy`) or indirectly via the Bosh Bootstrap, you are actually deploying a bosh release that describes a bosh (see [release](https://github.com/cloudfoundry/bosh/tree/master/release) folder). The processes listed above are called "jobs" and you can see the full list of jobs inside a bosh within the [jobs/ directory](https://github.com/cloudfoundry/bosh/tree/master/release/jobs) of the `bosh` repository.
|
189
209
|
|
190
|
-
But you don't yet have a
|
210
|
+
But you don't yet have a bosh to deploy another bosh.
|
191
211
|
|
192
|
-
### How to get your first
|
212
|
+
### How to get your first bosh?
|
193
213
|
|
194
|
-
The
|
214
|
+
The bosh micro deployer (`bosh micro deploy`) exists to spin you up a pre-baked server with all the packages and jobs running.
|
195
215
|
|
196
|
-
When you run the
|
216
|
+
When you run the bosh micro deployer on a server, it does not convert that server into a bosh. Rather, it provisions a single brand new server, with all the required packages, configuration and startup scripts. We call this pre-baked server a micro bosh.
|
197
217
|
|
198
|
-
A
|
218
|
+
A micro bosh server is a normal running server built from a base OS image that already contains all the packages, configuration and startup scripts for the jobs listed above.
|
199
219
|
|
200
|
-
In
|
220
|
+
In bosh terminology, call these pre-packaged base OS images "stemcells".
|
201
221
|
|
202
|
-
For AWS, vSphere and OpenStack there are publicly available stemcells that can bootstrap a Micro BOSH for that infrastructure. To see the current list of all public Micro BOSH stemcells for all infrastructure providers; and to download one of them:
|
203
222
|
|
204
|
-
|
205
|
-
$ bosh public stemcells --tag micro
|
206
|
-
$ bosh download public stemcell micro-bosh-stemcell-aws-0.6.4.tgz
|
207
|
-
```
|
208
|
-
|
209
|
-
The CloudFoundry BOSH team will release new public stemcells over time. The BOSH Deployer allows you to upgrade to newer stemcells as easily as it is to deploy a Micro BOSH initially.
|
223
|
+
### Configuring a micro bosh
|
210
224
|
|
211
|
-
|
212
|
-
$ bosh micro deploy micro-bosh-stemcell-aws-0.6.4.tgz
|
213
|
-
$ bosh micro deploy micro-stemcell-aws-0.7.0.tgz --update
|
214
|
-
```
|
225
|
+
The command above will not work without first providing bosh micro deployer with configuration details. The stemcell file alone is not sufficient information. When we deploy or update a micro bosh we need to provide the following:
|
215
226
|
|
216
|
-
|
217
|
-
|
218
|
-
The command above will not work without first providing BOSH Deployer with configuration details. The stemcell file alone is not sufficient information. When we deploy or update a Micro BOSH we need to provide the following:
|
219
|
-
|
220
|
-
* A static IP address - this IP address will be bound to the initial Micro BOSH server, and when the Micro BOSH is updated in future and the server is thrown away and replaced, then it is bound to the replacement servers
|
227
|
+
* A static IP address - this IP address will be bound to the initial micro bosh server, and when the micro bosh is updated in future and the server is thrown away and replaced, then it is bound to the replacement servers
|
221
228
|
* Server properties - the instance type (such as m1.large on AWS) or RAM/CPU combination (on vSphere)
|
222
|
-
* Server persistent disk - a single persistent, attached disk volume will be provisioned and mounted at `/var/vcap/store`; when the
|
223
|
-
* Infrastructure API credentials - the magic permissions for the
|
229
|
+
* Server persistent disk - a single persistent, attached disk volume will be provisioned and mounted at `/var/vcap/store`; when the micro bosh is updated is is unmounted, unattached from the current server and then reattached and remounted to the upgraded server
|
230
|
+
* Infrastructure API credentials - the magic permissions for the micro bosh to provision servers and persistent disks for its bosh deployments
|
224
231
|
|
225
|
-
This information is to go into a file called `/path/to/deployments/NAME/micro_bosh.yml`. Before `bosh micro deploy` is run, we first need to tell
|
232
|
+
This information is to go into a file called `/path/to/deployments/NAME/micro_bosh.yml`. Before `bosh micro deploy` is run, we first need to tell bosh micro deployer which file contains the micro bosh deployment manifest.
|
226
233
|
|
227
|
-
In the
|
234
|
+
In the Bosh Bootstrap, the manifests are stored at `~/.microbosh/deployments/NAME/micro_bosh.yml`.
|
228
235
|
|
229
|
-
So the
|
236
|
+
So the bosh micro deployer command that is run to specify the deployment manifest and run the deployment is:
|
230
237
|
|
231
238
|
```
|
232
|
-
$ bosh micro deployment
|
233
|
-
$ bosh micro deploy
|
239
|
+
$ bosh micro deployment `~/.microbosh/deployments/NAME/micro_bosh.yml`
|
240
|
+
$ bosh micro deploy ami-43f49d2a
|
234
241
|
```
|
235
242
|
|
236
|
-
### Why does it take so long to deploy
|
243
|
+
### Why does it take so long to deploy micro bosh on AWS?
|
244
|
+
|
245
|
+
On AWS it can take over 20 minutes to deploy or upgrade a micro bosh from a public stemcell. The majority of this time is taken with converting the stemcell file (such as `micro-bosh-stemcell-aws-0.6.4.tgz`) into an Amazon AMI.
|
237
246
|
|
238
|
-
|
247
|
+
If you are using AWS us-east-1, like the examples above, then you will be automatically given the public AMI. This saves you about 15 minutes. POW!
|
239
248
|
|
240
|
-
When you boot a new server on AWS you provide the base machine image for the root filesystem. This is called the Amazon Machine Image (AMI). For our
|
249
|
+
When you boot a new server on AWS you provide the base machine image for the root filesystem. This is called the Amazon Machine Image (AMI). For our micro bosh, we need an AMI that contains all the packages, process configuration and startup scripts. That is, we need to convert our stemcell into an AMI; then use the AMI to boot the micro bosh server.
|
241
250
|
|
242
|
-
The
|
251
|
+
The bosh micro deployer performs all the hard work to create an AMI. Believe me, it is a lot of hard work.
|
243
252
|
|
244
|
-
The summary of the process of creating the
|
253
|
+
The summary of the process of creating the micro bosh AMI is:
|
245
254
|
|
246
|
-
1. Create a new EBS volume (an attached disk) on the server running
|
255
|
+
1. Create a new EBS volume (an attached disk) on the server running bosh micro deployer
|
247
256
|
2. Unpack/upload the stemcell onto the EBS volume
|
248
257
|
3. Create a snapshot of the EBS volume
|
249
258
|
4. Register the snapshot as an AMI
|
250
259
|
|
251
|
-
This process takes the majority of the time to deploy a new/replacement
|
260
|
+
This process takes the majority of the time to deploy a new/replacement micro bosh server.
|
252
261
|
|
253
|
-
###
|
262
|
+
### When I run Bosh Bootstrap from my laptop?
|
254
263
|
|
255
|
-
One of the feature of the
|
264
|
+
One of the feature of the Bosh Bootstrap is that you can run it from your local laptop if you:
|
256
265
|
|
257
|
-
|
266
|
+
* Use AWS region us-east-1 (where there is a public AMI available)
|
267
|
+
* Use OpenStack or vSphere
|
258
268
|
|
259
|
-
###
|
269
|
+
### When do I need an inception server?
|
260
270
|
|
261
|
-
|
271
|
+
There are occasions when it is preferable or required to provision a initial server (called an [inception server](https://github.com/drnic/inception-server)) and to run Bosh Bootstrap (`bosh bootstrap deploy`) within that.
|
262
272
|
|
263
|
-
|
273
|
+
* Using a AWS region other than us-east-1 (you need to be in that region to create an AMI)
|
274
|
+
* You want much faster internet between your terminal (an ssh session into your inception server) and your micro bosh and deployed servers
|
264
275
|
|
265
|
-
|
276
|
+
To provision an [inception server](https://github.com/drnic/inception-server):
|
277
|
+
|
278
|
+
```
|
279
|
+
$ gem install inception-server
|
280
|
+
$ inception deploy
|
281
|
+
$ inception ssh
|
282
|
+
> gem install bosh-bootstrap
|
283
|
+
```
|
284
|
+
|
285
|
+
Like Bosh Bootstrap, it will prompt for the infrastructure/cloud provider that you want, your credentials and then do everything for you automatically.
|
266
286
|
|
267
287
|
## Internal configuration/settings
|
268
288
|
|
269
|
-
Once you've used the CLI it stores your settings for your
|
289
|
+
Once you've used the CLI it stores your settings for your bosh, so that you can re-run the tool for upgrades or other future functionality.
|
270
290
|
|
271
|
-
By default, the settings file is stored at `~/.
|
291
|
+
By default, the settings file is stored at `~/.microbosh/settings.yml`.
|
272
292
|
|
273
|
-
For an AWS
|
293
|
+
For an AWS bosh it looks like:
|
274
294
|
|
275
295
|
``` yaml
|
276
|
-
---
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
296
|
+
---
|
297
|
+
bosh:
|
298
|
+
name: firstbosh
|
299
|
+
provider:
|
300
|
+
name: aws
|
301
|
+
credentials:
|
302
|
+
provider: AWS
|
303
|
+
aws_access_key_id: ACCESS
|
304
|
+
aws_secret_access_key: SECRET
|
282
305
|
region: us-east-1
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
bosh_username: drnic
|
296
|
-
bosh_password: PASSWORD
|
297
|
-
bosh:
|
298
|
-
password: PASSWORD
|
299
|
-
salted_password: 'sdfkjhadsjkadsfjhdsf'
|
300
|
-
persistent_disk: 16384
|
301
|
-
ip_address: 107.22.247.45
|
302
|
-
micro_bosh_stemcell_name: "micro-bosh-stemcell-aws-0.6.4.tgz"
|
306
|
+
address:
|
307
|
+
ip: 107.21.194.123
|
308
|
+
key_pair:
|
309
|
+
name: firstbosh
|
310
|
+
fingerprint: 3c:09:26:84:df:43:92:d7:bb:31:05:e2:77:84:58:c7:d0:aa:27:18
|
311
|
+
private_key: |-
|
312
|
+
-----BEGIN RSA PRIVATE KEY-----
|
313
|
+
42mrej3mV7BzyEzuwYfancQo6cVKUcjWmZPbTU882l8JAoGASGhmtSr/bIZ+sLeQCfdEz0g5xNvF
|
314
|
+
ls1q9vuRLx6cJlO0lZgIUhMWU6Ewk5Qt4bbH2vbxiFPEyEAKq52u24aXSBj7HRc8TTyZtbKMuJGM
|
315
|
+
l32aFX8NKv2qrErfjI5j43pJ62Hqk6v6F0OYUVQSXRXe2UNavuFt8WR1Adqy8QLW248=
|
316
|
+
...
|
317
|
+
-----END RSA PRIVATE KEY-----
|
303
318
|
```
|
304
319
|
|
305
320
|
## Contributing
|
@@ -316,7 +331,4 @@ All documentation and source code is copyright of Stark & Wayne LLC.
|
|
316
331
|
|
317
332
|
## Subscription and Support
|
318
333
|
|
319
|
-
This documentation & tool is freely available to all people and companies coming to
|
320
|
-
|
321
|
-
If you decide to run CloudFoundry and BOSH in production, please purchase a Subscription and Support Agreement with Stark & Wayne so we can continue to create and maintain top quality documentation and tools; and also provide you with bespoke support for your deployments. We want to help you be successfully.
|
322
|
-
|
334
|
+
This documentation & tool is freely available to all people and companies coming to Cloud Foundry and bosh.
|