kubernetes_health_checker 0.0.0.14 → 0.0.0.15
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/kubernetes_health_checker +9 -3
- data/bin/kubernetes_health_checkerd +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz: '
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '09d7238c246fa7fe8230a07dbdcc2da7f3eef27842128ced1b0205af91e9af36'
|
4
|
+
data.tar.gz: 32bb227701569860e563cc83662b5499c956e043853cc1f8497790e963e5a405
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b2f15ae78ea5dedc7627f94da06b293b1d90e88c607429884e4284f8684c90adaec1d20356c1e630a51d43756af4aab42f97b7b02a137cc3753824536f769164
|
7
|
+
data.tar.gz: 4154fd591f34fcf037bc151bf0f7014162cc289fec01e7fb2807c29fcadccc6fa1b6150f5161a691c7e8e94c9829283eee331e0b6db6a57a7ecb58750f5cde8c
|
@@ -15,7 +15,12 @@ module KubernetesHealthChecker
|
|
15
15
|
method_option :url, aliases: '-u', type: :string, desc: 'Specify the slack url you would like the alert POSTed to'
|
16
16
|
method_option :test, aliases: '-t', type: :boolean, desc: 'Specify if running the gem in test mode'
|
17
17
|
|
18
|
-
ALERT_STATUSES = [
|
18
|
+
ALERT_STATUSES = [
|
19
|
+
'crashloopbackoff',
|
20
|
+
'error',
|
21
|
+
'errimagepull',
|
22
|
+
'runconatinererror',
|
23
|
+
].freeze
|
19
24
|
|
20
25
|
# time is in seconds
|
21
26
|
TIMED_ALERT_STATUSES = {
|
@@ -23,7 +28,7 @@ module KubernetesHealthChecker
|
|
23
28
|
'containercreating' => 120,
|
24
29
|
}
|
25
30
|
|
26
|
-
RUN_INTERVAL =
|
31
|
+
RUN_INTERVAL = 10
|
27
32
|
|
28
33
|
def start
|
29
34
|
set_defaults(options)
|
@@ -48,6 +53,7 @@ module KubernetesHealthChecker
|
|
48
53
|
opts = options.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
|
49
54
|
@alert_threshold = opts[:alert_threshold] || 5
|
50
55
|
@slack_channel = opts[:channel] || '@rohan'
|
56
|
+
puts options
|
51
57
|
@namespace = opts[:namespace].split(',') || ['default']
|
52
58
|
@test = opts[:test] || false
|
53
59
|
@url = opts[:url]
|
@@ -62,7 +68,7 @@ module KubernetesHealthChecker
|
|
62
68
|
if @test
|
63
69
|
# so hacky, but pulls from second mock output if
|
64
70
|
# it's the second time running to test state changes
|
65
|
-
file_name = @pods_data.empty? ? '../mock_output.txt' : '../
|
71
|
+
file_name = @pods_data.empty? ? '../mock_output.txt' : '../mock_output_three.txt'
|
66
72
|
path = File.expand_path(file_name, __FILE__)
|
67
73
|
output = File.read(path)
|
68
74
|
else
|