cuber 1.9.0 → 1.11.0

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
  SHA256:
3
- metadata.gz: d5791ce33c71c03935fda3c59aa5b9ee5c5694ae0b3f0c359dc6522078745510
4
- data.tar.gz: ddf9c67fbd2840334fb15efe4a595dd57200448b85f05943204250a5a1a43e4c
3
+ metadata.gz: 167faf2d74161846ae5e45a2f3bc48d7ac654668e4b8e562bb0d238546ff8a6b
4
+ data.tar.gz: 59997a9f8bd1f1b3504175d29d6b34d744f881e9e43f607281aa2e03d70e4460
5
5
  SHA512:
6
- metadata.gz: a97f170cb22b7e70254991ba0271787904d6578c2d3bbdc4dd5cef474244c0d27d6327ab7abe0c541210a49c0db1dd5744bdb2a0329f0e7ae28e536fa0ecfe3e
7
- data.tar.gz: 4fb13ed216d12812886944298df382d7162d058d64f7e6e863338f2b8a29fe8feb826972c37f36bdcedb7ce89568a502e9ee340a41470fb3513de4a5f57cd933
6
+ metadata.gz: eb17bbd6cdc40d91c67acee4e269f756f0d3e8bb1244303b5f7d12d638e5fd01c3e1a1d4b6dc506eba7cd70863ac03ab3c360b117c0fd54a8f6757e83f468326
7
+ data.tar.gz: 9ca18c504850da1bd8511f5268773ed66f8bc4b7a1661a5030d3317ecfc360188bfac4adcce91bb92427f37026d06fda33412d95b0b6a8f01fbe0dc351899e18
data/README.md CHANGED
@@ -72,6 +72,12 @@ $ cuber info
72
72
 
73
73
  Check out the [Cuberfile configuration](https://cuber.cloud/docs/cuberfile) and the [Cuber CLI commands](https://cuber.cloud/docs/cli) for more information.
74
74
 
75
+ ## Production-ready
76
+
77
+ We have built Cuber for scaling [Pushpad](https://pushpad.xyz). Cuber has been used in production for over a year and it is stable and reliable. We had 100% uptime and we saved 80% on cloud costs.
78
+
79
+ Cuber is a mature project that has all the features needed for deploying applications on Kubernetes and it is used every day for several projects.
80
+
75
81
  ## License
76
82
 
77
83
  Cuber is released under the [Apache-2.0 license](https://opensource.org/licenses/Apache-2.0).
@@ -81,7 +81,7 @@ module Cuber
81
81
  @options[:procs].each do |procname, proc|
82
82
  @errors << "proc \"#{procname}\" name can only include lowercase letters" if procname !~ /\A[a-z]+\z/
83
83
  @errors << "proc \"#{procname}\" command must be present" if proc[:cmd].to_s.strip.empty?
84
- @errors << "proc \"#{procname}\" scale must be a positive number" unless proc[:scale].is_a?(Integer) && proc[:scale] > 0
84
+ @errors << "proc \"#{procname}\" scale must be a positive number or a range" unless (proc[:scale].is_a?(Integer) && proc[:scale] > 0) || (proc[:scale].is_a?(Range) && proc[:scale].minmax.all? { |m| m.is_a?(Integer) && m > 0 })
85
85
  @errors << "proc \"#{procname}\" cpu must be a positive number" unless proc[:cpu].nil? || proc[:cpu].is_a?(Numeric) && proc[:cpu] > 0
86
86
  @errors << "proc \"#{procname}\" ram must be a positive number" unless proc[:ram].nil? || proc[:ram].is_a?(Numeric) && proc[:ram] > 0
87
87
  @errors << "proc \"#{procname}\" term must be a positive number" unless proc[:term].is_a?(Integer) && proc[:term] > 0
@@ -131,7 +131,7 @@ metadata:
131
131
  app.kubernetes.io/managed-by: cuber
132
132
  spec:
133
133
  revisionHistoryLimit: 0
134
- replicas: <%= proc[:scale] %>
134
+ replicas: <%= proc[:scale].is_a?(Range) ? proc[:scale].min : proc[:scale] %>
135
135
  selector:
136
136
  matchLabels:
137
137
  app: <%= procname %>-proc
@@ -197,6 +197,11 @@ spec:
197
197
  value: <%= URI.parse(@options[:health]).host.to_json %>
198
198
  - name: X-Forwarded-Proto
199
199
  value: <%= URI.parse(@options[:health]).scheme.to_json %>
200
+ initialDelaySeconds: 0
201
+ periodSeconds: 10
202
+ timeoutSeconds: 5
203
+ successThreshold: 1
204
+ failureThreshold: 3
200
205
  <%- end -%>
201
206
  <%- if @options[:migrate] && @options[:migrate][:check] -%>
202
207
  initContainers:
@@ -220,6 +225,34 @@ spec:
220
225
  terminationGracePeriodSeconds: <%= proc[:term] %>
221
226
  <%- end -%>
222
227
 
228
+ <%- @options[:procs].select { |procname, proc| proc[:scale].is_a?(Range) }.each do |procname, proc| -%>
229
+ ---
230
+ apiVersion: autoscaling/v2
231
+ kind: HorizontalPodAutoscaler
232
+ metadata:
233
+ name: scale-<%= procname %>
234
+ namespace: <%= @options[:app] %>
235
+ labels:
236
+ app.kubernetes.io/name: <%= @options[:app].to_s.to_json %>
237
+ app.kubernetes.io/instance: <%= @options[:instance].to_s.to_json %>
238
+ app.kubernetes.io/version: <%= @options[:release].to_s.to_json %>
239
+ app.kubernetes.io/managed-by: cuber
240
+ spec:
241
+ scaleTargetRef:
242
+ apiVersion: apps/v1
243
+ kind: Deployment
244
+ name: <%= procname %>
245
+ minReplicas: <%= proc[:scale].min %>
246
+ maxReplicas: <%= proc[:scale].max %>
247
+ metrics:
248
+ - type: Resource
249
+ resource:
250
+ name: cpu
251
+ target:
252
+ type: Utilization
253
+ averageUtilization: 60
254
+ <%- end -%>
255
+
223
256
  <%- @options[:cron].each do |jobname, cron| -%>
224
257
  ---
225
258
  apiVersion: batch/v1
data/lib/cuber/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Cuber
2
- VERSION = '1.9.0'.freeze
2
+ VERSION = '1.11.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.9.0
4
+ version: 1.11.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-10 00:00:00.000000000 Z
11
+ date: 2024-06-20 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description:
14
14
  email: