kubernetes-deploy 0.12.1 → 0.12.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +18 -0
- data/lib/kubernetes-deploy/kubernetes_resource/pod.rb +6 -3
- data/lib/kubernetes-deploy/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 191575b8707a76646afc97a5857e41aeedfe841a
|
4
|
+
data.tar.gz: 0fc63d6a819b3aa446e5c9c000837c6207fe3ec8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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)
|
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.
|
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-
|
12
|
+
date: 2017-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|