bosh_cli_plugin_aws 1.5.0.pre.1113
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bosh/cli/commands/aws.rb +464 -0
- data/lib/bosh_cli_plugin_aws/aws_config.rb +141 -0
- data/lib/bosh_cli_plugin_aws/aws_provider.rb +53 -0
- data/lib/bosh_cli_plugin_aws/bat_manifest.rb +40 -0
- data/lib/bosh_cli_plugin_aws/bootstrap.rb +31 -0
- data/lib/bosh_cli_plugin_aws/bosh_bootstrap.rb +158 -0
- data/lib/bosh_cli_plugin_aws/bosh_manifest.rb +71 -0
- data/lib/bosh_cli_plugin_aws/ec2.rb +265 -0
- data/lib/bosh_cli_plugin_aws/elb.rb +132 -0
- data/lib/bosh_cli_plugin_aws/micro_bosh_bootstrap.rb +64 -0
- data/lib/bosh_cli_plugin_aws/microbosh_manifest.rb +117 -0
- data/lib/bosh_cli_plugin_aws/migration.rb +40 -0
- data/lib/bosh_cli_plugin_aws/migration_helper.rb +150 -0
- data/lib/bosh_cli_plugin_aws/migrator.rb +137 -0
- data/lib/bosh_cli_plugin_aws/rds.rb +182 -0
- data/lib/bosh_cli_plugin_aws/route53.rb +103 -0
- data/lib/bosh_cli_plugin_aws/s3.rb +93 -0
- data/lib/bosh_cli_plugin_aws/version.rb +5 -0
- data/lib/bosh_cli_plugin_aws/vpc.rb +181 -0
- data/lib/bosh_cli_plugin_aws.rb +31 -0
- data/migrations/20130412000811_create_key_pairs.rb +8 -0
- data/migrations/20130412004642_create_vpc.rb +65 -0
- data/migrations/20130412181302_create_route53_records.rb +37 -0
- data/migrations/20130412183544_create_rds_dbs.rb +35 -0
- data/migrations/20130412192351_create_s3.rb +4 -0
- data/migrations/20130529212130_create_more_unique_s3_buckets.rb +33 -0
- data/migrations/20130531180445_create_bosh_rds_db.rb +30 -0
- data/migrations/20130826150635_update_elb_for_websockets.rb +97 -0
- data/migrations/20130827000001_add_secondary_az_to_vpc.rb +34 -0
- data/templates/aws_configuration_template.yml.erb +187 -0
- data/templates/aws_migration.erb +5 -0
- data/templates/aws_migration_spec.erb +12 -0
- data/templates/bat.yml.erb +84 -0
- data/templates/bosh.yml.erb +198 -0
- data/templates/micro_bosh.yml.erb +82 -0
- metadata +163 -0
@@ -0,0 +1,97 @@
|
|
1
|
+
class UpdateElbForWebsockets < Bosh::Aws::Migration
|
2
|
+
def execute
|
3
|
+
validate_receipt
|
4
|
+
|
5
|
+
vpc = Bosh::Aws::VPC.find(ec2, vpc_id)
|
6
|
+
security_group = vpc.security_group_by_name(cfrouter_security_group_name)
|
7
|
+
|
8
|
+
params = {"protocol" => "tcp", "ports" => "4443", "sources" => "0.0.0.0/0"}
|
9
|
+
if WebSocketElbHelpers.authorize_ingress(security_group, params)
|
10
|
+
WebSocketElbHelpers.record_ingress(vpc_receipt, cfrouter_security_group_name, params)
|
11
|
+
save_receipt('aws_vpc_receipt', vpc_receipt)
|
12
|
+
end
|
13
|
+
|
14
|
+
cfrouter_elb = elb.find_by_name("cfrouter")
|
15
|
+
|
16
|
+
params = {port: 443, protocol: :https}
|
17
|
+
https_listener_server_certificate = WebSocketElbHelpers.find_server_certificate_from_listeners(cfrouter_elb, params)
|
18
|
+
|
19
|
+
params = {port: 4443, protocol: :ssl, instance_port: 80, instance_protocol: :tcp, server_certificate: https_listener_server_certificate}
|
20
|
+
WebSocketElbHelpers.create_listener(cfrouter_elb, params)
|
21
|
+
end
|
22
|
+
|
23
|
+
private
|
24
|
+
|
25
|
+
def validate_receipt
|
26
|
+
begin
|
27
|
+
cfrouter_config
|
28
|
+
rescue KeyError
|
29
|
+
err("Unable to find `cfrouter' ELB configuration in AWS VPC Receipt")
|
30
|
+
end
|
31
|
+
|
32
|
+
begin
|
33
|
+
cfrouter_security_group_name
|
34
|
+
rescue KeyError
|
35
|
+
err("Unable to find `cfrouter' ELB Security Group in AWS VPC Receipt")
|
36
|
+
end
|
37
|
+
|
38
|
+
begin
|
39
|
+
vpc_id
|
40
|
+
rescue KeyError
|
41
|
+
err("Unable to find VPC ID in AWS VPC Receipt")
|
42
|
+
end
|
43
|
+
|
44
|
+
end
|
45
|
+
|
46
|
+
def vpc_receipt
|
47
|
+
@vpc_receipt ||= load_receipt('aws_vpc_receipt')
|
48
|
+
end
|
49
|
+
|
50
|
+
def cfrouter_config
|
51
|
+
vpc_receipt.fetch('original_configuration').fetch('vpc').fetch('elbs').fetch('cfrouter')
|
52
|
+
end
|
53
|
+
|
54
|
+
def cfrouter_security_group_name
|
55
|
+
cfrouter_config.fetch('security_group')
|
56
|
+
end
|
57
|
+
|
58
|
+
def vpc_id
|
59
|
+
vpc_receipt.fetch('vpc').fetch('id')
|
60
|
+
end
|
61
|
+
|
62
|
+
class WebSocketElbHelpers
|
63
|
+
def self.find_security_group_by_name(ec2, vpc_id, name)
|
64
|
+
vpc = Bosh::Aws::VPC.find(ec2, vpc_id)
|
65
|
+
security_group = vpc.security_group_by_name(name)
|
66
|
+
|
67
|
+
err("AWS reports that security group #{name} does not exist") unless security_group
|
68
|
+
security_group
|
69
|
+
end
|
70
|
+
|
71
|
+
def self.authorize_ingress(security_group, params)
|
72
|
+
security_group.authorize_ingress(params['protocol'], params['ports'].to_i, params['sources'])
|
73
|
+
true
|
74
|
+
rescue AWS::EC2::Errors::InvalidPermission::Duplicate
|
75
|
+
false
|
76
|
+
end
|
77
|
+
|
78
|
+
def self.record_ingress(vpc_receipt, security_group_name, params)
|
79
|
+
receipt_security_groups = vpc_receipt['original_configuration']['vpc']['security_groups']
|
80
|
+
receipt_router_security_group = receipt_security_groups.find{ |g| g['name'] == security_group_name}
|
81
|
+
receipt_router_security_group['ingress'] << params
|
82
|
+
end
|
83
|
+
|
84
|
+
def self.find_server_certificate_from_listeners(elb, params)
|
85
|
+
listener = elb.listeners.find {|l| l.port == params[:port] && l.protocol == params[:protocol] }
|
86
|
+
|
87
|
+
err("Could not find listener with params `#{params.inspect}' on ELB `#{elb.name}'") unless listener
|
88
|
+
err("Could not find server certificate for listener with params `#{params.inspect}' on ELB `#{elb.name}'") unless listener.server_certificate
|
89
|
+
|
90
|
+
listener.server_certificate
|
91
|
+
end
|
92
|
+
|
93
|
+
def self.create_listener(elb, params)
|
94
|
+
elb.listeners.create(params)
|
95
|
+
end
|
96
|
+
end
|
97
|
+
end
|
@@ -0,0 +1,34 @@
|
|
1
|
+
class AddSecondaryAzToVpc < Bosh::Aws::Migration
|
2
|
+
include Bosh::Aws::MigrationHelper
|
3
|
+
|
4
|
+
def execute
|
5
|
+
vpc_receipt = load_receipt("aws_vpc_receipt")
|
6
|
+
|
7
|
+
vpc = Bosh::Aws::VPC.find(ec2, vpc_receipt["vpc"]["id"])
|
8
|
+
|
9
|
+
new_az = vpc_receipt["original_configuration"]["vpc"]["subnets"]["cf_elb2"]["availability_zone"]
|
10
|
+
|
11
|
+
subnets = {
|
12
|
+
"bosh2" => {"availability_zone" => new_az, "cidr" => "10.10.64.0/24", "default_route" => "igw"},
|
13
|
+
"cf2" => {"availability_zone" => new_az, "cidr" => "10.10.80.0/20", "default_route" => "cf_nat_box1"},
|
14
|
+
"services2" => {"availability_zone" => new_az, "cidr" => "10.10.96.0/20", "default_route" => "cf_nat_box1"},
|
15
|
+
}
|
16
|
+
|
17
|
+
existing_subnets = vpc.subnets
|
18
|
+
|
19
|
+
subnets.reject! { |subnet, _|
|
20
|
+
existing_subnets.include?(subnet).tap do |should_skip|
|
21
|
+
say " Skipping already-present subnet #{subnet.inspect}" if should_skip
|
22
|
+
end
|
23
|
+
}
|
24
|
+
|
25
|
+
|
26
|
+
vpc.create_subnets(subnets) { |msg| say " #{msg}" }
|
27
|
+
vpc.create_nat_instances(subnets)
|
28
|
+
vpc.setup_subnet_routes(subnets) { |msg| say " #{msg}" }
|
29
|
+
|
30
|
+
vpc_receipt["vpc"]["subnets"] = vpc.subnets
|
31
|
+
ensure
|
32
|
+
save_receipt("aws_vpc_receipt", vpc_receipt)
|
33
|
+
end
|
34
|
+
end
|
@@ -0,0 +1,187 @@
|
|
1
|
+
---
|
2
|
+
aws:
|
3
|
+
secret_access_key: <%= aws_secret_access_key %>
|
4
|
+
access_key_id: <%= aws_access_key_id %>
|
5
|
+
region: <%= aws_region %>
|
6
|
+
name: <%= vpc_deployment_name %>
|
7
|
+
vpc:
|
8
|
+
domain: <%= vpc_generated_domain %>
|
9
|
+
instance_tenancy: default
|
10
|
+
cidr: 10.10.0.0/16
|
11
|
+
subnets:
|
12
|
+
<%- [[vpc_primary_az, 0, 1], [vpc_secondary_az, 64, 2]].each do |(az, third_octet, index)| -%>
|
13
|
+
<%- if index == 1 -%> # only the first subnet gets a NAT box or CF/Services nodes until we want to start using them
|
14
|
+
bosh<%= index %>:
|
15
|
+
cidr: 10.10.<%= third_octet + 0 %>.0/24
|
16
|
+
availability_zone: <%= az %>
|
17
|
+
default_route: igw
|
18
|
+
nat_instance:
|
19
|
+
name: cf_nat_box<%= index %>
|
20
|
+
ip: 10.10.0.10 # spin up NAT instance at fixed IP of 10.10.0.10
|
21
|
+
security_group: open
|
22
|
+
key_name: <%= key_pair_name %>
|
23
|
+
<%- if production_resources? -%>
|
24
|
+
instance_type: m1.xlarge
|
25
|
+
<%- end -%>
|
26
|
+
<%- end -%>
|
27
|
+
bosh_rds<%= index %>:
|
28
|
+
cidr: 10.10.<%= third_octet + 1 %>.0/24
|
29
|
+
availability_zone: <%= az %>
|
30
|
+
cf_elb<%= index %>:
|
31
|
+
cidr: 10.10.<%= third_octet + 2 %>.0/24
|
32
|
+
availability_zone: <%= az %>
|
33
|
+
default_route: igw
|
34
|
+
cf_rds<%= index %>:
|
35
|
+
cidr: 10.10.<%= third_octet + 3 %>.0/24
|
36
|
+
availability_zone: <%= az %>
|
37
|
+
services_rds<%= index %>:
|
38
|
+
cidr: 10.10.<%= third_octet + 8 %>.0/21
|
39
|
+
availability_zone: <%= az %>
|
40
|
+
<%- if index == 1 -%>
|
41
|
+
cf<%= index %>:
|
42
|
+
cidr: 10.10.<%= third_octet + 16 %>.0/20
|
43
|
+
availability_zone: <%= az %>
|
44
|
+
default_route: cf_nat_box<%= index %>
|
45
|
+
services<%= index %>:
|
46
|
+
cidr: 10.10.<%= third_octet + 32 %>.0/20
|
47
|
+
availability_zone: <%= az %>
|
48
|
+
default_route: cf_nat_box<%= index %>
|
49
|
+
<%- end -%>
|
50
|
+
<%- end -%>
|
51
|
+
dhcp_options:
|
52
|
+
domain_name_servers:
|
53
|
+
- 10.10.0.6 # IP of the BOSH DNS server?
|
54
|
+
- 10.10.0.2 # local amazon public DNS server
|
55
|
+
security_groups:
|
56
|
+
- name: open
|
57
|
+
ingress:
|
58
|
+
- protocol: tcp
|
59
|
+
ports: '0 - 65535'
|
60
|
+
sources: 0.0.0.0/0
|
61
|
+
- protocol: udp
|
62
|
+
ports: '0 - 65535'
|
63
|
+
sources: 0.0.0.0/0
|
64
|
+
- name: bosh
|
65
|
+
ingress:
|
66
|
+
- protocol: tcp
|
67
|
+
ports: '0 - 65535'
|
68
|
+
sources: 0.0.0.0/0
|
69
|
+
- protocol: udp
|
70
|
+
ports: '0 - 65535'
|
71
|
+
sources: 0.0.0.0/0
|
72
|
+
- name: bat
|
73
|
+
ingress:
|
74
|
+
- protocol: tcp
|
75
|
+
ports: '4567'
|
76
|
+
sources: 0.0.0.0/0
|
77
|
+
- protocol: tcp
|
78
|
+
ports: '22'
|
79
|
+
sources: 0.0.0.0/0
|
80
|
+
- name: cf
|
81
|
+
ingress:
|
82
|
+
- protocol: tcp
|
83
|
+
ports: '0 - 65535'
|
84
|
+
sources: 0.0.0.0/0
|
85
|
+
- protocol: udp
|
86
|
+
ports: '0 - 65535'
|
87
|
+
sources: 0.0.0.0/0
|
88
|
+
- name: web
|
89
|
+
ingress:
|
90
|
+
- protocol: tcp
|
91
|
+
ports: '80'
|
92
|
+
sources: 0.0.0.0/0
|
93
|
+
- protocol: tcp
|
94
|
+
ports: '443'
|
95
|
+
sources: 0.0.0.0/0
|
96
|
+
elbs:
|
97
|
+
cfrouter:
|
98
|
+
dns_record: "*"
|
99
|
+
ttl: 60
|
100
|
+
subnets:
|
101
|
+
- cf_elb1
|
102
|
+
- cf_elb2
|
103
|
+
security_group: web
|
104
|
+
https: true
|
105
|
+
ssl_cert: cfrouter_cert
|
106
|
+
|
107
|
+
ssl_certs:
|
108
|
+
director_cert:
|
109
|
+
private_key_path: <%= director_ssl_key_file %>
|
110
|
+
certificate_path: <%= director_ssl_cert_file %>
|
111
|
+
cfrouter_cert:
|
112
|
+
private_key_path: <%= elb_ssl_key_file %>
|
113
|
+
certificate_path: <%= elb_ssl_cert_file %>
|
114
|
+
certificate_chain_path: <%= elb_ssl_cert_chain_file %>
|
115
|
+
|
116
|
+
elastic_ips:
|
117
|
+
# each NAT box automatically reserves 1 elastic IP, which is not listed below
|
118
|
+
micro:
|
119
|
+
instances: 1
|
120
|
+
dns_record: "micro"
|
121
|
+
ttl: 60
|
122
|
+
bat:
|
123
|
+
instances: 1
|
124
|
+
dns_record: "bat"
|
125
|
+
ttl: 60
|
126
|
+
bosh:
|
127
|
+
instances: 1
|
128
|
+
dns_record: bosh
|
129
|
+
ttl: 60
|
130
|
+
|
131
|
+
key_pairs:
|
132
|
+
<%= key_pair_name %>: <%= key_pair_path %>
|
133
|
+
|
134
|
+
<%- if has_package_cache_configuration? -%>
|
135
|
+
compiled_package_cache:
|
136
|
+
access_key_id: <%= cache_access_key_id %>
|
137
|
+
secret_access_key: <%= cache_secret_access_key %>
|
138
|
+
bucket_name: <%= cache_bucket_name %>
|
139
|
+
<%- end -%>
|
140
|
+
<%- rds_sizes = production_resources? ? {:large => "db.m1.large", :huge => "db.m2.4xlarge"} : Hash.new("db.t1.micro") -%>
|
141
|
+
rds:
|
142
|
+
- instance: ccdb
|
143
|
+
tag: cc
|
144
|
+
subnets:
|
145
|
+
- cf_rds1
|
146
|
+
- cf_rds2
|
147
|
+
aws_creation_options:
|
148
|
+
db_instance_class: <%= rds_sizes[:large] %>
|
149
|
+
# These are passed on directly to the AWS API call.
|
150
|
+
# http://docs.aws.amazon.com/AWSRubySDK/latest/AWS/RDS/Client.html#create_db_instance-instance_method
|
151
|
+
<%- if production_resources? -%>
|
152
|
+
allocated_storage: 100
|
153
|
+
iops: 1000
|
154
|
+
<%- end -%>
|
155
|
+
multi_az: true
|
156
|
+
- instance: uaadb
|
157
|
+
tag: uaa
|
158
|
+
subnets:
|
159
|
+
- cf_rds1
|
160
|
+
- cf_rds2
|
161
|
+
aws_creation_options:
|
162
|
+
db_instance_class: <%= rds_sizes[:large] %>
|
163
|
+
<%- if production_resources? -%>
|
164
|
+
allocated_storage: 100
|
165
|
+
iops: 1000
|
166
|
+
<%- end -%>
|
167
|
+
- instance: mysql-service-public
|
168
|
+
tag: mysql
|
169
|
+
subnets:
|
170
|
+
- services_rds1
|
171
|
+
- services_rds2
|
172
|
+
aws_creation_options:
|
173
|
+
db_name: mgmt
|
174
|
+
engine_version: 5.5.27
|
175
|
+
db_instance_class: <%= rds_sizes[:huge] %>
|
176
|
+
<%- if production_resources? -%>
|
177
|
+
allocated_storage: 100
|
178
|
+
iops: 1000
|
179
|
+
<%- end -%>
|
180
|
+
- instance: bosh
|
181
|
+
tag: bosh
|
182
|
+
subnets:
|
183
|
+
- bosh_rds1
|
184
|
+
- bosh_rds2
|
185
|
+
aws_creation_options:
|
186
|
+
db_instance_class: <%= rds_sizes[:large] %>
|
187
|
+
multi_az: true
|
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
require '<%= file_prefix %>'
|
3
|
+
|
4
|
+
describe <%= class_name %> do
|
5
|
+
include MigrationSpecHelper
|
6
|
+
|
7
|
+
subject { described_class.new(config, '')}
|
8
|
+
|
9
|
+
it "migrates your cloud" do
|
10
|
+
expect { subject.execute }.to_not raise_error
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,84 @@
|
|
1
|
+
---
|
2
|
+
name: <%= deployment_name %>
|
3
|
+
director_uuid: <%= director_uuid %>
|
4
|
+
cpi: aws
|
5
|
+
|
6
|
+
release:
|
7
|
+
name: bat
|
8
|
+
version: latest
|
9
|
+
|
10
|
+
resource_pools:
|
11
|
+
- name: default
|
12
|
+
stemcell:
|
13
|
+
name: <%= stemcell_name %>
|
14
|
+
version: <%= stemcell_version %>
|
15
|
+
network: default
|
16
|
+
size: 1
|
17
|
+
cloud_properties:
|
18
|
+
instance_type: m1.small
|
19
|
+
availability_zone: <%= availability_zone %>
|
20
|
+
|
21
|
+
compilation:
|
22
|
+
reuse_compilation_vms: true
|
23
|
+
workers: 8
|
24
|
+
network: default
|
25
|
+
cloud_properties:
|
26
|
+
instance_type: c1.medium
|
27
|
+
availability_zone: <%= availability_zone %>
|
28
|
+
|
29
|
+
update:
|
30
|
+
canaries: 1
|
31
|
+
canary_watch_time: 3000-90000
|
32
|
+
update_watch_time: 3000-90000
|
33
|
+
max_in_flight: 1
|
34
|
+
max_errors: 1
|
35
|
+
|
36
|
+
networks:
|
37
|
+
|
38
|
+
- name: default
|
39
|
+
type: manual
|
40
|
+
subnets:
|
41
|
+
- range: 10.10.0.0/24
|
42
|
+
reserved:
|
43
|
+
- 10.10.0.2 - 10.10.0.9
|
44
|
+
static:
|
45
|
+
- 10.10.0.10 - 10.10.0.30
|
46
|
+
gateway: 10.10.0.1
|
47
|
+
security_groups:
|
48
|
+
- bat
|
49
|
+
cloud_properties:
|
50
|
+
security_groups: bat
|
51
|
+
subnet: <%= subnet %>
|
52
|
+
|
53
|
+
jobs:
|
54
|
+
- name: "batlight"
|
55
|
+
template: "batlight"
|
56
|
+
instances: 1
|
57
|
+
resource_pool: default
|
58
|
+
networks:
|
59
|
+
- name: default
|
60
|
+
default: [dns, gateway]
|
61
|
+
|
62
|
+
properties:
|
63
|
+
static_ip: <%= vip %>
|
64
|
+
uuid: <%= director_uuid %>
|
65
|
+
pool_size: 1
|
66
|
+
stemcell:
|
67
|
+
name: <%= stemcell_name %>
|
68
|
+
version: <%= stemcell_version %>
|
69
|
+
instances: 1
|
70
|
+
key_name: <%= key_pair_name %>
|
71
|
+
mbus: nats://nats:0b450ada9f830085e2cdeff6@micro.<%= domain %>:4222
|
72
|
+
network:
|
73
|
+
cidr: 10.10.0.0/24
|
74
|
+
reserved:
|
75
|
+
- 10.10.0.2 - 10.10.0.9
|
76
|
+
static:
|
77
|
+
- 10.10.0.10 - 10.10.0.30
|
78
|
+
gateway: 10.10.0.1
|
79
|
+
subnet: <%= subnet %>
|
80
|
+
security_groups:
|
81
|
+
- bat
|
82
|
+
batlight:
|
83
|
+
missing: nope
|
84
|
+
|
@@ -0,0 +1,198 @@
|
|
1
|
+
---
|
2
|
+
name: <%= bosh_deployment_name %>
|
3
|
+
director_uuid: <%= director_uuid %>
|
4
|
+
|
5
|
+
release:
|
6
|
+
name: bosh
|
7
|
+
version: latest
|
8
|
+
|
9
|
+
networks:
|
10
|
+
- name: default
|
11
|
+
type: manual
|
12
|
+
subnets:
|
13
|
+
- range: 10.10.0.0/24
|
14
|
+
gateway: 10.10.0.1
|
15
|
+
static:
|
16
|
+
- 10.10.0.7 - 10.10.0.9
|
17
|
+
reserved:
|
18
|
+
- 10.10.0.2 - 10.10.0.6
|
19
|
+
- 10.10.0.10 - 10.10.0.10
|
20
|
+
dns:
|
21
|
+
- 10.10.0.6
|
22
|
+
cloud_properties:
|
23
|
+
subnet: <%= subnet %>
|
24
|
+
- name: vip_network
|
25
|
+
type: vip
|
26
|
+
# Fake network properties to satisfy bosh diff
|
27
|
+
subnets:
|
28
|
+
- range: 127.0.99.0/24
|
29
|
+
gateway: 127.0.99.1
|
30
|
+
dns:
|
31
|
+
- 127.0.99.250
|
32
|
+
cloud_properties:
|
33
|
+
security_groups:
|
34
|
+
- bosh
|
35
|
+
|
36
|
+
resource_pools:
|
37
|
+
- name: default
|
38
|
+
stemcell:
|
39
|
+
name: <%= stemcell_name %>
|
40
|
+
version: latest
|
41
|
+
network: default
|
42
|
+
size: 1
|
43
|
+
cloud_properties:
|
44
|
+
instance_type: m1.small
|
45
|
+
availability_zone: <%= availability_zone %>
|
46
|
+
|
47
|
+
compilation:
|
48
|
+
reuse_compilation_vms: true
|
49
|
+
workers: 8
|
50
|
+
network: default
|
51
|
+
cloud_properties:
|
52
|
+
instance_type: c1.medium
|
53
|
+
availability_zone: <%= availability_zone %>
|
54
|
+
|
55
|
+
|
56
|
+
update:
|
57
|
+
canaries: 1
|
58
|
+
canary_watch_time: 30000 - 90000
|
59
|
+
update_watch_time: 30000 - 90000
|
60
|
+
max_in_flight: 1
|
61
|
+
max_errors: 1
|
62
|
+
|
63
|
+
jobs:
|
64
|
+
- name: bosh
|
65
|
+
template:
|
66
|
+
- nats
|
67
|
+
- blobstore
|
68
|
+
- redis
|
69
|
+
- powerdns
|
70
|
+
- director
|
71
|
+
- registry
|
72
|
+
- health_monitor
|
73
|
+
instances: 1
|
74
|
+
resource_pool: default
|
75
|
+
persistent_disk: 20480
|
76
|
+
networks:
|
77
|
+
- name: default
|
78
|
+
default: [dns, gateway]
|
79
|
+
static_ips:
|
80
|
+
- 10.10.0.7
|
81
|
+
- name: vip_network
|
82
|
+
static_ips:
|
83
|
+
- <%= vip %>
|
84
|
+
|
85
|
+
properties:
|
86
|
+
template_only:
|
87
|
+
aws:
|
88
|
+
availability_zone: <%= availability_zone %>
|
89
|
+
|
90
|
+
ntp:
|
91
|
+
- 0.north-america.pool.ntp.org
|
92
|
+
- 1.north-america.pool.ntp.org
|
93
|
+
- 2.north-america.pool.ntp.org
|
94
|
+
- 3.north-america.pool.ntp.org
|
95
|
+
|
96
|
+
blobstore:
|
97
|
+
address: 10.10.0.7
|
98
|
+
port: 25251
|
99
|
+
backend_port: 25552
|
100
|
+
agent:
|
101
|
+
user: agent
|
102
|
+
password: ldsjlkadsfjlj
|
103
|
+
director:
|
104
|
+
user: director
|
105
|
+
password: DirectoR
|
106
|
+
|
107
|
+
networks:
|
108
|
+
apps: default
|
109
|
+
management: default
|
110
|
+
|
111
|
+
nats:
|
112
|
+
user: nats
|
113
|
+
password: 0b450ada9f830085e2cdeff6
|
114
|
+
address: 10.10.0.7
|
115
|
+
port: 4222
|
116
|
+
|
117
|
+
mysql: &bosh_db
|
118
|
+
adapter: mysql2
|
119
|
+
user: <%= bosh_rds_user %>
|
120
|
+
password: <%= bosh_rds_password %>
|
121
|
+
host: <%= bosh_rds_host %>
|
122
|
+
port: <%= bosh_rds_port %>
|
123
|
+
database: bosh
|
124
|
+
|
125
|
+
redis:
|
126
|
+
address: 127.0.0.1
|
127
|
+
port: 25255
|
128
|
+
password: R3d!S
|
129
|
+
|
130
|
+
director:
|
131
|
+
name: <%= bosh_deployment_name %>
|
132
|
+
address: 10.10.0.7
|
133
|
+
port: 25555
|
134
|
+
encryption: false
|
135
|
+
enable_snapshots: true
|
136
|
+
db: *bosh_db
|
137
|
+
ssl:
|
138
|
+
key: |
|
139
|
+
<%= director_ssl_key %>
|
140
|
+
cert: |
|
141
|
+
<%= director_ssl_cert %>
|
142
|
+
|
143
|
+
hm:
|
144
|
+
http:
|
145
|
+
port: 25923
|
146
|
+
user: admin
|
147
|
+
password: admin
|
148
|
+
director_account:
|
149
|
+
user: <%= hm_director_user %>
|
150
|
+
password: <%= hm_director_password %>
|
151
|
+
intervals:
|
152
|
+
poll_director: 60
|
153
|
+
poll_grace_period: 30
|
154
|
+
log_stats: 300
|
155
|
+
analyze_agents: 60
|
156
|
+
agent_timeout: 180
|
157
|
+
rogue_agent_alert: 180
|
158
|
+
loglevel: info
|
159
|
+
email_notifications: false
|
160
|
+
tsdb_enabled: false
|
161
|
+
cloud_watch_enabled: true
|
162
|
+
resurrector_enabled: true
|
163
|
+
<% if ENV['BOSH_DATADOG_API_KEY'] && ENV['BOSH_DATADOG_APP_KEY'] %>
|
164
|
+
datadog_enabled: true
|
165
|
+
datadog:
|
166
|
+
api_key: <%= ENV['BOSH_DATADOG_API_KEY'] %>
|
167
|
+
application_key: <%= ENV['BOSH_DATADOG_APP_KEY'] %>
|
168
|
+
<% end %>
|
169
|
+
|
170
|
+
registry:
|
171
|
+
address: 10.10.0.7
|
172
|
+
db: *bosh_db
|
173
|
+
http:
|
174
|
+
port: 25777
|
175
|
+
user: awsreg
|
176
|
+
password: awsreg
|
177
|
+
|
178
|
+
aws:
|
179
|
+
access_key_id: <%= access_key_id %>
|
180
|
+
secret_access_key: <%= secret_access_key %>
|
181
|
+
region: <%= region %>
|
182
|
+
default_key_name: <%= key_pair_name %>
|
183
|
+
ec2_endpoint: ec2.<%= region %>.amazonaws.com
|
184
|
+
default_security_groups: ["bosh"]
|
185
|
+
|
186
|
+
dns:
|
187
|
+
address: 10.10.0.7
|
188
|
+
db: *bosh_db
|
189
|
+
recursor: 208.67.220.220
|
190
|
+
|
191
|
+
<% if compiled_package_cache? %>
|
192
|
+
compiled_package_cache:
|
193
|
+
provider: s3
|
194
|
+
options:
|
195
|
+
access_key_id: <%= cache_access_key_id %>
|
196
|
+
secret_access_key: <%= cache_secret_access_key %>
|
197
|
+
bucket_name: <%= cache_bucket_name %>
|
198
|
+
<% end %>
|
@@ -0,0 +1,82 @@
|
|
1
|
+
---
|
2
|
+
name: micro-<%= name %>
|
3
|
+
|
4
|
+
logging:
|
5
|
+
level: DEBUG
|
6
|
+
|
7
|
+
network:
|
8
|
+
type: manual
|
9
|
+
vip: <%= vip %>
|
10
|
+
ip: 10.10.0.6
|
11
|
+
dns:
|
12
|
+
- 10.10.0.2
|
13
|
+
cloud_properties:
|
14
|
+
subnet: <%= subnet %>
|
15
|
+
|
16
|
+
resources:
|
17
|
+
persistent_disk: 20000
|
18
|
+
cloud_properties:
|
19
|
+
instance_type: m1.small
|
20
|
+
availability_zone: <%= availability_zone %>
|
21
|
+
|
22
|
+
cloud:
|
23
|
+
plugin: aws
|
24
|
+
properties:
|
25
|
+
aws:
|
26
|
+
access_key_id: <%= access_key_id %>
|
27
|
+
secret_access_key: <%= secret_access_key %>
|
28
|
+
default_key_name: <%= key_pair_name %>
|
29
|
+
default_security_groups: ["bosh"]
|
30
|
+
region: <%= region %>
|
31
|
+
ec2_private_key: <%= private_key_path %>
|
32
|
+
agent:
|
33
|
+
ntp:
|
34
|
+
- 0.north-america.pool.ntp.org
|
35
|
+
- 1.north-america.pool.ntp.org
|
36
|
+
- 2.north-america.pool.ntp.org
|
37
|
+
- 3.north-america.pool.ntp.org
|
38
|
+
|
39
|
+
apply_spec:
|
40
|
+
agent:
|
41
|
+
blobstore:
|
42
|
+
address: 10.10.0.6
|
43
|
+
nats:
|
44
|
+
address: 10.10.0.6
|
45
|
+
properties:
|
46
|
+
ntp:
|
47
|
+
- 0.north-america.pool.ntp.org
|
48
|
+
- 1.north-america.pool.ntp.org
|
49
|
+
- 2.north-america.pool.ntp.org
|
50
|
+
- 3.north-america.pool.ntp.org
|
51
|
+
registry:
|
52
|
+
address: 10.10.0.6
|
53
|
+
dns:
|
54
|
+
recursor: 208.67.220.220
|
55
|
+
hm:
|
56
|
+
resurrector_enabled: true
|
57
|
+
director_account:
|
58
|
+
user: <%= hm_director_user %>
|
59
|
+
password: <%= hm_director_password %>
|
60
|
+
aws:
|
61
|
+
access_key_id: <%= access_key_id %>
|
62
|
+
secret_access_key: <%= secret_access_key %>
|
63
|
+
default_key_name: <%= key_pair_name %>
|
64
|
+
default_security_groups: ["bosh"]
|
65
|
+
ec2_endpoint: ec2.<%= region %>.amazonaws.com
|
66
|
+
region: <%= region %>
|
67
|
+
<% if compiled_package_cache? %>
|
68
|
+
compiled_package_cache:
|
69
|
+
provider: s3
|
70
|
+
options:
|
71
|
+
access_key_id: <%= cache_access_key_id %>
|
72
|
+
secret_access_key: <%= cache_secret_access_key %>
|
73
|
+
bucket_name: <%= cache_bucket_name %>
|
74
|
+
<% end %>
|
75
|
+
director:
|
76
|
+
enable_snapshots: true
|
77
|
+
ssl:
|
78
|
+
key: |
|
79
|
+
<%= director_ssl_key %>
|
80
|
+
cert: |
|
81
|
+
<%= director_ssl_cert %>
|
82
|
+
|