sidekiq_alive 2.0.0 → 2.0.1

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: 364bf320e50acf4acacc6b092ddc878e094762a048f03b8496b03dca50c79c67
4
- data.tar.gz: a19db126856fbb3629994f2d0aec3fd839462c204a62abe03e0833f140fb16f5
3
+ metadata.gz: 42f950238fc2224907b8c32fe4219f1ad5d3f3a083e68e0230ce98ede04753a9
4
+ data.tar.gz: e8d383349ac91b93c86a0f459d59fe963b9e318157c2fe3c7648f5e88cc1c394
5
5
  SHA512:
6
- metadata.gz: c23f150276af1a182dc6dd7eef752125f12c65de9479ca9877294e0344dd02c9b49cd4174ebbb593996ab8937d538ef5a9b446eed19d5667b6462335d97e5e3a
7
- data.tar.gz: 251ddc155702aa38adcd7368f5dd7e55c9fc40558a2e90fcd05d8641e78faa40337060deef492c23e602884250c6e66dfed1a77c46e058149658975e1e858543
6
+ metadata.gz: 71ce02b4cbdc408a6ab9db14200d78bf2750f130a2d5c1bf877c80854f4b03cfd87e7eda9c3874f6f1ae13950f2d7df61c49a587f7a20c6ca8f1e28bd581ac30
7
+ data.tar.gz: 981d3bccb5c3fc813614c85b4656708af80c7bb392b7454379d740444a2cb8c0ac0c00bf2d5d2e12a8bd67e68d19236d2eaa39970b79719598f32b79d01ffc76
data/README.md CHANGED
@@ -11,7 +11,7 @@ __How?__
11
11
 
12
12
  A http server is started and on each requests validates that a liveness key is stored in Redis. If it is there means is working.
13
13
 
14
- A Sidekiq worker is the responsable to storing this key. If Sidekiq stops processing workers
14
+ A Sidekiq worker is the responsible to storing this key. If Sidekiq stops processing workers
15
15
  this key gets expired by Redis an consequently the http server will return a 500 error.
16
16
 
17
17
  This worker is responsible to requeue itself for the next liveness probe.
@@ -83,6 +83,8 @@ Set `livenessProbe` in your Kubernetes deployment
83
83
 
84
84
  example with recommended setup:
85
85
 
86
+ #### Sidekiq < 6
87
+
86
88
  ```yaml
87
89
  spec:
88
90
  containers:
@@ -117,6 +119,63 @@ spec:
117
119
  terminationGracePeriodSeconds: 60 # put your longest Job time here plus security time.
118
120
  ```
119
121
 
122
+ #### Sidekiq >= 6
123
+
124
+ Create file:
125
+
126
+ __kube/sidekiq_quiet__
127
+
128
+ ```bash
129
+ #!/bin/bash
130
+
131
+ # Find Pid
132
+ SIDEKIQ_PID=$(ps aux | grep sidekiq | grep busy | awk '{ print $2 }')
133
+ # Send TSTP signal
134
+ kill -SIGTSTP $SIDEKIQ_PID
135
+ ```
136
+
137
+ Make it executable:
138
+
139
+ ```
140
+ $ chmod +x kube/sidekiq_quiet
141
+ ```
142
+
143
+ Execute it in your deployment preStop:
144
+
145
+ ```yaml
146
+ spec:
147
+ containers:
148
+ - name: my_app
149
+ image: my_app:latest
150
+ env:
151
+ - name: RAILS_ENV
152
+ value: production
153
+ command:
154
+ - bundle
155
+ - exec
156
+ - sidekiq
157
+ ports:
158
+ - containerPort: 7433
159
+ livenessProbe:
160
+ httpGet:
161
+ path: /
162
+ port: 7433
163
+ initialDelaySeconds: 80 # app specific. Time your sidekiq takes to start processing.
164
+ timeoutSeconds: 5 # can be much less
165
+ readinessProbe:
166
+ httpGet:
167
+ path: /
168
+ port: 7433
169
+ initialDelaySeconds: 80 # app specific
170
+ timeoutSeconds: 5 # can be much less
171
+ lifecycle:
172
+ preStop:
173
+ exec:
174
+ # SIGTERM triggers a quick exit; gracefully terminate instead
175
+ command: ["kube", "sidekiq_quiet"]
176
+ terminationGracePeriodSeconds: 60 # put your longest Job time here plus security time.
177
+ ```
178
+
120
179
  ### Outside kubernetes
121
180
 
122
181
  It's just up to you how you want to use it.
@@ -2,7 +2,7 @@ require 'sinatra/base'
2
2
  module SidekiqAlive
3
3
  class Server < Sinatra::Base
4
4
  set :bind, '0.0.0.0'
5
- set :port, SidekiqAlive.config.port
5
+ set :port, -> { SidekiqAlive.config.port }
6
6
 
7
7
  get '/' do
8
8
  if SidekiqAlive.alive?
@@ -1,3 +1,3 @@
1
1
  module SidekiqAlive
2
- VERSION = '2.0.0'.freeze
2
+ VERSION = '2.0.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sidekiq_alive
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artur Pañach
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-22 00:00:00.000000000 Z
11
+ date: 2020-01-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler