kubelink 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/kubelink/monitoring_controller.rb +12 -0
- data/config/routes.rb +4 -0
- data/kubelink.gemspec +9 -3
- data/lib/kubelink.rb +15 -5
- data/lib/kubelink/sentry.rb +3 -1
- data/lib/kubelink/version.rb +1 -1
- metadata +34 -11
- data/lib/kubelink/health.rb +0 -23
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b946f31427209360e744ee62c3621ca6a7ecf1149a485a852a4dcb278b8fdbe2
|
4
|
+
data.tar.gz: 2bc20c51b74a2ede98bbb79984ae6b3ff4eb7bab032e0679d8c11378cf3aa487
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94b501e6dd0137a9c5612ed5b4e1fdb1bb02140fad88b3f221185d22e9a12c790f2e7ab7c20ab96e16f0e397d8a8cee684e807738f72967ebd153a098bf6241f
|
7
|
+
data.tar.gz: 31a7f3e478f21212aa98eb0f1d22778877b05ed18f98b85aff1eeb49379d7e64fe039e3ca3723bea1d791e6a7ef9508a4c83aa2691b8141772afb006acf33d17
|
data/config/routes.rb
ADDED
data/kubelink.gemspec
CHANGED
@@ -5,11 +5,15 @@ require 'kubelink/version'
|
|
5
5
|
Gem::Specification.new do |s|
|
6
6
|
s.name = 'kubelink'
|
7
7
|
s.version = Kubelink::VERSION
|
8
|
-
s.
|
9
|
-
s.email =
|
8
|
+
s.author = 'Martino di Filippo'
|
9
|
+
s.email = 'difilippo@shaman.xyz'
|
10
10
|
s.homepage = 'https://git.shaman.xyz/shaman/kubelink'
|
11
11
|
s.summary = %q{Integrate a Rails app with our Kubernetes environment}
|
12
12
|
s.license = 'MIT'
|
13
|
+
s.metadata = {
|
14
|
+
'source_code_uri' => 'https://git.shaman.xyz/shaman/kubelink/tree/master'
|
15
|
+
}
|
16
|
+
|
13
17
|
s.required_ruby_version = '>= 2.3.0'
|
14
18
|
|
15
19
|
s.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
@@ -18,9 +22,11 @@ Gem::Specification.new do |s|
|
|
18
22
|
s.executables = s.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
19
23
|
s.require_paths = ['lib']
|
20
24
|
|
25
|
+
s.add_dependency 'activesupport', '~> 5.2'
|
21
26
|
s.add_dependency 'lograge', '~> 0.10.0'
|
22
27
|
s.add_dependency 'prometheus_exporter', '~> 0.4.0'
|
23
|
-
s.add_dependency '
|
28
|
+
s.add_dependency 'rails', '~> 5.2'
|
29
|
+
s.add_dependency 'sentry-raven', '~> 2.7'
|
24
30
|
|
25
31
|
s.add_development_dependency 'bundler', '~> 1.16'
|
26
32
|
s.add_development_dependency 'rake', '~> 10.0'
|
data/lib/kubelink.rb
CHANGED
@@ -1,8 +1,18 @@
|
|
1
|
+
require 'active_support/dependencies'
|
1
2
|
require 'kubelink/version'
|
2
3
|
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
module Kubelink
|
5
|
+
class Engine < Rails::Engine
|
6
|
+
isolate_namespace Kubelink
|
7
|
+
|
8
|
+
initializer 'kubelink.mount' do |app|
|
9
|
+
app.routes.append do
|
10
|
+
mount Kubelink::Engine => '/'
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
8
14
|
end
|
15
|
+
|
16
|
+
require 'kubelink/config'
|
17
|
+
require 'kubelink/prometheus'
|
18
|
+
require 'kubelink/sentry'
|
data/lib/kubelink/sentry.rb
CHANGED
@@ -38,7 +38,9 @@ module Kubelink
|
|
38
38
|
script = 'https://browser.sentry-cdn.com/4.2.0/bundle.min.js'
|
39
39
|
|
40
40
|
[ javascript_include_tag(script, crossorigin: :anonymous),
|
41
|
-
|
41
|
+
javascript_tag(nonce: true) do
|
42
|
+
%Q{Sentry.init({ dsn: "#{sentry_dsn}" });}.html_safe
|
43
|
+
end
|
42
44
|
].join("\n").html_safe
|
43
45
|
end
|
44
46
|
end
|
data/lib/kubelink/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kubelink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martino di Filippo
|
@@ -10,6 +10,20 @@ bindir: bin
|
|
10
10
|
cert_chain: []
|
11
11
|
date: 2018-10-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: activesupport
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '5.2'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '5.2'
|
13
27
|
- !ruby/object:Gem::Dependency
|
14
28
|
name: lograge
|
15
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -38,6 +52,20 @@ dependencies:
|
|
38
52
|
- - "~>"
|
39
53
|
- !ruby/object:Gem::Version
|
40
54
|
version: 0.4.0
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '5.2'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '5.2'
|
41
69
|
- !ruby/object:Gem::Dependency
|
42
70
|
name: sentry-raven
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -45,9 +73,6 @@ dependencies:
|
|
45
73
|
- - "~>"
|
46
74
|
- !ruby/object:Gem::Version
|
47
75
|
version: '2.7'
|
48
|
-
- - ">="
|
49
|
-
- !ruby/object:Gem::Version
|
50
|
-
version: 2.7.4
|
51
76
|
type: :runtime
|
52
77
|
prerelease: false
|
53
78
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -55,9 +80,6 @@ dependencies:
|
|
55
80
|
- - "~>"
|
56
81
|
- !ruby/object:Gem::Version
|
57
82
|
version: '2.7'
|
58
|
-
- - ">="
|
59
|
-
- !ruby/object:Gem::Version
|
60
|
-
version: 2.7.4
|
61
83
|
- !ruby/object:Gem::Dependency
|
62
84
|
name: bundler
|
63
85
|
requirement: !ruby/object:Gem::Requirement
|
@@ -87,8 +109,7 @@ dependencies:
|
|
87
109
|
- !ruby/object:Gem::Version
|
88
110
|
version: '10.0'
|
89
111
|
description:
|
90
|
-
email:
|
91
|
-
- difilippo@shaman.xyz
|
112
|
+
email: difilippo@shaman.xyz
|
92
113
|
executables: []
|
93
114
|
extensions: []
|
94
115
|
extra_rdoc_files: []
|
@@ -99,19 +120,21 @@ files:
|
|
99
120
|
- LICENSE.txt
|
100
121
|
- README.md
|
101
122
|
- Rakefile
|
123
|
+
- app/controllers/kubelink/monitoring_controller.rb
|
102
124
|
- bin/console
|
103
125
|
- bin/setup
|
126
|
+
- config/routes.rb
|
104
127
|
- kubelink.gemspec
|
105
128
|
- lib/kubelink.rb
|
106
129
|
- lib/kubelink/config.rb
|
107
|
-
- lib/kubelink/health.rb
|
108
130
|
- lib/kubelink/prometheus.rb
|
109
131
|
- lib/kubelink/sentry.rb
|
110
132
|
- lib/kubelink/version.rb
|
111
133
|
homepage: https://git.shaman.xyz/shaman/kubelink
|
112
134
|
licenses:
|
113
135
|
- MIT
|
114
|
-
metadata:
|
136
|
+
metadata:
|
137
|
+
source_code_uri: https://git.shaman.xyz/shaman/kubelink/tree/master
|
115
138
|
post_install_message:
|
116
139
|
rdoc_options: []
|
117
140
|
require_paths:
|
data/lib/kubelink/health.rb
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
module Kubelink
|
2
|
-
class Health < Rails::Railtie
|
3
|
-
initializer "kubelink.healthcheck_endpoints" do
|
4
|
-
ActiveSupport.on_load :action_controller do
|
5
|
-
class MonitoringController < ActionController::Base
|
6
|
-
def health
|
7
|
-
ActiveRecord::Base.connection.execute('SELECT 1')
|
8
|
-
render plain: "ok"
|
9
|
-
end
|
10
|
-
|
11
|
-
def status
|
12
|
-
render plain: "ok"
|
13
|
-
end
|
14
|
-
end
|
15
|
-
|
16
|
-
Rails.application.routes.prepend do
|
17
|
-
get 'healthz', to: 'monitoring#health'
|
18
|
-
get 'statusz', to: 'monitoring#status'
|
19
|
-
end
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|