seira 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 75b53632541063c8bd33733ac62c7a668191b47f069eff4e63e6380459c9869e
4
- data.tar.gz: b1bce085818c5f3686009026eafbb8093def1508de90ab632e928fbde3ca3e10
3
+ metadata.gz: 87fa02469006bc2145037e07818f61879777d8345c5a5270f2d8faad32640599
4
+ data.tar.gz: 57b21d9c6f6507afe943fba5519ca0f118207c0d5844d544a529e6c26d3d4d00
5
5
  SHA512:
6
- metadata.gz: 2cbf59bce9f817597cf68954e0962ad1fbe403521016bc458da371ff464c2995f6294d295b74eb38d8b49bf11088a168818f205300443ab21e8012a5835ac132
7
- data.tar.gz: f3eff8d111e66c49b51ce6beeab4d4c3d2acbc51bf1b95863e19e1ec774bf030a8c2f6971bea00bc97aaaffc8f0a52097ef0a15e484982cef325c18711d6a440
6
+ metadata.gz: 04e53ae6f602a47299d4829ec25dde2adf76b201f888130c8f5fc686da4167ee32682090029dbb9b1cdde60438e51dd95d162455a4aec9bf002cad3f079bfc5b
7
+ data.tar.gz: 7187058bc0a2d9406469bebf44b351346acd0164d7cd59b6895f08e5658a9f957fd168543ae0a98496206d3014f10cc7e20a9b82e55a25145ee72fedc80d80e3
data/lib/seira/app.rb CHANGED
@@ -68,8 +68,6 @@ module Seira
68
68
  # Create namespace before anything else
69
69
  kubectl("apply -f kubernetes/#{context[:cluster]}/#{app}/00-namespace.yaml", context: context)
70
70
  bootstrap_main_secret
71
- bootstrap_cloudsql_secret
72
- bootstrap_gcr_secret
73
71
 
74
72
  puts "Successfully installed"
75
73
  end
@@ -184,20 +182,6 @@ module Seira
184
182
  kubectl("create secret generic #{main_secret_name} --from-literal=RAILS_ENV=#{rails_env} --from-literal=RACK_ENV=#{rails_env}", context: context)
185
183
  end
186
184
 
187
- # We use a secret in our container to use a service account to connect to our cloudsql databases. The secret in 'default'
188
- # namespace can't be used in this namespace, so copy it over to our namespace.
189
- def bootstrap_gcr_secret
190
- secrets = Seira::Secrets.new(app: app, action: action, args: args, context: context)
191
- secrets.copy_secret_across_namespace(key: 'gcr-secret', from: 'default', to: app)
192
- end
193
-
194
- # We use a secret in our container to use a service account to connect to our docker registry. The secret in 'default'
195
- # namespace can't be used in this namespace, so copy it over to our namespace.
196
- def bootstrap_cloudsql_secret
197
- secrets = Seira::Secrets.new(app: app, action: action, args: args, context: context)
198
- secrets.copy_secret_across_namespace(key: 'cloudsql-credentials', from: 'default', to: app)
199
- end
200
-
201
185
  def find_and_replace_revision(source:, destination:, replacement_hash:)
202
186
  puts "Copying source yaml from #{source} to temp folder"
203
187
  FileUtils.mkdir_p destination # Create the nested directory
data/lib/seira/cluster.rb CHANGED
@@ -7,7 +7,7 @@ module Seira
7
7
  class Cluster
8
8
  include Seira::Commands
9
9
 
10
- VALID_ACTIONS = %w[help bootstrap upgrade-master].freeze
10
+ VALID_ACTIONS = %w[help upgrade-master].freeze
11
11
  SUMMARY = "For managing whole clusters.".freeze
12
12
 
13
13
  attr_reader :action, :args, :context, :settings
@@ -23,8 +23,6 @@ module Seira
23
23
  case action
24
24
  when 'help'
25
25
  run_help
26
- when 'bootstrap'
27
- run_bootstrap
28
26
  when 'upgrade-master'
29
27
  run_upgrade_master
30
28
  else
@@ -65,27 +63,6 @@ module Seira
65
63
 
66
64
  private
67
65
 
68
- # Intended for use when spinning up a whole new cluster. It stores two main secrets
69
- # in the default space that are intended to be copied into individual namespaces when
70
- # new apps are built.
71
- def run_bootstrap
72
- dockercfg_location = args[0]
73
- cloudsql_credentials_location = args[1]
74
-
75
- if dockercfg_location.nil? || dockercfg_location == ''
76
- puts 'Please specify the dockercfg json key location as first param.'
77
- exit(1)
78
- end
79
-
80
- if cloudsql_credentials_location.nil? || cloudsql_credentials_location == ''
81
- puts 'Please specify the cloudsql_credentials_location json key location as second param.'
82
- exit(1)
83
- end
84
-
85
- puts `kubectl create secret docker-registry gcr-secret --docker-username=_json_key --docker-password="$(cat #{dockercfg_location})" --docker-server=https://gcr.io --docker-email=doesnotmatter@example.com`
86
- puts `kubectl create secret generic cloudsql-credentials --namespace default --from-file=credentials.json=#{cloudsql_credentials_location}`
87
- end
88
-
89
66
  def run_upgrade_master
90
67
  cluster = context[:cluster]
91
68
  new_version = args.first
data/lib/seira/pods.rb CHANGED
@@ -95,11 +95,13 @@ module Seira
95
95
  existing_pod
96
96
  elsif dedicated || pod_name.to_s.empty?
97
97
  Helpers.fetch_pods(context: context, filters: { tier: tier || 'terminal' }).sample
98
- else
99
- puts 'Could not find pod to connect to'
100
- exit(1)
101
98
  end
102
99
 
100
+ if target_pod.nil?
101
+ puts 'Could not find pod to connect to'
102
+ exit(1)
103
+ end
104
+
103
105
  if dedicated
104
106
  new_pod = if pod_name.nil?
105
107
  create_dedicated_pod(target_pod)
data/lib/seira/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Seira
2
- VERSION = "0.5.0".freeze
2
+ VERSION = "0.5.1".freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: seira
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Scott Ringwelski
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-10-26 00:00:00.000000000 Z
11
+ date: 2018-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: highline