fluent-plugin-kubernetes-objects 1.1.0 → 1.1.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0e1ae1f0a72c88ab818dced9eaf85683eb49a903536dc3fc3faa85b8bb400121
|
4
|
+
data.tar.gz: 0ed3d5f01ed05962ac6533af1d4c4ef63fcf281864f622bd88114536ff634047
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 24ae054a132bb0e3c24cd463bcc0687e9915c368160b5c49389d78dc2884b71dddb453b188551d0465fba0459b303965372ca7223e03ac942f4b9ea69bf56c96
|
7
|
+
data.tar.gz: 29f4a961ebcbbdd8def931c820976563a498992082f8b2630aa0604744aabc836b6ee8134db55341f37f25b964156e5da24a9dbe553fb1f60a3fe1efe6e66214
|
data/Gemfile.lock
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
fluent-plugin-kubernetes-objects (1.
|
5
|
-
fluentd (~> 1.
|
4
|
+
fluent-plugin-kubernetes-objects (1.1.1)
|
5
|
+
fluentd (~> 1.4)
|
6
6
|
kubeclient (~> 4.2)
|
7
7
|
|
8
8
|
GEM
|
@@ -17,7 +17,7 @@ GEM
|
|
17
17
|
docile (1.3.1)
|
18
18
|
domain_name (0.5.20180417)
|
19
19
|
unf (>= 0.0.5, < 1.0.0)
|
20
|
-
fluentd (1.
|
20
|
+
fluentd (1.4.1)
|
21
21
|
cool.io (>= 1.4.5, < 2.0.0)
|
22
22
|
dig_rb (~> 1.0.0)
|
23
23
|
http_parser.rb (>= 0.5.1, < 0.7.0)
|
@@ -39,7 +39,7 @@ GEM
|
|
39
39
|
http-form_data (2.1.1)
|
40
40
|
http_parser.rb (0.6.0)
|
41
41
|
json (2.1.0)
|
42
|
-
kubeclient (4.
|
42
|
+
kubeclient (4.3.0)
|
43
43
|
http (~> 3.0)
|
44
44
|
recursive-open-struct (~> 1.0, >= 1.0.4)
|
45
45
|
rest-client (~> 2.0)
|
@@ -47,7 +47,7 @@ GEM
|
|
47
47
|
mime-types-data (~> 3.2015)
|
48
48
|
mime-types-data (3.2018.0812)
|
49
49
|
minitest (5.11.3)
|
50
|
-
msgpack (1.2.
|
50
|
+
msgpack (1.2.9)
|
51
51
|
netrc (0.11.0)
|
52
52
|
power_assert (1.1.3)
|
53
53
|
public_suffix (3.0.3)
|
@@ -72,7 +72,7 @@ GEM
|
|
72
72
|
thread_safe (0.3.6)
|
73
73
|
tzinfo (1.2.5)
|
74
74
|
thread_safe (~> 0.1)
|
75
|
-
tzinfo-data (1.
|
75
|
+
tzinfo-data (1.2019.1)
|
76
76
|
tzinfo (>= 1.0.0)
|
77
77
|
unf (0.1.4)
|
78
78
|
unf_ext
|
@@ -11,12 +11,12 @@ Gem::Specification.new do |spec|
|
|
11
11
|
|
12
12
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
13
13
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
14
|
+
# if spec.respond_to?(:metadata)
|
15
|
+
# spec.metadata['allowed_push_host'] = "TODO: Set to 'http://mygemserver.com'"
|
16
|
+
# else
|
17
|
+
# raise 'RubyGems 2.0 or newer is required to protect against ' \
|
18
|
+
# 'public gem pushes.'
|
19
|
+
# end
|
20
20
|
|
21
21
|
spec.require_paths = ['lib']
|
22
22
|
spec.test_files = Dir.glob('test/**/**.rb')
|
@@ -32,7 +32,7 @@ Gem::Specification.new do |spec|
|
|
32
32
|
|
33
33
|
spec.required_ruby_version = '>= 2.3.0'
|
34
34
|
|
35
|
-
spec.add_runtime_dependency 'fluentd', '~> 1.
|
35
|
+
spec.add_runtime_dependency 'fluentd', '~> 1.4'
|
36
36
|
spec.add_runtime_dependency 'kubeclient', '~> 4.2'
|
37
37
|
|
38
38
|
spec.add_development_dependency 'bundler', '~> 2.0'
|
@@ -5,7 +5,7 @@ require 'kubeclient'
|
|
5
5
|
|
6
6
|
module Fluent::Plugin
|
7
7
|
class KubernetesObjectsInput < Fluent::Plugin::Input
|
8
|
-
VERSION = '1.1.
|
8
|
+
VERSION = '1.1.1'.freeze
|
9
9
|
|
10
10
|
Fluent::Plugin.register_input('kubernetes_objects', self)
|
11
11
|
|
@@ -72,6 +72,9 @@ module Fluent::Plugin
|
|
72
72
|
|
73
73
|
desc 'A selector to restrict the list of returned objects by fields.'
|
74
74
|
config_param :field_selector, :string, default: nil
|
75
|
+
|
76
|
+
desc 'The interval at which the objects will be watched.'
|
77
|
+
config_param :interval, :time, default: 15 * 60
|
75
78
|
end
|
76
79
|
|
77
80
|
config_section :storage do
|
@@ -140,7 +143,7 @@ module Fluent::Plugin
|
|
140
143
|
if @bearer_token_file.nil? && File.exist?(secret_token_file)
|
141
144
|
@bearer_token_file = secret_token_file
|
142
145
|
end
|
143
|
-
|
146
|
+
end
|
144
147
|
|
145
148
|
ssl_options = {
|
146
149
|
client_cert: @client_cert && OpenSSL::X509::Certificate.new(File.read(@client_cert)),
|
@@ -174,10 +177,12 @@ module Fluent::Plugin
|
|
174
177
|
o = o.to_h.dup
|
175
178
|
o[:as] = :raw
|
176
179
|
resource_name = o.delete(:resource_name)
|
180
|
+
watch_interval = o.delete(:interval)
|
181
|
+
|
177
182
|
version = @storage.get(resource_name)
|
178
183
|
o[:resource_version] = version if version
|
179
184
|
@client.public_send("watch_#{resource_name}", o).tap do |watcher|
|
180
|
-
create_watcher_thread resource_name, watcher
|
185
|
+
create_watcher_thread resource_name, watcher, watch_interval
|
181
186
|
end
|
182
187
|
end
|
183
188
|
end
|
@@ -209,7 +214,7 @@ module Fluent::Plugin
|
|
209
214
|
->(item) { item['metadata'].update requestResourceVersion: resource_version }
|
210
215
|
else
|
211
216
|
->(item) {}
|
212
|
-
|
217
|
+
end
|
213
218
|
|
214
219
|
# result['items'] might be nil due to https://github.com/kubernetes/kubernetes/issues/13096
|
215
220
|
items = result['items'].to_a
|
@@ -222,14 +227,17 @@ module Fluent::Plugin
|
|
222
227
|
end
|
223
228
|
end
|
224
229
|
|
225
|
-
def create_watcher_thread(object_name, watcher)
|
230
|
+
def create_watcher_thread(object_name, watcher, interval)
|
226
231
|
thread_create(:"watch_#{object_name}") do
|
227
232
|
tag = generate_tag "#{object_name}.watch"
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
+
while thread_current_running?
|
234
|
+
watcher.each do |entity|
|
235
|
+
log.trace { "Received new object from watching #{object_name}" }
|
236
|
+
entity = JSON.parse(entity)
|
237
|
+
router.emit tag, Fluent::Engine.now, entity
|
238
|
+
@storage.put object_name, entity['object']['metadata']['resourceVersion']
|
239
|
+
sleep(interval)
|
240
|
+
end
|
233
241
|
end
|
234
242
|
end
|
235
243
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-kubernetes-objects
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Splunk Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '1.
|
19
|
+
version: '1.4'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '1.
|
26
|
+
version: '1.4'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: kubeclient
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|