kubernetes-deploy 0.12.1 → 0.12.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: c20a5acd35ec91b8e4b2512a82b2d02b686de5a2
4
- data.tar.gz: 4a19d08b989731002c6b6d18b1ecb428a70a61c7
3
+ metadata.gz: 191575b8707a76646afc97a5857e41aeedfe841a
4
+ data.tar.gz: 0fc63d6a819b3aa446e5c9c000837c6207fe3ec8
5
5
  SHA512:
6
- metadata.gz: 330f996992f1fd338f7d4723804a1b31c1a07c08c784606a787d6f989cae2f2b0205a067bbef0cf6a7f006d217b7c4b07d0901b685d99e746573b23bda39d39f
7
- data.tar.gz: 7a9a2118a699b2ea430b146ad545bf091284a0af36a1b6c1bb32db52cab8c322e0db36933f5a88fb6e9168b8bcb6254eaf7f273e0099ad352fa5277312a7240b
6
+ metadata.gz: 9c6d55d9154882ca8299ad288bea2f28913901b334ca22313e24a133d3d3900ecb2fa3a1690cc053f30608e5118b400099d610245a3791c20ba1c98331f7e644
7
+ data.tar.gz: de1465e7bedd7aba0fadcb80e019bd5a2e6d0547e1d9cc452fe4f02815d886931fb3f19fc349a8b56a25040341c22401b1ed6f107d0d34b7e793e0c0e24a2365
data/README.md CHANGED
@@ -201,11 +201,29 @@ Since their data is only base64 encoded, Kubernetes secrets should not be commit
201
201
 
202
202
  ## Usage
203
203
 
204
+ **Option 1: Specify the deployments you want to restart**
205
+
204
206
  The following command will restart all pods in the `web` and `jobs` deployments:
205
207
 
206
208
  `kubernetes-restart <kube namespace> <kube context> --deployments=web,jobs`
207
209
 
208
210
 
211
+ **Option 2: Annotate the deployments you want to restart**
212
+
213
+ Add the annotation `shipit.shopify.io/restart` to all the deployments you want to target, like this:
214
+
215
+ ```yaml
216
+ apiVersion: apps/v1beta1
217
+ kind: Deployment
218
+ metadata:
219
+ name: web
220
+ annotations:
221
+ shipit.shopify.io/restart: "true"
222
+ ```
223
+
224
+ With this done, you can use the following command to restart all of them:
225
+
226
+ `kubernetes-restart <kube namespace> <kube context>`
209
227
 
210
228
  # kubernetes-run
211
229
 
@@ -179,15 +179,18 @@ module KubernetesDeploy
179
179
  end
180
180
 
181
181
  def doom_reason
182
- exit_code = @status.dig('lastState', 'terminated', 'exitCode')
183
- last_terminated_reason = @status.dig("lastState", "terminated", "reason")
184
182
  limbo_reason = @status.dig("state", "waiting", "reason")
185
183
  limbo_message = @status.dig("state", "waiting", "message")
186
184
 
187
- if last_terminated_reason == "ContainerCannotRun"
185
+ if @status.dig("lastState", "terminated", "reason") == "ContainerCannotRun"
188
186
  # ref: https://github.com/kubernetes/kubernetes/blob/562e721ece8a16e05c7e7d6bdd6334c910733ab2/pkg/kubelet/dockershim/docker_container.go#L353
187
+ exit_code = @status.dig('lastState', 'terminated', 'exitCode')
189
188
  "Failed to start (exit #{exit_code}): #{@status.dig('lastState', 'terminated', 'message')}"
189
+ elsif @status.dig("state", "terminated", "reason") == "ContainerCannotRun"
190
+ exit_code = @status.dig('state', 'terminated', 'exitCode')
191
+ "Failed to start (exit #{exit_code}): #{@status.dig('state', 'terminated', 'message')}"
190
192
  elsif limbo_reason == "CrashLoopBackOff"
193
+ exit_code = @status.dig('lastState', 'terminated', 'exitCode')
191
194
  "Crashing repeatedly (exit #{exit_code}). See logs for more information."
192
195
  elsif %w(ImagePullBackOff ErrImagePull).include?(limbo_reason) &&
193
196
  limbo_message.match(/(?:not found)|(?:back-off)/i)
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module KubernetesDeploy
3
- VERSION = "0.12.1"
3
+ VERSION = "0.12.2"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes-deploy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.1
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Katrina Verey
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-08-29 00:00:00.000000000 Z
12
+ date: 2017-09-14 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport