cuber 1.7.0 → 1.9.0

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: 687fb6dcbc68029a3b5f526d40afbea27d7a81c99d0609abeb294175daee01c0
4
- data.tar.gz: 201bef4d047a5bee19fe884414ec90b282f1606a8340cdb5ab6e7be4f6f585f5
3
+ metadata.gz: d5791ce33c71c03935fda3c59aa5b9ee5c5694ae0b3f0c359dc6522078745510
4
+ data.tar.gz: ddf9c67fbd2840334fb15efe4a595dd57200448b85f05943204250a5a1a43e4c
5
5
  SHA512:
6
- metadata.gz: ae0bcb075fe4ebe29f607c01b95de94308bcfb586e12498a5c369ae0162d362d8661581d90bb3b9a4e759f9fe3489ffe5760f203bc98ad4cca7c674405ff4b76
7
- data.tar.gz: 30c8adb2b0ec54586b3402a5b5b9778c2ea4094c5f164e96de01641538dd9808e356e5f481fb18393f4276f614927b8bc81a69a8d308f00f3533416b29834f53
6
+ metadata.gz: a97f170cb22b7e70254991ba0271787904d6578c2d3bbdc4dd5cef474244c0d27d6327ab7abe0c541210a49c0db1dd5744bdb2a0329f0e7ae28e536fa0ecfe3e
7
+ data.tar.gz: 4fb13ed216d12812886944298df382d7162d058d64f7e6e863338f2b8a29fe8feb826972c37f36bdcedb7ce89568a502e9ee340a41470fb3513de4a5f57cd933
data/lib/cuber/cli.rb CHANGED
@@ -27,7 +27,7 @@ module Cuber
27
27
  end
28
28
 
29
29
  def parse_cuberfile
30
- abort 'Cuberfile not found in current directory' unless File.exists? 'Cuberfile'
30
+ abort 'Cuberfile not found in current directory' unless File.exist? 'Cuberfile'
31
31
  content = File.read 'Cuberfile'
32
32
  parser = CuberfileParser.new
33
33
  parser.instance_eval(content)
@@ -98,7 +98,7 @@ module Cuber::Commands
98
98
  schedule = cron['spec']['schedule']
99
99
  command = cron['spec']['jobTemplate']['spec']['template']['spec']['containers'][0]['command'].shelljoin
100
100
  last = cron['status']['lastScheduleTime']
101
- puts "#{name}: #{schedule} #{command} (#{time_ago_in_words last})"
101
+ puts "#{name}: #{schedule} #{command} #{'(' + time_ago_in_words(last) + ')' if last}"
102
102
  end
103
103
  end
104
104
 
@@ -50,7 +50,7 @@ module Cuber
50
50
 
51
51
  def validate_dockerfile
52
52
  return unless @options[:dockerfile]
53
- @errors << 'dockerfile must be a file' unless File.exists? @options[:dockerfile]
53
+ @errors << 'dockerfile must be a file' unless File.exist? @options[:dockerfile]
54
54
  end
55
55
 
56
56
  def validate_image
@@ -64,12 +64,12 @@ module Cuber
64
64
 
65
65
  def validate_dockerconfig
66
66
  return unless @options[:dockerconfig]
67
- @errors << 'dockerconfig must be a file' unless File.exists? @options[:dockerconfig]
67
+ @errors << 'dockerconfig must be a file' unless File.exist? @options[:dockerconfig]
68
68
  end
69
69
 
70
70
  def validate_kubeconfig
71
71
  @errors << 'kubeconfig must be present' if @options[:kubeconfig].to_s.strip.empty?
72
- @errors << 'kubeconfig must be a file' unless File.exists? @options[:kubeconfig]
72
+ @errors << 'kubeconfig must be a file' unless File.exist? @options[:kubeconfig]
73
73
  end
74
74
 
75
75
  def validate_migrate
@@ -123,8 +123,8 @@ module Cuber
123
123
 
124
124
  def validate_ssl
125
125
  return unless @options[:ssl]
126
- @errors << 'ssl crt must be a file' unless File.exists? @options[:ssl][:crt]
127
- @errors << 'ssl key must be a file' unless File.exists? @options[:ssl][:key]
126
+ @errors << 'ssl crt must be a file' unless File.exist? @options[:ssl][:crt]
127
+ @errors << 'ssl key must be a file' unless File.exist? @options[:ssl][:key]
128
128
  end
129
129
 
130
130
  end
@@ -3,9 +3,9 @@ apiVersion: v1
3
3
  metadata:
4
4
  name: <%= @options[:app] %>
5
5
  labels:
6
- app.kubernetes.io/name: <%= @options[:app] %>
7
- app.kubernetes.io/instance: <%= @options[:instance] %>
8
- app.kubernetes.io/version: <%= @options[:release] %>
6
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
7
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
8
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
9
9
  app.kubernetes.io/managed-by: cuber
10
10
  annotations:
11
11
  image: <%= @options[:image].to_s.to_json %>
@@ -19,9 +19,9 @@ metadata:
19
19
  name: regcred
20
20
  namespace: <%= @options[:app] %>
21
21
  labels:
22
- app.kubernetes.io/name: <%= @options[:app] %>
23
- app.kubernetes.io/instance: <%= @options[:instance] %>
24
- app.kubernetes.io/version: <%= @options[:release] %>
22
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
23
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
24
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
25
25
  app.kubernetes.io/managed-by: cuber
26
26
  data:
27
27
  .dockerconfigjson: <%= @options[:dockerconfigjson] %>
@@ -34,9 +34,9 @@ metadata:
34
34
  name: app-secrets
35
35
  namespace: <%= @options[:app] %>
36
36
  labels:
37
- app.kubernetes.io/name: <%= @options[:app] %>
38
- app.kubernetes.io/instance: <%= @options[:instance] %>
39
- app.kubernetes.io/version: <%= @options[:release] %>
37
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
38
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
39
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
40
40
  app.kubernetes.io/managed-by: cuber
41
41
  data:
42
42
  <%- @options[:secrets].each do |key, value| -%>
@@ -50,15 +50,32 @@ metadata:
50
50
  name: env
51
51
  namespace: <%= @options[:app] %>
52
52
  labels:
53
- app.kubernetes.io/name: <%= @options[:app] %>
54
- app.kubernetes.io/instance: <%= @options[:instance] %>
55
- app.kubernetes.io/version: <%= @options[:release] %>
53
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
54
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
55
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
56
56
  app.kubernetes.io/managed-by: cuber
57
57
  data:
58
58
  <%- @options[:env].each do |key, value| -%>
59
59
  <%= key %>: <%= value.to_s.to_json %>
60
60
  <%- end -%>
61
61
 
62
+ ---
63
+ apiVersion: policy/v1
64
+ kind: PodDisruptionBudget
65
+ metadata:
66
+ name: web-pdb
67
+ namespace: <%= @options[:app] %>
68
+ labels:
69
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
70
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
71
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
72
+ app.kubernetes.io/managed-by: cuber
73
+ spec:
74
+ maxUnavailable: "50%"
75
+ selector:
76
+ matchLabels:
77
+ app: web-proc
78
+
62
79
  <%- if @options[:migrate] -%>
63
80
  ---
64
81
  apiVersion: batch/v1
@@ -67,17 +84,17 @@ metadata:
67
84
  name: migrate-<%= @options[:instance] %>
68
85
  namespace: <%= @options[:app] %>
69
86
  labels:
70
- app.kubernetes.io/name: <%= @options[:app] %>
71
- app.kubernetes.io/instance: <%= @options[:instance] %>
72
- app.kubernetes.io/version: <%= @options[:release] %>
87
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
88
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
89
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
73
90
  app.kubernetes.io/managed-by: cuber
74
91
  spec:
75
92
  template:
76
93
  metadata:
77
94
  labels:
78
- app.kubernetes.io/name: <%= @options[:app] %>
79
- app.kubernetes.io/instance: <%= @options[:instance] %>
80
- app.kubernetes.io/version: <%= @options[:release] %>
95
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
96
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
97
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
81
98
  app.kubernetes.io/managed-by: cuber
82
99
  spec:
83
100
  containers:
@@ -108,9 +125,9 @@ metadata:
108
125
  name: <%= procname %>
109
126
  namespace: <%= @options[:app] %>
110
127
  labels:
111
- app.kubernetes.io/name: <%= @options[:app] %>
112
- app.kubernetes.io/instance: <%= @options[:instance] %>
113
- app.kubernetes.io/version: <%= @options[:release] %>
128
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
129
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
130
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
114
131
  app.kubernetes.io/managed-by: cuber
115
132
  spec:
116
133
  revisionHistoryLimit: 0
@@ -118,12 +135,17 @@ spec:
118
135
  selector:
119
136
  matchLabels:
120
137
  app: <%= procname %>-proc
138
+ strategy:
139
+ type: RollingUpdate
140
+ rollingUpdate:
141
+ maxUnavailable: "25%"
142
+ maxSurge: 0
121
143
  template:
122
144
  metadata:
123
145
  labels:
124
- app.kubernetes.io/name: <%= @options[:app] %>
125
- app.kubernetes.io/instance: <%= @options[:instance] %>
126
- app.kubernetes.io/version: <%= @options[:release] %>
146
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
147
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
148
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
127
149
  app.kubernetes.io/managed-by: cuber
128
150
  app: <%= procname %>-proc
129
151
  spec:
@@ -168,11 +190,13 @@ spec:
168
190
  <%- if procname.to_s == 'web' && @options[:health] -%>
169
191
  readinessProbe:
170
192
  httpGet:
171
- path: <%= URI.parse(@options[:health]).path.to_json %>
172
193
  port: 8080
194
+ path: <%= URI.parse(@options[:health]).path.to_json %>
173
195
  httpHeaders:
174
196
  - name: Host
175
197
  value: <%= URI.parse(@options[:health]).host.to_json %>
198
+ - name: X-Forwarded-Proto
199
+ value: <%= URI.parse(@options[:health]).scheme.to_json %>
176
200
  <%- end -%>
177
201
  <%- if @options[:migrate] && @options[:migrate][:check] -%>
178
202
  initContainers:
@@ -204,9 +228,9 @@ metadata:
204
228
  name: cron-<%= jobname %>
205
229
  namespace: <%= @options[:app] %>
206
230
  labels:
207
- app.kubernetes.io/name: <%= @options[:app] %>
208
- app.kubernetes.io/instance: <%= @options[:instance] %>
209
- app.kubernetes.io/version: <%= @options[:release] %>
231
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
232
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
233
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
210
234
  app.kubernetes.io/managed-by: cuber
211
235
  spec:
212
236
  schedule: <%= cron[:schedule].to_s.to_json %>
@@ -216,18 +240,18 @@ spec:
216
240
  jobTemplate:
217
241
  metadata:
218
242
  labels:
219
- app.kubernetes.io/name: <%= @options[:app] %>
220
- app.kubernetes.io/instance: <%= @options[:instance] %>
221
- app.kubernetes.io/version: <%= @options[:release] %>
243
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
244
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
245
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
222
246
  app.kubernetes.io/managed-by: cuber
223
247
  spec:
224
248
  backoffLimit: 0
225
249
  template:
226
250
  metadata:
227
251
  labels:
228
- app.kubernetes.io/name: <%= @options[:app] %>
229
- app.kubernetes.io/instance: <%= @options[:instance] %>
230
- app.kubernetes.io/version: <%= @options[:release] %>
252
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
253
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
254
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
231
255
  app.kubernetes.io/managed-by: cuber
232
256
  spec:
233
257
  containers:
@@ -258,9 +282,9 @@ metadata:
258
282
  name: ssl
259
283
  namespace: <%= @options[:app] %>
260
284
  labels:
261
- app.kubernetes.io/name: <%= @options[:app] %>
262
- app.kubernetes.io/instance: <%= @options[:instance] %>
263
- app.kubernetes.io/version: <%= @options[:release] %>
285
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
286
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
287
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
264
288
  app.kubernetes.io/managed-by: cuber
265
289
  data:
266
290
  tls.crt: <%= Base64.strict_encode64 File.read @options[:ssl][:crt] %>
@@ -276,9 +300,9 @@ metadata:
276
300
  name: web-service
277
301
  namespace: <%= @options[:app] %>
278
302
  labels:
279
- app.kubernetes.io/name: <%= @options[:app] %>
280
- app.kubernetes.io/instance: <%= @options[:instance] %>
281
- app.kubernetes.io/version: <%= @options[:release] %>
303
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
304
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
305
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
282
306
  app.kubernetes.io/managed-by: cuber
283
307
  spec:
284
308
  selector:
@@ -295,9 +319,9 @@ metadata:
295
319
  name: web-ingress
296
320
  namespace: <%= @options[:app] %>
297
321
  labels:
298
- app.kubernetes.io/name: <%= @options[:app] %>
299
- app.kubernetes.io/instance: <%= @options[:instance] %>
300
- app.kubernetes.io/version: <%= @options[:release] %>
322
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
323
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
324
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
301
325
  app.kubernetes.io/managed-by: cuber
302
326
  annotations:
303
327
  <%- @options[:lb].each do |key, value| -%>
@@ -326,9 +350,9 @@ metadata:
326
350
  name: load-balancer
327
351
  namespace: <%= @options[:app] %>
328
352
  labels:
329
- app.kubernetes.io/name: <%= @options[:app] %>
330
- app.kubernetes.io/instance: <%= @options[:instance] %>
331
- app.kubernetes.io/version: <%= @options[:release] %>
353
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
354
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
355
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
332
356
  app.kubernetes.io/managed-by: cuber
333
357
  annotations:
334
358
  <%- @options[:lb].each do |key, value| -%>
@@ -4,8 +4,8 @@ metadata:
4
4
  name: <%= @options[:pod] %>
5
5
  namespace: <%= @options[:app] %>
6
6
  labels:
7
- app.kubernetes.io/name: <%= @options[:app] %>
8
- app.kubernetes.io/version: <%= @options[:release] %>
7
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
8
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
9
9
  app.kubernetes.io/managed-by: cuber
10
10
  spec:
11
11
  containers:
data/lib/cuber/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cuber
2
- VERSION = '1.7.0'.freeze
2
+ VERSION = '1.9.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cuber
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.7.0
4
+ version: 1.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cuber
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-02 00:00:00.000000000 Z
11
+ date: 2022-11-10 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: