fluent-plugin-kubernetes_metadata_filter 0.2.0 → 0.3.0
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d2300a4324a73e67a50f1151cbbfb89beb7f3091
|
4
|
+
data.tar.gz: 95aa9acea4987f1e167e6c0975ad1fff2907b6a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 75d9e411f23df7047576e2cb93cf8c025af632235c41b9491ffed5cc8434361603ed654dd1cc605a4c2bd8c7cdc29edf750c9ab0902519a1db317c1ff4701cb0
|
7
|
+
data.tar.gz: f01249b3c1d1e6fe99e15f9a87a1a00060b98d1a78333976d3a1eb7af891f6e7a77dbe433a5226966d9b30456599e53e77cce39d72eb881be0ae381b511a6323
|
data/README.md
CHANGED
@@ -20,6 +20,7 @@ Configuration options for fluent.conf are:
|
|
20
20
|
* `bearer_token_file` - path to a file containing the bearer token to use for authentication
|
21
21
|
* `container_name_to_kubernetes_name_regexp` - the regular expression used to extract kubernetes metadata (pod name, container name, namespace) from the Docker container name. This must used named capture groups for `pod_container_name`, `pod_name` & `namespace` (default: `'\/?[^_]+_(?<pod_container_name>[^\.]+)[^_]+_(?<pod_name>[^_]+)_(?<namespace>[^_]+)'`)
|
22
22
|
* `cache_size` - size of the cache of Kubernetes metadata to reduce requests to the API server (default: `1000`)
|
23
|
+
* `cache_ttl` - TTL in seconds of each cached element. Set to negative value to disable TTL eviction (default: `3600` - 1 hour)
|
23
24
|
|
24
25
|
```
|
25
26
|
<source>
|
@@ -4,7 +4,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
|
4
4
|
|
5
5
|
Gem::Specification.new do |gem|
|
6
6
|
gem.name = "fluent-plugin-kubernetes_metadata_filter"
|
7
|
-
gem.version = "0.
|
7
|
+
gem.version = "0.3.0"
|
8
8
|
gem.authors = ["Jimmi Dyson"]
|
9
9
|
gem.email = ["jimmidyson@gmail.com"]
|
10
10
|
gem.description = %q{Filter plugin to add Kubernetes metadata}
|
@@ -21,6 +21,7 @@ module Fluent
|
|
21
21
|
Fluent::Plugin.register_filter('kubernetes_metadata', self)
|
22
22
|
|
23
23
|
config_param :cache_size, :integer, :default => 1000
|
24
|
+
config_param :cache_ttl, :integer, :default => 60 * 60
|
24
25
|
config_param :kubernetes_url, :string
|
25
26
|
config_param :apiVersion, :string, :default => 'v1beta3'
|
26
27
|
config_param :client_cert, :string, :default => ''
|
@@ -83,7 +84,10 @@ module Fluent
|
|
83
84
|
raise Fluent::ConfigError, "Invalid Kubernetes API endpoint: #{kube_error.message}"
|
84
85
|
end
|
85
86
|
|
86
|
-
@
|
87
|
+
if @cache_ttl < 0
|
88
|
+
@cache_ttl = :none
|
89
|
+
end
|
90
|
+
@cache = LruRedux::TTL::ThreadSafeCache.new(@cache_size, @cache_ttl)
|
87
91
|
@container_name_to_kubernetes_name_regexp_compiled = Regexp.compile(@container_name_to_kubernetes_name_regexp)
|
88
92
|
end
|
89
93
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-kubernetes_metadata_filter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jimmi Dyson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fluentd
|