kubernetes-health 0.1.0
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 +7 -0
- data/.gitignore +12 -0
- data/.rspec +2 -0
- data/.travis.yml +5 -0
- data/Gemfile +4 -0
- data/README.md +37 -0
- data/Rakefile +6 -0
- data/app/controllers/kubernetes/health_controller.rb +11 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/config/routes.rb +3 -0
- data/kubernetes-health.gemspec +26 -0
- data/lib/kubernetes/health/config.rb +24 -0
- data/lib/kubernetes/health/engine.rb +8 -0
- data/lib/kubernetes/health/version.rb +5 -0
- data/lib/kubernetes/health.rb +3 -0
- metadata +101 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 726bc092d8f0aecff2b1149af89a0da7dd463c2e
|
4
|
+
data.tar.gz: 0f5170160a829c17eb1bcf49c3446eb9d3296283
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f6bb961d18809c7fa1358a0ccb439e041a01c1f8c89ce389c301eb363d3aad16edeaac1126f2cba5ec090feb461c60b5ec0750ffadaa4b85bf407844434fc958
|
7
|
+
data.tar.gz: 7ca5992a79ff325922299cff6a4de6abdf10d3441373d2e5faede3115363348dda5ce8622dee9b9b7a1c80ca4e50a586a91449edcfb7b1fb6da38f70ce676a1a
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,37 @@
|
|
1
|
+
# Kubernetes::Health
|
2
|
+
|
3
|
+
A simple gem that adds /_health in your APP.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'kubernetes-health'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
Or install it yourself as:
|
18
|
+
|
19
|
+
$ gem install kubernetes-health
|
20
|
+
|
21
|
+
## Custom check
|
22
|
+
|
23
|
+
Set Kubernetes::Health::Config.sick_if if you want to check other things.
|
24
|
+
|
25
|
+
Ex. Check if PostgreSQL is working.
|
26
|
+
```
|
27
|
+
Kubernetes::Health::Config.sick_if = lambda { ActiveRecord::Base.connection.execute("SELECT 1").cmd_tuples != 1 }
|
28
|
+
```
|
29
|
+
|
30
|
+
## Custom route
|
31
|
+
|
32
|
+
Set Kubernetes::Health::Config.route if you want to use other route.
|
33
|
+
|
34
|
+
Ex.
|
35
|
+
```
|
36
|
+
Kubernetes::Health::Config.route = '/status'
|
37
|
+
```
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "kubernetes/health"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
data/bin/setup
ADDED
data/config/routes.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'kubernetes/health/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "kubernetes-health"
|
8
|
+
spec.version = Kubernetes::Health::VERSION
|
9
|
+
spec.authors = ["Wagner Caixeta"]
|
10
|
+
spec.email = ["wagner@baladapp.com.br"]
|
11
|
+
|
12
|
+
spec.summary = %q{A simple gem to add /_health to your Rails APP.}
|
13
|
+
spec.description = %q{A simple gem to add /_health to your Rails APP for using with Kubernetes}
|
14
|
+
spec.homepage = "https://github.com/platbr/kubernetes-health"
|
15
|
+
|
16
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
17
|
+
f.match(%r{^(test|spec|features)/})
|
18
|
+
end
|
19
|
+
spec.bindir = "exe"
|
20
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
21
|
+
spec.require_paths = ["lib"]
|
22
|
+
|
23
|
+
spec.add_development_dependency "bundler", "~> 1.14"
|
24
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
26
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
module Kubernetes
|
2
|
+
module Health
|
3
|
+
class Config
|
4
|
+
@@sick_if = lambda { false }
|
5
|
+
@@route = '/_health'
|
6
|
+
|
7
|
+
def self.route
|
8
|
+
@@route
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.route=(value)
|
12
|
+
@@route
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.sick_if
|
16
|
+
@@sick_if
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.sick_if=(value)
|
20
|
+
@@sick_if = value
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
metadata
ADDED
@@ -0,0 +1,101 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: kubernetes-health
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Wagner Caixeta
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-12-06 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.14'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.14'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: rspec
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '3.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '3.0'
|
55
|
+
description: A simple gem to add /_health to your Rails APP for using with Kubernetes
|
56
|
+
email:
|
57
|
+
- wagner@baladapp.com.br
|
58
|
+
executables: []
|
59
|
+
extensions: []
|
60
|
+
extra_rdoc_files: []
|
61
|
+
files:
|
62
|
+
- ".gitignore"
|
63
|
+
- ".rspec"
|
64
|
+
- ".travis.yml"
|
65
|
+
- Gemfile
|
66
|
+
- README.md
|
67
|
+
- Rakefile
|
68
|
+
- app/controllers/kubernetes/health_controller.rb
|
69
|
+
- bin/console
|
70
|
+
- bin/setup
|
71
|
+
- config/routes.rb
|
72
|
+
- kubernetes-health.gemspec
|
73
|
+
- lib/kubernetes/health.rb
|
74
|
+
- lib/kubernetes/health/config.rb
|
75
|
+
- lib/kubernetes/health/engine.rb
|
76
|
+
- lib/kubernetes/health/version.rb
|
77
|
+
homepage: https://github.com/platbr/kubernetes-health
|
78
|
+
licenses: []
|
79
|
+
metadata: {}
|
80
|
+
post_install_message:
|
81
|
+
rdoc_options: []
|
82
|
+
require_paths:
|
83
|
+
- lib
|
84
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
85
|
+
requirements:
|
86
|
+
- - ">="
|
87
|
+
- !ruby/object:Gem::Version
|
88
|
+
version: '0'
|
89
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
90
|
+
requirements:
|
91
|
+
- - ">="
|
92
|
+
- !ruby/object:Gem::Version
|
93
|
+
version: '0'
|
94
|
+
requirements: []
|
95
|
+
rubyforge_project:
|
96
|
+
rubygems_version: 2.6.8
|
97
|
+
signing_key:
|
98
|
+
specification_version: 4
|
99
|
+
summary: A simple gem to add /_health to your Rails APP.
|
100
|
+
test_files: []
|
101
|
+
has_rdoc:
|