kontena-cli 0.11.1 → 0.11.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8d2886c09f3faeaa711f9fb89e078cd06dd9b035
4
- data.tar.gz: 0c012c5a9c66d1f600f74ec65d477395cd394e0b
3
+ metadata.gz: 1f305f0ca1c6bc181e196a563c5ed94a655730c2
4
+ data.tar.gz: 88fc9e71efb97c60f88177f6b92f59698f721cc0
5
5
  SHA512:
6
- metadata.gz: 9799fc52f4c464b8f9adea3e77abe4d4bafb00fadbd205643ab32015c2711010650ac559fe37c275327d4b2a86e48304dad1e09d557d8670750306b85b86fa64
7
- data.tar.gz: 311c7b76896963a5d1aca5d17d8c460da41b660377d9914e20e48ea1b712d837c1c4dd450480a3858d949f37ddcac73e07e4f02250bfa00751357a04e62dd615
6
+ metadata.gz: 7ac41e08e835a3e08d39ce84f7a0449fa0caff81d848583c407d27d29c9afbd9689f0e71224f81a31fdaad7e6be05f3aa5f6da6e6928b3b02c4890c13315220d
7
+ data.tar.gz: d0743250c47ac3299ec47de4b368f14b2bf8d47ff5f0fa027d8f32bf2dab182b5e6dd4d61f8a05940614ad8509c5d357b307e2256820586dc5550463fb78f132
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.11.1
1
+ 0.11.2
@@ -20,8 +20,12 @@ module Kontena::Cli::Grids
20
20
  abort("Grid not found".colorize(:red)) unless grid
21
21
 
22
22
  prefix = export? ? 'export ' : ''
23
- puts "#{prefix}KONTENA_URI=#{settings['server']['url'].sub('http', 'ws')}"
24
- puts "#{prefix}KONTENA_TOKEN=#{grid['token']}"
23
+
24
+ server = settings['servers'].find{|s| s['name'] == settings['current_server']}
25
+ if server
26
+ puts "#{prefix}KONTENA_URI=#{server['url'].sub('http', 'ws')}"
27
+ puts "#{prefix}KONTENA_TOKEN=#{server['token']}"
28
+ end
25
29
  end
26
30
  end
27
31
  end
@@ -29,8 +29,6 @@ write_files:
29
29
  -e SSL_CERT="$SSL_CERT" \
30
30
  -p 80:80 -p 443:443 kontena/haproxy:latest
31
31
  coreos:
32
- update:
33
- reboot-strategy: off
34
32
  units:
35
33
  - name: kontena-server-mongo.service
36
34
  command: start
@@ -70,6 +68,8 @@ coreos:
70
68
  Requires=network-online.target
71
69
  Requires=docker.service
72
70
  Requires=kontena-server-mongo.service
71
+ Before=kontena-server-haproxy.service
72
+ Wants=kontena-server-haproxy.service
73
73
 
74
74
  [Service]
75
75
  Restart=always
@@ -97,6 +97,7 @@ coreos:
97
97
  Documentation=http://www.kontena.io/
98
98
  Requires=network-online.target
99
99
  Requires=docker.service
100
+ Requires=kontena-server-api.service
100
101
 
101
102
  [Service]
102
103
  Restart=always
@@ -0,0 +1,27 @@
1
+ module Kontena
2
+ module Machine
3
+ module Aws
4
+ module Common
5
+
6
+ # @param [String] region
7
+ # @return String
8
+ def resolve_ami(region)
9
+ images = {
10
+ 'eu-central-1' => 'ami-fee2fb92',
11
+ 'ap-northeast-1' => 'ami-26033d48',
12
+ 'us-gov-west-1' => 'ami-bdf04cdc',
13
+ 'sa-east-1' => 'ami-10c5457c',
14
+ 'ap-southeast-2' => 'ami-dc8baebf',
15
+ 'ap-southeast-1' => 'ami-6969a50a',
16
+ 'us-east-1' => 'ami-23260749',
17
+ 'us-west-2' => 'ami-20927640',
18
+ 'us-west-1' => 'ami-c2e490a2',
19
+ 'eu-west-1' => 'ami-7e72c70d'
20
+ }
21
+ images[region]
22
+ end
23
+
24
+ end
25
+ end
26
+ end
27
+ end
@@ -2,20 +2,26 @@ require 'fileutils'
2
2
  require 'erb'
3
3
  require 'open3'
4
4
  require 'shell-spinner'
5
+ require_relative 'common'
5
6
 
6
7
  module Kontena
7
8
  module Machine
8
9
  module Aws
9
10
  class MasterProvisioner
10
11
  include RandomName
12
+ include Common
11
13
  attr_reader :client, :http_client, :region
12
14
 
13
15
  # @param [String] access_key_id aws_access_key_id
14
16
  # @param [String] secret_key aws_secret_access_key
15
17
  # @param [String] region
16
18
  def initialize(access_key_id, secret_key, region)
17
- @client = Fog::Compute.new(:provider => 'AWS', :aws_access_key_id => access_key_id, :aws_secret_access_key => secret_key, :region => region)
18
-
19
+ @client = Fog::Compute.new(
20
+ :provider => 'AWS',
21
+ :aws_access_key_id => access_key_id,
22
+ :aws_secret_access_key => secret_key,
23
+ :region => region
24
+ )
19
25
  end
20
26
 
21
27
  # @param [Hash] opts
@@ -112,25 +118,6 @@ module Kontena
112
118
  security_group
113
119
  end
114
120
 
115
- # @param [String] region
116
- # @return String
117
- def resolve_ami(region)
118
- images = {
119
- 'eu-central-1' => 'ami-74bbba69',
120
- 'ap-northeast-1' => 'ami-1e77ff1e',
121
- 'us-gov-west-1' => 'ami-f1d1b2d2',
122
- 'sa-east-1' => 'ami-632ba17e',
123
- 'ap-southeast-2' => 'ami-83f8b4b9',
124
- 'ap-southeast-1' => 'ami-12060c40',
125
- 'us-east-1' => 'ami-f396fa96',
126
- 'us-west-2' => 'ami-99bfada9',
127
- 'us-west-1' => 'ami-dbe71d9f',
128
- 'eu-west-1' => 'ami-83e9c8f4'
129
- }
130
- images[region]
131
- end
132
-
133
-
134
121
  def default_subnet(vpc, zone)
135
122
  client.subnets.all('vpc-id' => vpc, 'availabilityZone' => zone).first
136
123
  end
@@ -160,4 +147,4 @@ module Kontena
160
147
  end
161
148
  end
162
149
  end
163
- end
150
+ end
@@ -2,12 +2,14 @@ require 'fileutils'
2
2
  require 'erb'
3
3
  require 'open3'
4
4
  require 'shell-spinner'
5
+ require_relative 'common'
5
6
 
6
7
  module Kontena
7
8
  module Machine
8
9
  module Aws
9
10
  class NodeProvisioner
10
11
  include RandomName
12
+ include Common
11
13
 
12
14
  attr_reader :client, :api_client, :region
13
15
 
@@ -17,8 +19,10 @@ module Kontena
17
19
  # @param [String] region
18
20
  def initialize(api_client, access_key_id, secret_key, region)
19
21
  @api_client = api_client
20
- @client = Fog::Compute.new(:provider => 'AWS', :aws_access_key_id => access_key_id, :aws_secret_access_key => secret_key, :region => region)
21
-
22
+ @client = Fog::Compute.new(
23
+ :provider => 'AWS', :aws_access_key_id => access_key_id,
24
+ :aws_secret_access_key => secret_key, :region => region
25
+ )
22
26
  end
23
27
 
24
28
  # @param [Hash] opts
@@ -70,7 +74,7 @@ module Kontena
70
74
  ShellSpinner "Creating AWS instance #{name.colorize(:cyan)} " do
71
75
  instance.wait_for { ready? }
72
76
  end
73
- client.create_tags(instance.id, {'kontena_name' => name, 'kontena_grid' => opts[:grid]})
77
+ client.create_tags(instance.id, {'Name' => name, 'kontena_grid' => opts[:grid]})
74
78
  node = nil
75
79
  ShellSpinner "Waiting for node #{name.colorize(:cyan)} join to grid #{opts[:grid].colorize(:cyan)} " do
76
80
  sleep 2 until node = instance_exists_in_grid?(opts[:grid], name)
@@ -103,30 +107,12 @@ module Kontena
103
107
  security_group.authorize_port_range(80..80)
104
108
  security_group.authorize_port_range(443..443)
105
109
  security_group.authorize_port_range(22..22)
110
+ security_group.authorize_port_range(1194..1194, ip_protocol: 'udp')
106
111
  security_group.authorize_port_range(6783..6783, group: {security_group.owner_id => security_group.group_id}, ip_protocol: 'tcp')
107
- security_group.authorize_port_range(6783..6783, group: {security_group.owner_id => security_group.group_id}, ip_protocol: 'udp')
112
+ security_group.authorize_port_range(6783..6784, group: {security_group.owner_id => security_group.group_id}, ip_protocol: 'udp')
108
113
  security_group
109
114
  end
110
115
 
111
-
112
- # @param [String] region
113
- # @return String
114
- def resolve_ami(region)
115
- images = {
116
- 'eu-central-1' => 'ami-74bbba69',
117
- 'ap-northeast-1' => 'ami-1e77ff1e',
118
- 'us-gov-west-1' => 'ami-f1d1b2d2',
119
- 'sa-east-1' => 'ami-632ba17e',
120
- 'ap-southeast-2' => 'ami-83f8b4b9',
121
- 'ap-southeast-1' => 'ami-12060c40',
122
- 'us-east-1' => 'ami-f396fa96',
123
- 'us-west-2' => 'ami-99bfada9',
124
- 'us-west-1' => 'ami-dbe71d9f',
125
- 'eu-west-1' => 'ami-83e9c8f4'
126
- }
127
- images[region]
128
- end
129
-
130
116
  def default_subnet(vpc, zone)
131
117
  client.subnets.all('vpc-id' => vpc, 'availabilityZone' => zone).first
132
118
  end
@@ -165,4 +151,4 @@ module Kontena
165
151
  end
166
152
  end
167
153
  end
168
- end
154
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kontena-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.1
4
+ version: 0.11.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kontena, Inc
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-01-16 00:00:00.000000000 Z
11
+ date: 2016-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -261,6 +261,7 @@ files:
261
261
  - lib/kontena/machine/aws.rb
262
262
  - lib/kontena/machine/aws/cloudinit.yml
263
263
  - lib/kontena/machine/aws/cloudinit_master.yml
264
+ - lib/kontena/machine/aws/common.rb
264
265
  - lib/kontena/machine/aws/master_provisioner.rb
265
266
  - lib/kontena/machine/aws/node_destroyer.rb
266
267
  - lib/kontena/machine/aws/node_provisioner.rb