fluent-plugin-kubernetes_metadata_filter 1.0.1 → 1.0.2

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: ef179686ef1088fb46084410bdeb0a2c4b07c3f6
4
- data.tar.gz: 02b2dfe0880adb892922876f5dfd123a54922d76
3
+ metadata.gz: 8917464fdb9accec2996bb272aa99b5e5c78b8e1
4
+ data.tar.gz: 015f9f5e3ece31d4b279f0a536fa562fea6f8787
5
5
  SHA512:
6
- metadata.gz: 5972e28a29443b1e11fd7071ee1b7df5ee5b93be0f406a3bac51979058c49651777515acdc12c63ea2d4f9f84f632668a7d2fef592b9aa4d0249def6b54bdf2b
7
- data.tar.gz: b079681eceb4fd3e1e182c133fd529e9820137cb7b139ffcf63a85b082b8fdeda0ee735ff271e28fa081f348451f2684279aeee8565928d5bd33ba4fc178b851
6
+ metadata.gz: 2d0c7cb0ddf63a3a3e529c3bd02ad6895a8a58f72b3f06917cd116591eea5b13ef73f7b736ac0725c308ff511a30b19cb71e8f1e772971fc391049120794b0a5
7
+ data.tar.gz: b579ec0cead5c9fcdaba5746e1f9c1f241ebfbe156e2bc36b609d17cac0bf7bff4653a6e072b7d565ec5d97d0edea80c4e1459a4b04627d133b2c094d3a02522
data/README.md CHANGED
@@ -11,6 +11,17 @@ to lookup additional metadata about the container's associated pod and namespace
11
11
  authoritatively determine the namespace of the container emitting a log record, it will use an 'orphan' namespace ID in the metadata. This behaviors supports multi-tenant systems
12
12
  that rely on the authenticity of the namespace for proper log isolation.
13
13
 
14
+ ## Requirements
15
+
16
+ | fluent-plugin-kubernetes_metadata_filter | fluentd | ruby |
17
+ |-------------------|---------|------|
18
+ | >= 2.0.0 | >= v0.14.20 | >= 2.1 |
19
+ | < 2.0.0 | >= v0.12.0 | >= 1.9 |
20
+
21
+ NOTE: For v0.12 version, you should use 1.x.y version. Please send patch into v0.12 branch if you encountered 1.x version's bug.
22
+
23
+ NOTE: This documentation is for fluent-plugin-kubernetes_metadata_filter-plugin-elasticsearch 2.x or later. For 1.x documentation, please see [v0.12 branch](https://github.com/fabric8io/fluent-plugin-kubernetes_metadata_filter/tree/v0.12).
24
+
14
25
  ## Installation
15
26
 
16
27
  gem install fluent-plugin-kubernetes_metadata_filter
@@ -38,8 +49,6 @@ This must used named capture groups for `container_name`, `pod_name` & `namespac
38
49
  * `use_journal` - If false (default), messages are expected to be formatted and tagged as if read by the fluentd in\_tail plugin with wildcard filename. If true, messages are expected to be formatted as if read from the systemd journal. The `MESSAGE` field has the full message. The `CONTAINER_NAME` field has the encoded k8s metadata (see below). The `CONTAINER_ID_FULL` field has the full container uuid. This requires docker to use the `--log-driver=journald` log driver.
39
50
  * `container_name_to_kubernetes_regexp` - The regular expression used to extract the k8s metadata encoded in the journal `CONTAINER_NAME` field (default: `'^(?<name_prefix>[^_]+)_(?<container_name>[^\._]+)(\.(?<container_hash>[^_]+))?_(?<pod_name>[^_]+)_(?<namespace>[^_]+)_[^_]+_[^_]+$'`
40
51
  * This corresponds to the definition [in the source](https://github.com/kubernetes/kubernetes/blob/master/pkg/kubelet/dockertools/docker.go#L317)
41
- * `include_namespace_metadata` - Collect metadata about namespace such as uid, labels and annotations (default: `false`).
42
- Note that when this option is enabled, all label from namespace are collected, but annotations are collected according to `annotation_match` value. If `annotation_match` is not presented, no annotations will be collected from the namespace.
43
52
  * `annotation_match` - Array of regular expressions matching annotation field names. Matched annotations are added to a log record.
44
53
  * `allow_orphans` - Modify the namespace and namespace id to the values of `orphaned_namespace_name` and `orphaned_namespace_id`
45
54
  when true (default: `true`)
@@ -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 = "1.0.1"
7
+ gem.version = "1.0.2"
8
8
  gem.authors = ["Jimmi Dyson"]
9
9
  gem.email = ["jimmidyson@gmail.com"]
10
10
  gem.description = %q{Filter plugin to add Kubernetes metadata}
@@ -284,6 +284,7 @@ module Fluent
284
284
  end
285
285
 
286
286
  def filter_stream_from_files(tag, es)
287
+ return es if es.empty?
287
288
  new_es = MultiEventStream.new
288
289
 
289
290
  match_data = tag.match(@tag_to_kubernetes_name_regexp_compiled)
@@ -34,22 +34,6 @@ class KubernetesMetadataFilterTest < Test::Unit::TestCase
34
34
  Test::FilterTestDriver.new(KubernetesMetadataFilter, 'var.log.containers.fabric8-console-controller-98rqc_default_fabric8-console-container-49095a2894da899d3b327c5fde1e056a81376cc9a8f8b09a195f2a92bceed459.log').configure(conf, true)
35
35
  end
36
36
 
37
- sub_test_case 'dump_stats' do
38
-
39
- test 'dump stats with include_namespace_metadata' do
40
- VCR.use_cassette('kubernetes_docker_metadata') do
41
- d = create_driver('
42
- kubernetes_url https://localhost:8443
43
- watch false
44
- cache_size 1
45
- include_namespace_metadata false
46
- stats_interval 0
47
- ')
48
- d.instance.dump_stats
49
- end
50
- end
51
-
52
- end
53
37
  sub_test_case 'configure' do
54
38
  test 'check default' do
55
39
  d = create_driver
@@ -151,7 +135,6 @@ class KubernetesMetadataFilterTest < Test::Unit::TestCase
151
135
  kubernetes_url https://localhost:8443
152
136
  watch false
153
137
  cache_size 1
154
- include_namespace_metadata true
155
138
  ', d: nil)
156
139
  d = create_driver(config) if d.nil?
157
140
  if ENV['LOGLEVEL']
@@ -182,7 +165,6 @@ class KubernetesMetadataFilterTest < Test::Unit::TestCase
182
165
  kubernetes_url https://localhost:8443
183
166
  watch false
184
167
  cache_size 1
185
- include_namespace_metadata true
186
168
  ')
187
169
  cache = driver.instance.instance_variable_get(:@id_cache)
188
170
  cache['49095a2894da899d3b327c5fde1e056a81376cc9a8f8b09a195f2a92bceed459'] = {
@@ -216,7 +198,6 @@ class KubernetesMetadataFilterTest < Test::Unit::TestCase
216
198
  kubernetes_url https://localhost:8443
217
199
  watch false
218
200
  cache_size 1
219
- include_namespace_metadata true
220
201
  ')
221
202
  cache = driver.instance.instance_variable_get(:@id_cache)
222
203
  cache['49095a2894da899d3b327c5fde1e056a81376cc9a8f8b09a195f2a92bceed459'] = {
@@ -279,7 +260,6 @@ class KubernetesMetadataFilterTest < Test::Unit::TestCase
279
260
  kubernetes_url https://localhost:8443
280
261
  watch false
281
262
  cache_size 1
282
- include_namespace_id true
283
263
  ')
284
264
  expected_kube_metadata = {
285
265
  'docker' => {
@@ -494,7 +474,6 @@ use_journal true
494
474
  kubernetes_url https://localhost:8443
495
475
  watch false
496
476
  cache_size 1
497
- include_namespace_metadata true
498
477
  ')
499
478
  expected_kube_metadata = {
500
479
  'docker' => {
@@ -527,7 +506,6 @@ use_journal true
527
506
  watch false
528
507
  cache_size 1
529
508
  de_dot false
530
- include_namespace_metadata true
531
509
  ')
532
510
  expected_kube_metadata = {
533
511
  'docker' => {
@@ -610,7 +588,6 @@ use_journal true
610
588
  kubernetes_url https://localhost:8443
611
589
  watch false
612
590
  cache_size 1
613
- include_namespace_id true
614
591
  use_journal true
615
592
  ')
616
593
  expected_kube_metadata = {
@@ -709,7 +686,6 @@ use_journal true
709
686
  kubernetes_url https://localhost:8443
710
687
  watch false
711
688
  cache_size 1
712
- include_namespace_metadata true
713
689
  annotation_match [ "^custom.+", "two", "workspace*"]
714
690
  ')
715
691
  expected_kube_metadata = {
@@ -746,7 +722,6 @@ use_journal true
746
722
  kubernetes_url https://localhost:8443
747
723
  watch false
748
724
  cache_size 1
749
- include_namespace_metadata true
750
725
  annotation_match [ "noMatch*"]
751
726
  ')
752
727
  expected_kube_metadata = {
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: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jimmi Dyson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-01-17 00:00:00.000000000 Z
11
+ date: 2018-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fluentd