fluent-plugin-kubernetes_metadata_filter 3.7.0 → 3.7.1
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 +4 -4
- data/README.md +2 -1
- data/Rakefile +3 -4
- data/lib/fluent/plugin/filter_kubernetes_metadata.rb +307 -279
- data/lib/fluent/plugin/kubernetes_metadata_cache_strategy.rb +15 -11
- data/lib/fluent/plugin/kubernetes_metadata_common.rb +38 -40
- data/lib/fluent/plugin/kubernetes_metadata_stats.rb +4 -6
- data/lib/fluent/plugin/kubernetes_metadata_test_api_adapter.rb +39 -36
- data/lib/fluent/plugin/kubernetes_metadata_watch_namespaces.rb +15 -12
- data/lib/fluent/plugin/kubernetes_metadata_watch_pods.rb +18 -17
- metadata +2 -172
- data/.circleci/config.yml +0 -48
- data/.gitignore +0 -18
- data/.rubocop.yml +0 -57
- data/Gemfile +0 -9
- data/Gemfile.lock +0 -172
- data/fluent-plugin-kubernetes_metadata_filter.gemspec +0 -34
- data/lib/fluent/plugin/kubernetes_metadata_util.rb +0 -33
- data/test/cassettes/invalid_api_server_config.yml +0 -53
- data/test/cassettes/kubernetes_docker_metadata_annotations.yml +0 -205
- data/test/cassettes/kubernetes_docker_metadata_dotted_slashed_labels.yml +0 -197
- data/test/cassettes/kubernetes_get_api_v1.yml +0 -193
- data/test/cassettes/kubernetes_get_api_v1_using_token.yml +0 -195
- data/test/cassettes/kubernetes_get_namespace_default.yml +0 -72
- data/test/cassettes/kubernetes_get_namespace_default_using_token.yml +0 -71
- data/test/cassettes/kubernetes_get_pod.yml +0 -146
- data/test/cassettes/kubernetes_get_pod_container_init.yml +0 -145
- data/test/cassettes/kubernetes_get_pod_using_token.yml +0 -148
- data/test/cassettes/kubernetes_get_pod_with_ownerrefs.yml +0 -156
- data/test/cassettes/metadata_from_tag_and_journald_fields.yml +0 -153
- data/test/cassettes/metadata_from_tag_journald_and_kubernetes_fields.yml +0 -285
- data/test/cassettes/valid_kubernetes_api_server.yml +0 -55
- data/test/cassettes/valid_kubernetes_api_server_using_token.yml +0 -57
- data/test/helper.rb +0 -82
- data/test/plugin/test.token +0 -1
- data/test/plugin/test_cache_stats.rb +0 -33
- data/test/plugin/test_cache_strategy.rb +0 -194
- data/test/plugin/test_filter_kubernetes_metadata.rb +0 -851
- data/test/plugin/test_watch_namespaces.rb +0 -245
- data/test/plugin/test_watch_pods.rb +0 -344
- data/test/plugin/watch_test.rb +0 -76
@@ -1,148 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Fluentd Kubernetes Metadata Filter Plugin - Enrich Fluentd events with
|
3
|
-
# Kubernetes metadata
|
4
|
-
#
|
5
|
-
# Copyright 2015 Red Hat, Inc.
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
---
|
20
|
-
http_interactions:
|
21
|
-
- request:
|
22
|
-
method: get
|
23
|
-
uri: https://localhost:8443/api/v1/namespaces/default/pods/fabric8-console-controller-98rqc
|
24
|
-
body:
|
25
|
-
encoding: US-ASCII
|
26
|
-
string: ''
|
27
|
-
headers:
|
28
|
-
Accept:
|
29
|
-
- "*/*; q=0.5, application/xml"
|
30
|
-
Accept-Encoding:
|
31
|
-
- gzip, deflate
|
32
|
-
User-Agent:
|
33
|
-
- Ruby
|
34
|
-
Authorization:
|
35
|
-
- Bearer YzYyYzFlODMtODdhNS00ZTMyLWIzMmItNmY4NDc4OTI1ZWFh
|
36
|
-
response:
|
37
|
-
status:
|
38
|
-
code: 200
|
39
|
-
message: OK
|
40
|
-
headers:
|
41
|
-
Content-Type:
|
42
|
-
- application/json
|
43
|
-
Date:
|
44
|
-
- Fri, 08 May 2015 10:35:37 GMT
|
45
|
-
Transfer-Encoding:
|
46
|
-
- chunked
|
47
|
-
body:
|
48
|
-
encoding: UTF-8
|
49
|
-
string: |-
|
50
|
-
{
|
51
|
-
"kind": "Pod",
|
52
|
-
"apiVersion": "v1",
|
53
|
-
"metadata": {
|
54
|
-
"name": "fabric8-console-controller-98rqc",
|
55
|
-
"generateName": "fabric8-console-controller-",
|
56
|
-
"namespace": "default",
|
57
|
-
"selfLink": "/api/v1/namespaces/default/pods/fabric8-console-controller-98rqc",
|
58
|
-
"uid": "c76927af-f563-11e4-b32d-54ee7527188d",
|
59
|
-
"resourceVersion": "122",
|
60
|
-
"creationTimestamp": "2015-05-08T09:22:42Z",
|
61
|
-
"labels": {
|
62
|
-
"component": "fabric8Console"
|
63
|
-
}
|
64
|
-
},
|
65
|
-
"spec": {
|
66
|
-
"volumes": [
|
67
|
-
{
|
68
|
-
"name": "openshift-cert-secrets",
|
69
|
-
"hostPath": null,
|
70
|
-
"emptyDir": null,
|
71
|
-
"gcePersistentDisk": null,
|
72
|
-
"gitRepo": null,
|
73
|
-
"secret": {
|
74
|
-
"secretName": "openshift-cert-secrets"
|
75
|
-
},
|
76
|
-
"nfs": null,
|
77
|
-
"iscsi": null,
|
78
|
-
"glusterfs": null
|
79
|
-
}
|
80
|
-
],
|
81
|
-
"containers": [
|
82
|
-
{
|
83
|
-
"name": "fabric8-console-container",
|
84
|
-
"image": "fabric8/hawtio-kubernetes:latest",
|
85
|
-
"ports": [
|
86
|
-
{
|
87
|
-
"containerPort": 9090,
|
88
|
-
"protocol": "TCP"
|
89
|
-
}
|
90
|
-
],
|
91
|
-
"env": [
|
92
|
-
{
|
93
|
-
"name": "OAUTH_CLIENT_ID",
|
94
|
-
"value": "fabric8-console"
|
95
|
-
},
|
96
|
-
{
|
97
|
-
"name": "OAUTH_AUTHORIZE_URI",
|
98
|
-
"value": "https://localhost:8443/oauth/authorize"
|
99
|
-
}
|
100
|
-
],
|
101
|
-
"resources": {},
|
102
|
-
"volumeMounts": [
|
103
|
-
{
|
104
|
-
"name": "openshift-cert-secrets",
|
105
|
-
"readOnly": true,
|
106
|
-
"mountPath": "/etc/secret-volume"
|
107
|
-
}
|
108
|
-
],
|
109
|
-
"terminationMessagePath": "/dev/termination-log",
|
110
|
-
"imagePullPolicy": "IfNotPresent",
|
111
|
-
"capabilities": {}
|
112
|
-
}
|
113
|
-
],
|
114
|
-
"restartPolicy": "Always",
|
115
|
-
"dnsPolicy": "ClusterFirst",
|
116
|
-
"nodeName": "jimmi-redhat.localnet"
|
117
|
-
},
|
118
|
-
"status": {
|
119
|
-
"phase": "Running",
|
120
|
-
"Condition": [
|
121
|
-
{
|
122
|
-
"type": "Ready",
|
123
|
-
"status": "True"
|
124
|
-
}
|
125
|
-
],
|
126
|
-
"hostIP": "172.17.42.1",
|
127
|
-
"podIP": "172.17.0.8",
|
128
|
-
"containerStatuses": [
|
129
|
-
{
|
130
|
-
"name": "fabric8-console-container",
|
131
|
-
"state": {
|
132
|
-
"running": {
|
133
|
-
"startedAt": "2015-05-08T09:22:44Z"
|
134
|
-
}
|
135
|
-
},
|
136
|
-
"lastState": {},
|
137
|
-
"ready": true,
|
138
|
-
"restartCount": 0,
|
139
|
-
"image": "fabric8/hawtio-kubernetes:latest",
|
140
|
-
"imageID": "docker://b2bd1a24a68356b2f30128e6e28e672c1ef92df0d9ec01ec0c7faea5d77d2303",
|
141
|
-
"containerID": "docker://49095a2894da899d3b327c5fde1e056a81376cc9a8f8b09a195f2a92bceed459"
|
142
|
-
}
|
143
|
-
]
|
144
|
-
}
|
145
|
-
}
|
146
|
-
http_version:
|
147
|
-
recorded_at: Fri, 08 May 2015 10:35:37 GMT
|
148
|
-
recorded_with: VCR 2.9.3
|
@@ -1,156 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Fluentd Kubernetes Metadata Filter Plugin - Enrich Fluentd events with
|
3
|
-
# Kubernetes metadata
|
4
|
-
#
|
5
|
-
# Copyright 2015 Red Hat, Inc.
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
---
|
20
|
-
http_interactions:
|
21
|
-
- request:
|
22
|
-
method: get
|
23
|
-
uri: https://localhost:8443/api/v1/namespaces/default/pods/fabric8-console-controller-98rqc
|
24
|
-
body:
|
25
|
-
encoding: US-ASCII
|
26
|
-
string: ''
|
27
|
-
headers:
|
28
|
-
Accept:
|
29
|
-
- "*/*; q=0.5, application/xml"
|
30
|
-
Accept-Encoding:
|
31
|
-
- gzip, deflate
|
32
|
-
User-Agent:
|
33
|
-
- Ruby
|
34
|
-
response:
|
35
|
-
status:
|
36
|
-
code: 200
|
37
|
-
message: OK
|
38
|
-
headers:
|
39
|
-
Content-Type:
|
40
|
-
- application/json
|
41
|
-
Date:
|
42
|
-
- Fri, 08 May 2015 10:35:37 GMT
|
43
|
-
Transfer-Encoding:
|
44
|
-
- chunked
|
45
|
-
body:
|
46
|
-
encoding: UTF-8
|
47
|
-
string: |-
|
48
|
-
{
|
49
|
-
"kind": "Pod",
|
50
|
-
"apiVersion": "v1",
|
51
|
-
"metadata": {
|
52
|
-
"name": "fabric8-console-controller-98rqc",
|
53
|
-
"generateName": "fabric8-console-controller-",
|
54
|
-
"namespace": "default",
|
55
|
-
"selfLink": "/api/v1/namespaces/default/pods/fabric8-console-controller-98rqc",
|
56
|
-
"uid": "c76927af-f563-11e4-b32d-54ee7527188d",
|
57
|
-
"resourceVersion": "122",
|
58
|
-
"creationTimestamp": "2015-05-08T09:22:42Z",
|
59
|
-
"labels": {
|
60
|
-
"component": "fabric8Console"
|
61
|
-
},
|
62
|
-
"ownerReferences": [
|
63
|
-
{
|
64
|
-
"apiVersion": "apps/v1",
|
65
|
-
"blockOwnerDeletion": true,
|
66
|
-
"controller": true,
|
67
|
-
"kind": "ReplicaSet",
|
68
|
-
"name": "fabric8-console-controller",
|
69
|
-
"uid": "dd1ac3e1-bc88-4c54-be0f-26ac2406d884"
|
70
|
-
}
|
71
|
-
]
|
72
|
-
},
|
73
|
-
"spec": {
|
74
|
-
"volumes": [
|
75
|
-
{
|
76
|
-
"name": "openshift-cert-secrets",
|
77
|
-
"hostPath": null,
|
78
|
-
"emptyDir": null,
|
79
|
-
"gcePersistentDisk": null,
|
80
|
-
"gitRepo": null,
|
81
|
-
"secret": {
|
82
|
-
"secretName": "openshift-cert-secrets"
|
83
|
-
},
|
84
|
-
"nfs": null,
|
85
|
-
"iscsi": null,
|
86
|
-
"glusterfs": null
|
87
|
-
}
|
88
|
-
],
|
89
|
-
"containers": [
|
90
|
-
{
|
91
|
-
"name": "fabric8-console-container",
|
92
|
-
"image": "fabric8/hawtio-kubernetes:latest",
|
93
|
-
"ports": [
|
94
|
-
{
|
95
|
-
"containerPort": 9090,
|
96
|
-
"protocol": "TCP"
|
97
|
-
}
|
98
|
-
],
|
99
|
-
"env": [
|
100
|
-
{
|
101
|
-
"name": "OAUTH_CLIENT_ID",
|
102
|
-
"value": "fabric8-console"
|
103
|
-
},
|
104
|
-
{
|
105
|
-
"name": "OAUTH_AUTHORIZE_URI",
|
106
|
-
"value": "https://localhost:8443/oauth/authorize"
|
107
|
-
}
|
108
|
-
],
|
109
|
-
"resources": {},
|
110
|
-
"volumeMounts": [
|
111
|
-
{
|
112
|
-
"name": "openshift-cert-secrets",
|
113
|
-
"readOnly": true,
|
114
|
-
"mountPath": "/etc/secret-volume"
|
115
|
-
}
|
116
|
-
],
|
117
|
-
"terminationMessagePath": "/dev/termination-log",
|
118
|
-
"imagePullPolicy": "IfNotPresent",
|
119
|
-
"capabilities": {}
|
120
|
-
}
|
121
|
-
],
|
122
|
-
"restartPolicy": "Always",
|
123
|
-
"dnsPolicy": "ClusterFirst",
|
124
|
-
"nodeName": "jimmi-redhat.localnet"
|
125
|
-
},
|
126
|
-
"status": {
|
127
|
-
"phase": "Running",
|
128
|
-
"Condition": [
|
129
|
-
{
|
130
|
-
"type": "Ready",
|
131
|
-
"status": "True"
|
132
|
-
}
|
133
|
-
],
|
134
|
-
"hostIP": "172.17.42.1",
|
135
|
-
"podIP": "172.17.0.8",
|
136
|
-
"containerStatuses": [
|
137
|
-
{
|
138
|
-
"name": "fabric8-console-container",
|
139
|
-
"state": {
|
140
|
-
"running": {
|
141
|
-
"startedAt": "2015-05-08T09:22:44Z"
|
142
|
-
}
|
143
|
-
},
|
144
|
-
"lastState": {},
|
145
|
-
"ready": true,
|
146
|
-
"restartCount": 0,
|
147
|
-
"image": "fabric8/hawtio-kubernetes:latest",
|
148
|
-
"imageID": "docker://b2bd1a24a68356b2f30128e6e28e672c1ef92df0d9ec01ec0c7faea5d77d2303",
|
149
|
-
"containerID": "docker://49095a2894da899d3b327c5fde1e056a81376cc9a8f8b09a195f2a92bceed459"
|
150
|
-
}
|
151
|
-
]
|
152
|
-
}
|
153
|
-
}
|
154
|
-
http_version:
|
155
|
-
recorded_at: Fri, 08 May 2015 10:35:37 GMT
|
156
|
-
recorded_with: VCR 2.9.3
|
@@ -1,153 +0,0 @@
|
|
1
|
-
#
|
2
|
-
# Fluentd Kubernetes Metadata Filter Plugin - Enrich Fluentd events with
|
3
|
-
# Kubernetes metadata
|
4
|
-
#
|
5
|
-
# Copyright 2015 Red Hat, Inc.
|
6
|
-
#
|
7
|
-
# Licensed under the Apache License, Version 2.0 (the "License");
|
8
|
-
# you may not use this file except in compliance with the License.
|
9
|
-
# You may obtain a copy of the License at
|
10
|
-
#
|
11
|
-
# http://www.apache.org/licenses/LICENSE-2.0
|
12
|
-
#
|
13
|
-
# Unless required by applicable law or agreed to in writing, software
|
14
|
-
# distributed under the License is distributed on an "AS IS" BASIS,
|
15
|
-
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
16
|
-
# See the License for the specific language governing permissions and
|
17
|
-
# limitations under the License.
|
18
|
-
#
|
19
|
-
---
|
20
|
-
http_interactions:
|
21
|
-
- request:
|
22
|
-
method: get
|
23
|
-
uri: https://localhost:8443/api/v1/namespaces/journald-namespace-name/pods/journald-pod-name
|
24
|
-
body:
|
25
|
-
encoding: US-ASCII
|
26
|
-
string: ''
|
27
|
-
headers:
|
28
|
-
Accept:
|
29
|
-
- "*/*; q=0.5, application/xml"
|
30
|
-
Accept-Encoding:
|
31
|
-
- gzip, deflate
|
32
|
-
User-Agent:
|
33
|
-
- Ruby
|
34
|
-
response:
|
35
|
-
status:
|
36
|
-
code: 200
|
37
|
-
message: OK
|
38
|
-
headers:
|
39
|
-
Content-Type:
|
40
|
-
- application/json
|
41
|
-
Date:
|
42
|
-
- Fri, 08 May 2015 10:35:37 GMT
|
43
|
-
Transfer-Encoding:
|
44
|
-
- chunked
|
45
|
-
body:
|
46
|
-
encoding: UTF-8
|
47
|
-
string: |-
|
48
|
-
{
|
49
|
-
"kind": "Pod",
|
50
|
-
"apiVersion": "v1",
|
51
|
-
"metadata": {
|
52
|
-
"name": "journald-pod-name",
|
53
|
-
"generateName": "journald-pod-name-",
|
54
|
-
"namespace": "journald-namespace-name",
|
55
|
-
"selfLink": "/api/v1/namespaces/journald-namespace-name/pods/journald-pod-name",
|
56
|
-
"uid": "5e1c1e27-b637-4e81-80b6-6d8a8c404d3b",
|
57
|
-
"resourceVersion": "122",
|
58
|
-
"creationTimestamp": "2015-05-08T09:22:42Z",
|
59
|
-
"labels": {
|
60
|
-
"component": "journald-test"
|
61
|
-
}
|
62
|
-
},
|
63
|
-
"spec": {
|
64
|
-
"containers": [
|
65
|
-
{
|
66
|
-
"name": "journald-container-name",
|
67
|
-
"image": "journald-container-image:latest",
|
68
|
-
"terminationMessagePath": "/dev/termination-log",
|
69
|
-
"imagePullPolicy": "IfNotPresent",
|
70
|
-
"capabilities": {}
|
71
|
-
}
|
72
|
-
],
|
73
|
-
"nodeName": "jimmi-redhat.localnet"
|
74
|
-
},
|
75
|
-
"status": {
|
76
|
-
"phase": "Running",
|
77
|
-
"Condition": [
|
78
|
-
{
|
79
|
-
"type": "Ready",
|
80
|
-
"status": "True"
|
81
|
-
}
|
82
|
-
],
|
83
|
-
"hostIP": "172.17.42.1",
|
84
|
-
"podIP": "172.17.0.8",
|
85
|
-
"containerStatuses": [
|
86
|
-
{
|
87
|
-
"name": "journald-container-name",
|
88
|
-
"state": {
|
89
|
-
"running": {
|
90
|
-
"startedAt": "2015-05-08T09:22:44Z"
|
91
|
-
}
|
92
|
-
},
|
93
|
-
"lastState": {},
|
94
|
-
"ready": true,
|
95
|
-
"restartCount": 0,
|
96
|
-
"image": "journald-container-image:latest",
|
97
|
-
"imageID": "docker://dda4c95705fb7050b701b10a7fe928ca5bc971a1dcb521ae3c339194cbf36b47",
|
98
|
-
"containerID": "docker://838350c64bacba968d39a30a50789b2795291fceca6ccbff55298671d46b0e3b"
|
99
|
-
}
|
100
|
-
]
|
101
|
-
}
|
102
|
-
}
|
103
|
-
http_version:
|
104
|
-
recorded_at: Fri, 08 May 2015 10:35:37 GMT
|
105
|
-
- request:
|
106
|
-
method: get
|
107
|
-
uri: https://localhost:8443/api/v1/namespaces/journald-namespace-name
|
108
|
-
body:
|
109
|
-
encoding: US-ASCII
|
110
|
-
string: ''
|
111
|
-
headers:
|
112
|
-
Accept:
|
113
|
-
- "*/*; q=0.5, application/xml"
|
114
|
-
Accept-Encoding:
|
115
|
-
- gzip, deflate
|
116
|
-
User-Agent:
|
117
|
-
- Ruby
|
118
|
-
response:
|
119
|
-
status:
|
120
|
-
code: 200
|
121
|
-
message: OK
|
122
|
-
headers:
|
123
|
-
Content-Type:
|
124
|
-
- application/json
|
125
|
-
Date:
|
126
|
-
- Fri, 08 May 2015 10:35:37 GMT
|
127
|
-
Transfer-Encoding:
|
128
|
-
- chunked
|
129
|
-
body:
|
130
|
-
encoding: UTF-8
|
131
|
-
string: |-
|
132
|
-
{
|
133
|
-
"kind": "Namespace",
|
134
|
-
"apiVersion": "v1",
|
135
|
-
"metadata": {
|
136
|
-
"name": "journald-namespace-name",
|
137
|
-
"selfLink": "/api/v1/namespaces/journald-namespace-name",
|
138
|
-
"uid": "8282888f-733f-4f23-a3d3-1fdfa3bdacf2",
|
139
|
-
"resourceVersion": "6",
|
140
|
-
"creationTimestamp": "2015-05-08T09:22:01Z"
|
141
|
-
},
|
142
|
-
"spec": {
|
143
|
-
"finalizers": [
|
144
|
-
"kubernetes"
|
145
|
-
]
|
146
|
-
},
|
147
|
-
"status": {
|
148
|
-
"phase": "Active"
|
149
|
-
}
|
150
|
-
}
|
151
|
-
http_version:
|
152
|
-
recorded_at: Fri, 08 May 2015 10:35:37 GMT
|
153
|
-
recorded_with: VCR 2.9.3
|