bosh-cloudfoundry 0.7.0.alpha.9 → 0.7.0.alpha.10

Sign up to get free protection for your applications and to get access to all the features.
data/ChangeLog.md CHANGED
@@ -19,5 +19,6 @@ The rewrite introduces some new implementation/feature concepts:
19
19
  * templates are versioned for each final release (unless new templates not required for new release)
20
20
  * different sizes of deployments (orders of magnitude), such as small, medium & large: `bosh create cf --deployment-size large`
21
21
  * mutable/changable properties (and immutable properties) for each template version: `bosh change cf attributes persistent_disk=8192`
22
+ * can initially use public http://xip.io for DNS and change to custom DNS later: `bosh change cf attributes dns=cf.mycloud.com`
22
23
 
23
24
  The latter means that new versions of this rubygem can be published that are backwards compatible with aging deployments of Cloud Foundry. There should not be any forced coupling of old `bosh-cloudfoundry` to old `cf-release` final releases.
data/README.md CHANGED
@@ -6,7 +6,7 @@ Example create/scale/delete scenario:
6
6
 
7
7
  ```
8
8
  $ bosh prepare cf
9
- $ bosh create cf --dns mycloud.com --public-ip 1.2.3.4
9
+ $ bosh create cf --public-ip 1.2.3.4
10
10
  ...
11
11
  $ bosh change cf attributes persistent_disk=8192
12
12
  ...
@@ -106,12 +106,22 @@ Uploading new cf release to bosh...
106
106
  To create/provision a new Cloud Foundry you run the following command. By default, it will select the smallest possible deployment size.
107
107
 
108
108
  ```
109
- $ bosh create cf --dns mycloud.com --public-ip 1.2.3.4
110
- $ bosh create cf --dns mycloud.com --public-ip 1.2.3.4 --size medium
111
- $ bosh create cf --dns mycloud.com --public-ip 1.2.3.4 --size large
112
- $ bosh create cf --dns mycloud.com --public-ip 1.2.3.4 --size xlarge
109
+ $ bosh create cf --public-ip 1.2.3.4
110
+ $ bosh create cf --public-ip 1.2.3.4 --size medium
111
+ $ bosh create cf --public-ip 1.2.3.4 --size large
112
+ $ bosh create cf --public-ip 1.2.3.4 --size xlarge
113
113
  ```
114
114
 
115
+ It is strongly recommended that you provide your own domain, such as `mycloud.com`. You can purchase and manage your domain through any DNS provider (see below for what needs to be setup), such as [dnsimple.com](https://dnsimple.com/r/af515bc1b6ffc9) (the beloved DNS manager used by Stark & Wayne; as a bonus its an affiliate link so Dr Nic gets free stuff).
116
+
117
+ To specify a domain:
118
+
119
+ ```
120
+ $ bosh create cf --domain mycloud.com --public-ip 1.2.3.4
121
+ ```
122
+
123
+ By default, it will configure you to use http://xip.io (a lovely service sponsored by 37signals). You root domain will be `1.2.3.4.xip.io` (where `1.2.3.4` is your IP address).
124
+
115
125
  By default the core Cloud Foundry server is assigned a 4096 Mb persistent volume/disk. This can be changed later as your Cloud Foundry deployment grows.
116
126
 
117
127
  NOTE: By default, the `default` security group is used.
@@ -154,6 +164,22 @@ $ bosh change cf attributes persistent_disk=8192
154
164
 
155
165
  The initial size of persistent disks is `4096` (4Gb).
156
166
 
167
+ ## DNS
168
+
169
+ It is strongly suggested to provide a custom DNS (rather than rely on the free http://xip.io service) as the default DNS for all your applications (including the public API "cloud controller").
170
+
171
+ You can use the root domain (such as `mycloud.com`) or a subdomain (such as `cf.mycloud.com`).
172
+
173
+ If you use the [dnsimple.com](https://dnsimple.com/r/af515bc1b6ffc9) service (the beloved DNS manager used by Stark & Wayne; as a bonus it is an affiliate link so Dr Nic gets free stuff) then you will set up your DNS as follows:
174
+
175
+ <a href="https://dnsimple.com/r/af515bc1b6ffc9"><img src=https://www.evernote.com/shard/s3/sh/a5d22b7e-efef-4c4d-abf6-bac0d343f260/21a09151a6da40e189db349107e6baf0/deep/0/drniccloud.com%20Records%20-%20DNSimple.png /></a>
176
+
177
+ If you have already deployed Cloud Foundry using the default xip.io DNS service, you can upgrade your Cloud Foundry deployment to use your new custom DNS:
178
+
179
+ ```
180
+ $ bosh change cf attributes dns=cf.mycloud.com
181
+ ```
182
+
157
183
  ## Releasing new plugin gem versions
158
184
 
159
185
  There are two reasons to release new versions of this plugin.
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |spec|
4
4
  spec.name = "bosh-cloudfoundry"
5
- spec.version = "0.7.0.alpha.9"
5
+ spec.version = "0.7.0.alpha.10"
6
6
  spec.authors = ["Dr Nic Williams"]
7
7
  spec.email = ["drnicwilliams@gmail.com"]
8
8
  spec.description = %q{Create & manage Cloud Foundry deployments}
@@ -26,11 +26,8 @@ module Bosh::Cli::Command
26
26
  err("Only one IP address is supported currently. Please create an issue to mention you need more.") if ip_addresses.size > 1
27
27
  attrs.set(:ip_addresses, ip_addresses)
28
28
 
29
- dns = options[:dns]
30
- err("USAGE: bosh create cf --dns mycloud.com -- please provide a base DNS that has a '*' A record referencing IPs") unless dns
31
- attrs.set(:dns, dns)
32
-
33
29
  attrs.set_unless_nil(:name, options[:name])
30
+ attrs.set_unless_nil(:dns, options[:dns])
34
31
  attrs.set_unless_nil(:persistent_disk, options[:disk])
35
32
  attrs.set_unless_nil(:security_group, options[:security_group])
36
33
  attrs.set_unless_nil(:common_password, options[:common_password])
@@ -72,11 +72,16 @@ module Bosh::Cloudfoundry
72
72
 
73
73
  def set(attribute, value)
74
74
  attributes[attribute.to_sym] = value
75
+
76
+ case attribute.to_sym
77
+ when :ip_addresses
78
+ set_default_dns
79
+ end
75
80
  end
76
81
 
77
82
  def set_mutable(attribute, value)
78
83
  if mutable_attribute?(attribute)
79
- attributes[attribute.to_sym] = value
84
+ set(attribute, value)
80
85
  else
81
86
  false
82
87
  end
@@ -186,6 +191,13 @@ module Bosh::Cloudfoundry
186
191
  "default"
187
192
  end
188
193
 
194
+ def set_default_dns
195
+ if dns.nil?
196
+ first_ip_address = ip_addresses.first
197
+ set(:dns, "#{first_ip_address}.xip.io")
198
+ end
199
+ end
200
+
189
201
  def bosh_uuid
190
202
  @bosh_status["uuid"]
191
203
  end
@@ -19,7 +19,6 @@ describe Bosh::Cli::Command::CloudFoundry do
19
19
  # immutable attributes (determined via ReleaseVersion via templates/vXYZ/spec)
20
20
  "name" => "demo",
21
21
  "deployment_size" => "medium",
22
- "dns" => "mycloud.com",
23
22
  "common_password" => "qwerty",
24
23
  # mutable attributes (determined via ReleaseVersion via templates/vXYZ/spec)
25
24
  "ip_addresses" => ["1.2.3.4"],
@@ -49,24 +48,18 @@ describe Bosh::Cli::Command::CloudFoundry do
49
48
  director.stub(:get_status).and_return({"uuid" => "UUID", "cpi" => "aws"})
50
49
  command.stub(:director).and_return(director)
51
50
  end
51
+
52
52
  it "requires --ip 1.2.3.4" do
53
53
  command.add_option(:dns, "mycloud.com")
54
54
  command.add_option(:size, "xlarge")
55
55
  expect { command.create_cf }.to raise_error(Bosh::Cli::CliError)
56
56
  end
57
-
58
- it "requires --dns" do
59
- command.add_option(:ip, ["1.2.3.4"])
60
- command.add_option(:size, "xlarge")
61
- expect { command.create_cf }.to raise_error(Bosh::Cli::CliError)
62
- end
63
57
  end
64
58
 
65
59
  context "with requirements" do
66
60
  it "creates cf deployment" do
67
61
  command.add_option(:name, "demo")
68
62
  command.add_option(:ip, ["1.2.3.4"])
69
- command.add_option(:dns, "mycloud.com")
70
63
  command.add_option(:common_password, "qwertyasdfgh")
71
64
 
72
65
  command.should_receive(:auth_required)
@@ -84,7 +77,6 @@ describe Bosh::Cli::Command::CloudFoundry do
84
77
 
85
78
  command.create_cf
86
79
  end
87
-
88
80
  end
89
81
  end
90
82
 
@@ -13,6 +13,24 @@ describe Bosh::Cloudfoundry::DeploymentAttributes do
13
13
  it { subject.common_password.should == "qwertyqwerty" }
14
14
  end
15
15
 
16
+ context "delayed default values" do
17
+ subject { Bosh::Cloudfoundry::DeploymentAttributes.new(director, bosh_status, release_version_cpi) }
18
+ it "dns nil default until ip_addresses set" do
19
+ subject.dns.should be_nil
20
+ end
21
+
22
+ it "dns defaults to FIRST_IP_ADDRESS.xip.io if ip_addresses has 1+ addresses" do
23
+ subject.set(:ip_addresses, ["1.2.3.4"])
24
+ subject.dns.should == "1.2.3.4.xip.io"
25
+ end
26
+
27
+ it "dns has custom value if set" do
28
+ subject.set(:ip_addresses, ["1.2.3.4"])
29
+ subject.set(:dns, "mycloud.com")
30
+ subject.dns.should == "mycloud.com"
31
+ end
32
+ end
33
+
16
34
  context "attributes" do
17
35
  it "returns default attributes" do
18
36
  subject = Bosh::Cloudfoundry::DeploymentAttributes.new(director, bosh_status, release_version_cpi)
data/templates/v132/spec CHANGED
@@ -7,8 +7,8 @@ mutable_attributes:
7
7
  - ip_addresses
8
8
  - persistent_disk
9
9
  - security_group
10
+ - dns
10
11
  immutable_attributes:
11
12
  - common_password
12
13
  - deployment_size
13
- - dns
14
14
  - name
data/templates/v133/spec CHANGED
@@ -7,8 +7,8 @@ mutable_attributes:
7
7
  - ip_addresses
8
8
  - persistent_disk
9
9
  - security_group
10
+ - dns
10
11
  immutable_attributes:
11
12
  - common_password
12
13
  - deployment_size
13
- - dns
14
14
  - name
data/templates/v134/spec CHANGED
@@ -7,8 +7,8 @@ mutable_attributes:
7
7
  - ip_addresses
8
8
  - persistent_disk
9
9
  - security_group
10
+ - dns
10
11
  immutable_attributes:
11
12
  - common_password
12
13
  - deployment_size
13
- - dns
14
14
  - name
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bosh-cloudfoundry
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0.alpha.9
4
+ version: 0.7.0.alpha.10
5
5
  prerelease: 6
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-20 00:00:00.000000000 Z
12
+ date: 2013-07-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bosh_cli
@@ -513,7 +513,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
513
513
  version: '0'
514
514
  segments:
515
515
  - 0
516
- hash: -2813545994719294893
516
+ hash: 1135814561112793357
517
517
  required_rubygems_version: !ruby/object:Gem::Requirement
518
518
  none: false
519
519
  requirements: