bosh_cli_plugin_redis 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog.md +7 -4
- data/README.md +11 -5
- data/bosh_cli_plugin_redis.gemspec +1 -1
- data/bosh_release/templates/aws/sample_deployment_file.yml +2 -0
- data/bosh_release/templates/aws/single_vm.yml.erb +3 -0
- data/bosh_release/templates/aws/spec +2 -1
- data/bosh_release/templates/openstack/sample_deployment_file.yml +1 -0
- data/bosh_release/templates/openstack/single_vm.yml.erb +3 -0
- data/bosh_release/templates/openstack/spec +2 -1
- data/lib/bosh/cli/commands/redis.rb +11 -2
- metadata +3 -3
data/ChangeLog.md
CHANGED
@@ -8,11 +8,13 @@ Converted into a bosh plugin. Prefix "bosh" to the sub-commands below:
|
|
8
8
|
prepare redis
|
9
9
|
Prepare bosh for deploying one or more Redis services
|
10
10
|
|
11
|
-
create redis [--name] [--size] [--
|
11
|
+
create redis [--name redis-<timestamp>] [--size small] [--disk 4096]
|
12
|
+
[--security-group default]
|
12
13
|
Create a Redis service deployed upon target bosh
|
13
|
-
--name
|
14
|
-
--size
|
15
|
-
--
|
14
|
+
--name redis-<timestamp> Unique bosh deployment name
|
15
|
+
--size small Size of provisioned VMs
|
16
|
+
--disk 4096 Size of persistent disk (Mb)
|
17
|
+
--security-group default Security group to assign to provisioned VMs
|
16
18
|
|
17
19
|
show redis uri
|
18
20
|
Show the redis URI for connection via bosh DNS
|
@@ -25,6 +27,7 @@ Note: the `cf bind-redis-env-var` command has been removed as it is a) specific
|
|
25
27
|
Other features/fixes:
|
26
28
|
|
27
29
|
* Validates the resource size with available sizes in the template [v0.2.1]
|
30
|
+
* `bosh create redis --disk 10000` to disk persistent disk size (Mb) [v0.2.2]
|
28
31
|
|
29
32
|
## v0.1 - redis-cf-plugin
|
30
33
|
|
data/README.md
CHANGED
@@ -55,11 +55,17 @@ Uploading new redis release to bosh...
|
|
55
55
|
To create/provision a new redis service you run the following command. By default, it will select the smallest known instance size.
|
56
56
|
|
57
57
|
```
|
58
|
-
$ bosh create redis
|
59
|
-
$ bosh create redis
|
60
|
-
$ bosh create redis
|
61
|
-
$ bosh create redis
|
62
|
-
$ bosh create redis
|
58
|
+
$ bosh create redis
|
59
|
+
$ bosh create redis --size small
|
60
|
+
$ bosh create redis --size medium
|
61
|
+
$ bosh create redis --size large
|
62
|
+
$ bosh create redis --size xlarge
|
63
|
+
```
|
64
|
+
|
65
|
+
By default the redis server is assigned a 4096 Mb persistent volume/disk. To change this value use `--disk`:
|
66
|
+
|
67
|
+
```
|
68
|
+
$ bosh create redis myapp-redis --disk 8192
|
63
69
|
```
|
64
70
|
|
65
71
|
NOTE: By default, the `default` security group is used. It must have port `6379` open.
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |spec|
|
4
4
|
spec.name = "bosh_cli_plugin_redis"
|
5
|
-
spec.version = "0.2.
|
5
|
+
spec.version = "0.2.2"
|
6
6
|
spec.authors = ["Dr Nic Williams"]
|
7
7
|
spec.email = ["drnicwilliams@gmail.com"]
|
8
8
|
spec.description = %q{Create dedicated Redis servers using Bosh}
|
@@ -22,6 +22,7 @@ redis_sg = find("properties.redis.security_group")
|
|
22
22
|
redis_port = 6379
|
23
23
|
redis_password = random_string 12, :redis
|
24
24
|
redis_resource = find("properties.redis.resource")
|
25
|
+
redis_persistent_disk = find("properties.redis.persistent_disk")
|
25
26
|
-%>
|
26
27
|
name: <%= find("name") %>
|
27
28
|
director_uuid: <%= find("director_uuid") %>
|
@@ -98,10 +99,12 @@ jobs:
|
|
98
99
|
default:
|
99
100
|
- dns
|
100
101
|
- gateway
|
102
|
+
persistent_disk: <%= redis_persistent_disk %>
|
101
103
|
|
102
104
|
properties:
|
103
105
|
redis:
|
104
106
|
resource: <%= redis_resource %>
|
105
107
|
security_group: <%= redis_sg %>
|
108
|
+
persistent_disk: <%= redis_persistent_disk %>
|
106
109
|
port: <%= redis_port %>
|
107
110
|
password: <%= redis_password %>
|
@@ -10,4 +10,5 @@ properties:
|
|
10
10
|
description: Resource/flavor of instance to use
|
11
11
|
- name: redis.security_group
|
12
12
|
description: Security group for instance(s). Must have TCP ports 22 & 6379 open.
|
13
|
-
|
13
|
+
- name: redis.persistent_disk
|
14
|
+
description: Size of persistent disk for servers
|
@@ -22,6 +22,7 @@ redis_sg = find("properties.redis.security_group")
|
|
22
22
|
redis_port = 6379
|
23
23
|
redis_password = random_string 12, :redis
|
24
24
|
redis_resource = find("properties.redis.resource")
|
25
|
+
redis_persistent_disk = find("properties.redis.persistent_disk")
|
25
26
|
-%>
|
26
27
|
name: <%= find("name") %>
|
27
28
|
director_uuid: <%= find("director_uuid") %>
|
@@ -98,10 +99,12 @@ jobs:
|
|
98
99
|
default:
|
99
100
|
- dns
|
100
101
|
- gateway
|
102
|
+
persistent_disk: <%= redis_persistent_disk %>
|
101
103
|
|
102
104
|
properties:
|
103
105
|
redis:
|
104
106
|
resource: <%= redis_resource %>
|
105
107
|
security_group: <%= redis_sg %>
|
108
|
+
persistent_disk: <%= redis_persistent_disk %>
|
106
109
|
port: <%= redis_port %>
|
107
110
|
password: <%= redis_password %>
|
@@ -10,4 +10,5 @@ properties:
|
|
10
10
|
description: Resource/flavor of instance to use
|
11
11
|
- name: redis.security_group
|
12
12
|
description: Security group for instance(s). Must have TCP ports 22 & 6379 open.
|
13
|
-
|
13
|
+
- name: redis.persistent_disk
|
14
|
+
description: Size of persistent disk for servers
|
@@ -53,24 +53,27 @@ module Bosh::Cli::Command
|
|
53
53
|
desc "Create a Redis service deployed upon target bosh"
|
54
54
|
option "--name redis-<timestamp>", String, "Unique bosh deployment name"
|
55
55
|
option "--size small", String, "Size of provisioned VMs"
|
56
|
+
option "--disk 4096", Integer, "Size of persistent disk (Mb)"
|
56
57
|
option "--security-group default", String, "Security group to assign to provisioned VMs"
|
57
58
|
def create_redis
|
58
59
|
auth_required
|
59
60
|
|
60
61
|
service_name = options[:name] || default_name
|
61
62
|
resource_size = options[:size] || default_size
|
63
|
+
persistent_disk = options[:disk] || default_persistent_disk
|
62
64
|
security_group = options[:security_group] || default_security_group
|
63
65
|
redis_port = 6379
|
64
66
|
|
65
67
|
bosh_status # preload
|
66
68
|
nl
|
67
|
-
say "CPI: #{bosh_cpi}"
|
69
|
+
say "CPI: #{bosh_cpi.make_green}"
|
68
70
|
say "Deployment name: #{service_name.make_green}"
|
69
71
|
say "Resource size: #{validated_resource_size_colored(resource_size)}"
|
72
|
+
say "Persistent disk: #{persistent_disk.to_s.make_green}"
|
70
73
|
say "Security group: #{security_group.make_green}"
|
71
74
|
nl
|
72
75
|
|
73
|
-
step("Validating resource size", "Resource size must be in #{available_resource_sizes.join(', ')}", :
|
76
|
+
step("Validating resource size", "Resource size must be in #{available_resource_sizes.join(', ')}", :non_fatal) do
|
74
77
|
available_resource_sizes.include?(resource_size)
|
75
78
|
end
|
76
79
|
|
@@ -81,6 +84,8 @@ module Bosh::Cli::Command
|
|
81
84
|
cancel_deployment
|
82
85
|
end
|
83
86
|
|
87
|
+
raise Bosh::Cli::ValidationHalted unless errors.empty?
|
88
|
+
|
84
89
|
template_file = template_file("single_vm.yml.erb")
|
85
90
|
|
86
91
|
# Create an initial deployment file; upon which the CPI-specific template will be applied below
|
@@ -154,6 +159,10 @@ module Bosh::Cli::Command
|
|
154
159
|
"small"
|
155
160
|
end
|
156
161
|
|
162
|
+
def default_persistent_disk
|
163
|
+
4096
|
164
|
+
end
|
165
|
+
|
157
166
|
def default_security_group
|
158
167
|
"default"
|
159
168
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bosh_cli_plugin_redis
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -104,7 +104,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
104
|
version: '0'
|
105
105
|
segments:
|
106
106
|
- 0
|
107
|
-
hash: -
|
107
|
+
hash: -4483315635940311713
|
108
108
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
109
|
none: false
|
110
110
|
requirements:
|
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
113
|
version: '0'
|
114
114
|
segments:
|
115
115
|
- 0
|
116
|
-
hash: -
|
116
|
+
hash: -4483315635940311713
|
117
117
|
requirements: []
|
118
118
|
rubyforge_project:
|
119
119
|
rubygems_version: 1.8.25
|