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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '09ccd87a1487e09fced1da55b2b47557a9af161a73c165ec8505300843c8fddb'
4
- data.tar.gz: 9b51267f10184990f979b999214fe627c3c50e821f953fca596600f92d72837c
3
+ metadata.gz: '09d7238c246fa7fe8230a07dbdcc2da7f3eef27842128ced1b0205af91e9af36'
4
+ data.tar.gz: 32bb227701569860e563cc83662b5499c956e043853cc1f8497790e963e5a405
5
5
  SHA512:
6
- metadata.gz: 6de425c42ad8ffd1a72510f4122273fc0140c8d2772afc1d3ef69f0b3f7741dac141131ec5f955acbd832bfdb1cdcad66e535e0f1cf9757593e67972da1083d8
7
- data.tar.gz: 6e059d607685f431f39bc2afde5920c00ae8a4b7b8d18d3fa53b0f115812b75b8347f2b7e75942218424d640765199e3e1bb211322f5336b9ba3825d2cda7b10
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 = ['crashloopbackoff'].freeze
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 = 120
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' : '../mock_output_two.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
@@ -3,4 +3,4 @@
3
3
  require 'daemons'
4
4
 
5
5
  filename = "#{File.expand_path(File.dirname(__FILE__))}/kubernetes_health_checker"
6
- Daemons.run(filename)
6
+ Daemons.run(filename, log_output: true)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kubernetes_health_checker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.0.14
4
+ version: 0.0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rohan Sahai