fluent-plugin-k8s-metrics-agg 1.1.12 → 1.2.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: 7c2f3bb6503bba97da9447d76d92c2d7c74e8c945b1e3ef47f14798ebbe9b739
4
- data.tar.gz: d77545222c199151249bc6925ae0f74a085b564263004a898c8342bc1d4c88bc
3
+ metadata.gz: 565444ab4272096fd6512f642d8316a757e0b4e4db092495dc238315f75090a0
4
+ data.tar.gz: a7c63569ce9fae8178319caa8e89c8c4927f153d5a36ae2a98bf1cee7eec2836
5
5
  SHA512:
6
- metadata.gz: 5c2df1c502cf7770684340151f09771ea9651d042359f026708677792539af870ca185aee0ecc9e56a54ea2e19f4de9a51f4c6b9a2e06b1846dc3149a396f45c
7
- data.tar.gz: f6865ac8416c44d4c221e49f8a26ae1e88776094414b0847d2c6cbc77499d76c120cf12631c18145e89388116c8c3d5aac12bdcb5baefe09676ef50b650f2db6
6
+ metadata.gz: 9d0e86b6d56f3ddbcbe94141a3263568b4640c189ebd6ed759dd738b619ae47800d91714e70d683eaa1b909b4cbc553d6aaa60263ed803c327b6cfb759fc6003
7
+ data.tar.gz: 7be1e3c1c52566ae81f6c5a7deaa7d79a999f27e44b43e1a83d3f2962556776aba87468dd3fdab818076c16c7fbcb389581a2fdf5dc2016ec1ddda986fff2d52
data/.fossa.yml ADDED
@@ -0,0 +1,5 @@
1
+ version: 3
2
+ server: https://app.fossa.com
3
+ project:
4
+ id: "fluent-plugin-k8s-metrics-agg"
5
+ team: "TA-Automation"
@@ -194,3 +194,36 @@ jobs:
194
194
  --splunk-password $CI_SPLUNK_PASSWORD \
195
195
  --nodes-count $MINIKUBE_NODE_COUNTS\
196
196
  -p no:warnings -s -n auto
197
+ fossa-scan:
198
+ continue-on-error: true
199
+ runs-on: ubuntu-latest
200
+ steps:
201
+ - uses: actions/checkout@v3
202
+ - name: run fossa anlyze and create report
203
+ run: |
204
+ curl -H 'Cache-Control: no-cache' https://raw.githubusercontent.com/fossas/fossa-cli/master/install-latest.sh | bash
205
+ fossa analyze --include-unused-deps --debug
206
+ fossa report attribution --format text > /tmp/THIRDPARTY
207
+ env:
208
+ FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
209
+ - name: upload THIRDPARTY file
210
+ uses: actions/upload-artifact@v2
211
+ with:
212
+ name: THIRDPARTY
213
+ path: /tmp/THIRDPARTY
214
+ - name: run fossa test
215
+ run: |
216
+ fossa test --debug
217
+ env:
218
+ FOSSA_API_KEY: ${{ secrets.FOSSA_API_KEY }}
219
+ semgrep:
220
+ runs-on: ubuntu-latest
221
+ name: security-sast-semgrep
222
+ if: github.actor != 'dependabot[bot]'
223
+ steps:
224
+ - uses: actions/checkout@v3
225
+ - name: Semgrep
226
+ id: semgrep
227
+ uses: returntocorp/semgrep-action@v1
228
+ with:
229
+ publishToken: ${{ secrets.SEMGREP_PUBLISH_TOKEN }}
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- fluent-plugin-k8s-metrics-agg (1.1.12)
4
+ fluent-plugin-k8s-metrics-agg (1.2.1)
5
5
  fluentd (>= 1.9.1)
6
6
  kubeclient (~> 4.9.3)
7
7
  multi_json (~> 1.14.1)
@@ -23,12 +23,12 @@ GEM
23
23
  ffi-compiler (1.0.1)
24
24
  ffi (>= 1.0.0)
25
25
  rake
26
- fluentd (1.14.6)
26
+ fluentd (1.15.3)
27
27
  bundler
28
28
  cool.io (>= 1.4.5, < 2.0.0)
29
29
  http_parser.rb (>= 0.5.1, < 0.9.0)
30
30
  msgpack (>= 1.3.1, < 2.0.0)
31
- serverengine (>= 2.2.5, < 3.0.0)
31
+ serverengine (>= 2.3.0, < 3.0.0)
32
32
  sigdump (~> 0.2.2)
33
33
  strptime (>= 0.2.4, < 1.0.0)
34
34
  tzinfo (>= 1.0, < 3.0)
@@ -42,14 +42,14 @@ GEM
42
42
  http-form_data (~> 2.2)
43
43
  http-parser (~> 1.2.0)
44
44
  http-accept (1.7.0)
45
- http-cookie (1.0.4)
45
+ http-cookie (1.0.5)
46
46
  domain_name (~> 0.5)
47
47
  http-form_data (2.3.0)
48
48
  http-parser (1.2.3)
49
49
  ffi-compiler (>= 1.0, < 2.0)
50
50
  http_parser.rb (0.8.0)
51
51
  json (2.6.1)
52
- jsonpath (1.1.0)
52
+ jsonpath (1.1.2)
53
53
  multi_json
54
54
  kubeclient (4.9.3)
55
55
  http (>= 3.0, < 5.0)
@@ -59,7 +59,7 @@ GEM
59
59
  mime-types (3.4.1)
60
60
  mime-types-data (~> 3.2015)
61
61
  mime-types-data (3.2022.0105)
62
- msgpack (1.5.1)
62
+ msgpack (1.6.0)
63
63
  multi_json (1.14.1)
64
64
  netrc (0.11.0)
65
65
  oj (3.10.18)
@@ -73,7 +73,7 @@ GEM
73
73
  mime-types (>= 1.16, < 4.0)
74
74
  netrc (~> 0.8)
75
75
  rexml (3.2.5)
76
- serverengine (2.2.5)
76
+ serverengine (2.3.0)
77
77
  sigdump (~> 0.2.2)
78
78
  sigdump (0.2.4)
79
79
  simplecov (0.16.1)
@@ -84,19 +84,19 @@ GEM
84
84
  strptime (0.2.5)
85
85
  test-unit (3.3.9)
86
86
  power_assert
87
- tzinfo (2.0.4)
87
+ tzinfo (2.0.5)
88
88
  concurrent-ruby (~> 1.0)
89
- tzinfo-data (1.2022.1)
89
+ tzinfo-data (1.2022.6)
90
90
  tzinfo (>= 1.0.0)
91
91
  unf (0.1.4)
92
92
  unf_ext
93
- unf_ext (0.0.8.1)
93
+ unf_ext (0.0.8.2)
94
94
  webmock (3.5.1)
95
95
  addressable (>= 2.3.6)
96
96
  crack (>= 0.3.2)
97
97
  hashdiff
98
98
  webrick (1.7.0)
99
- yajl-ruby (1.4.2)
99
+ yajl-ruby (1.4.3)
100
100
 
101
101
  PLATFORMS
102
102
  ruby
@@ -110,4 +110,4 @@ DEPENDENCIES
110
110
  webmock (~> 3.5.1)
111
111
 
112
112
  BUNDLED WITH
113
- 2.3.12
113
+ 2.3.26
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.1.12
1
+ 1.2.1
data/docker/Dockerfile CHANGED
@@ -46,7 +46,8 @@ RUN yum update -y \
46
46
  RUN groupadd -r $FLUENT_USER && \
47
47
  useradd -r -g $FLUENT_USER $FLUENT_USER && \
48
48
  mkdir -p /fluentd/log /fluentd/etc /fluentd/plugins &&\
49
- chown -R $FLUENT_USER /fluentd && chgrp -R $FLUENT_USER /fluentd
49
+ chown -R $FLUENT_USER /fluentd && chgrp -R $FLUENT_USER /fluentd && \
50
+ chmod +t /tmp
50
51
 
51
52
  USER $FLUENT_USER
52
53
  CMD bundle exec fluentd -c /fluentd/etc/fluent.conf
data/docker/Gemfile CHANGED
@@ -3,16 +3,16 @@ source 'https://rubygems.org'
3
3
  # This is separate gemfile for building docker image that has all plugins
4
4
  # for kubernetes log collection agent
5
5
  # List all required gems here and install via bundler to resolve dependencies
6
- gem "fluentd", ">=1.14.2"
6
+ gem "fluentd", ">=1.15"
7
7
  gem "fluent-plugin-prometheus", ">=2.0"
8
8
  gem "fluent-plugin-record-modifier", "=2.1.0"
9
- gem "fluent-plugin-kubernetes_metadata_filter", ">=2.9.2"
10
9
  gem "kubeclient", "=4.9.3"
11
- gem "oj", "=3.10.2"
12
- gem 'multi_json', '=1.14.1'
10
+ gem "oj", "~>3.10"
11
+ gem 'multi_json', '~>1.14'
13
12
  gem 'http_parser.rb', '=0.8.0'
14
13
  gem 'bigdecimal', '=3.0.0'
14
+ gem 'rack', '>= 3.0.0'
15
15
 
16
- gem "fluent-plugin-splunk-hec", ">= 1.2.7"
16
+ gem "fluent-plugin-splunk-hec", "= 1.3.1"
17
17
 
18
18
  gem 'fluent-plugin-k8s-metrics-agg', path: 'gem/'
data/docker/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: gem
3
3
  specs:
4
- fluent-plugin-k8s-metrics-agg (1.1.12)
4
+ fluent-plugin-k8s-metrics-agg (1.2.1)
5
5
  fluentd (>= 1.9.1)
6
6
  kubeclient (~> 4.9.3)
7
7
  multi_json (~> 1.14.1)
@@ -10,9 +10,9 @@ PATH
10
10
  GEM
11
11
  remote: https://rubygems.org/
12
12
  specs:
13
- activemodel (7.0.2.4)
14
- activesupport (= 7.0.2.4)
15
- activesupport (7.0.2.4)
13
+ activemodel (7.0.4)
14
+ activesupport (= 7.0.4)
15
+ activesupport (7.0.4)
16
16
  concurrent-ruby (~> 1.0, >= 1.0.2)
17
17
  i18n (>= 1.6, < 2)
18
18
  minitest (>= 5.1)
@@ -22,37 +22,41 @@ GEM
22
22
  aes_key_wrap (1.1.0)
23
23
  attr_required (1.0.1)
24
24
  bigdecimal (3.0.0)
25
- bindata (2.4.10)
25
+ bindata (2.4.14)
26
26
  concurrent-ruby (1.1.10)
27
- connection_pool (2.2.5)
27
+ connection_pool (2.3.0)
28
28
  cool.io (1.7.1)
29
29
  domain_name (0.5.20190701)
30
30
  unf (>= 0.0.5, < 1.0.0)
31
+ faraday (2.7.1)
32
+ faraday-net_http (>= 2.0, < 3.1)
33
+ ruby2_keywords (>= 0.0.4)
34
+ faraday-follow_redirects (0.3.0)
35
+ faraday (>= 1, < 3)
36
+ faraday-net_http (3.0.2)
31
37
  ffi (1.15.5)
32
38
  ffi-compiler (1.0.1)
33
39
  ffi (>= 1.0.0)
34
40
  rake
35
- fluent-plugin-kubernetes_metadata_filter (2.9.5)
36
- fluentd (>= 0.14.0, < 1.15)
37
- kubeclient (>= 4.0.0, < 5.0.0)
38
- lru_redux
39
41
  fluent-plugin-prometheus (2.0.2)
40
42
  fluentd (>= 1.9.1, < 2)
41
43
  prometheus-client (>= 2.1.0)
42
44
  fluent-plugin-record-modifier (2.1.0)
43
45
  fluentd (>= 1.0, < 2)
44
- fluent-plugin-splunk-hec (1.2.13)
45
- fluentd (>= 1.4)
46
+ fluent-plugin-splunk-hec (1.3.1)
47
+ fluentd (>= 1.5)
48
+ json-jwt (~> 1.15.0)
46
49
  multi_json (~> 1.13)
47
50
  net-http-persistent (~> 4.0)
48
51
  openid_connect (~> 1.1.8)
49
52
  prometheus-client (>= 2.1.0)
50
- fluentd (1.14.6)
53
+ rack-oauth2 (~> 1.19)
54
+ fluentd (1.15.3)
51
55
  bundler
52
56
  cool.io (>= 1.4.5, < 2.0.0)
53
57
  http_parser.rb (>= 0.5.1, < 0.9.0)
54
58
  msgpack (>= 1.3.1, < 2.0.0)
55
- serverengine (>= 2.2.5, < 3.0.0)
59
+ serverengine (>= 2.3.0, < 3.0.0)
56
60
  sigdump (~> 0.2.2)
57
61
  strptime (>= 0.2.4, < 1.0.0)
58
62
  tzinfo (>= 1.0, < 3.0)
@@ -72,12 +76,13 @@ GEM
72
76
  ffi-compiler (>= 1.0, < 2.0)
73
77
  http_parser.rb (0.8.0)
74
78
  httpclient (2.8.3)
75
- i18n (1.10.0)
79
+ i18n (1.12.0)
76
80
  concurrent-ruby (~> 1.0)
77
- json-jwt (1.13.0)
81
+ json-jwt (1.15.3)
78
82
  activesupport (>= 4.2)
79
83
  aes_key_wrap
80
84
  bindata
85
+ httpclient
81
86
  jsonpath (1.1.0)
82
87
  multi_json
83
88
  kubeclient (4.9.3)
@@ -85,15 +90,14 @@ GEM
85
90
  jsonpath (~> 1.0)
86
91
  recursive-open-struct (~> 1.1, >= 1.1.1)
87
92
  rest-client (~> 2.0)
88
- lru_redux (1.1.0)
89
93
  mail (2.7.1)
90
94
  mini_mime (>= 0.1.1)
91
95
  mime-types (3.4.1)
92
96
  mime-types-data (~> 3.2015)
93
97
  mime-types-data (3.2022.0105)
94
98
  mini_mime (1.1.2)
95
- minitest (5.15.0)
96
- msgpack (1.5.1)
99
+ minitest (5.16.3)
100
+ msgpack (1.6.0)
97
101
  multi_json (1.14.1)
98
102
  net-http-persistent (4.0.1)
99
103
  connection_pool (~> 2.2)
@@ -111,8 +115,8 @@ GEM
111
115
  webfinger (>= 1.0.1)
112
116
  prometheus-client (4.0.0)
113
117
  public_suffix (4.0.7)
114
- rack (2.2.3)
115
- rack-oauth2 (1.19.0)
118
+ rack (3.0.1)
119
+ rack-oauth2 (1.21.3)
116
120
  activesupport
117
121
  attr_required
118
122
  httpclient
@@ -125,17 +129,19 @@ GEM
125
129
  http-cookie (>= 1.0.2, < 2.0)
126
130
  mime-types (>= 1.16, < 4.0)
127
131
  netrc (~> 0.8)
128
- serverengine (2.2.5)
132
+ ruby2_keywords (0.0.5)
133
+ serverengine (2.3.0)
129
134
  sigdump (~> 0.2.2)
130
135
  sigdump (0.2.4)
131
136
  strptime (0.2.5)
132
- swd (1.3.0)
137
+ swd (2.0.2)
133
138
  activesupport (>= 3)
134
139
  attr_required (>= 0.0.5)
135
- httpclient (>= 2.4)
136
- tzinfo (2.0.4)
140
+ faraday (~> 2.0)
141
+ faraday-follow_redirects
142
+ tzinfo (2.0.5)
137
143
  concurrent-ruby (~> 1.0)
138
- tzinfo-data (1.2022.1)
144
+ tzinfo-data (1.2022.6)
139
145
  tzinfo (>= 1.0.0)
140
146
  unf (0.1.4)
141
147
  unf_ext
@@ -143,14 +149,15 @@ GEM
143
149
  validate_email (0.1.6)
144
150
  activemodel (>= 3.0)
145
151
  mail (>= 2.2.5)
146
- validate_url (1.0.13)
152
+ validate_url (1.0.15)
147
153
  activemodel (>= 3.0.0)
148
154
  public_suffix
149
- webfinger (1.2.0)
155
+ webfinger (2.1.2)
150
156
  activesupport
151
- httpclient (>= 2.4)
157
+ faraday (~> 2.0)
158
+ faraday-follow_redirects
152
159
  webrick (1.7.0)
153
- yajl-ruby (1.4.2)
160
+ yajl-ruby (1.4.3)
154
161
 
155
162
  PLATFORMS
156
163
  ruby
@@ -158,15 +165,15 @@ PLATFORMS
158
165
  DEPENDENCIES
159
166
  bigdecimal (= 3.0.0)
160
167
  fluent-plugin-k8s-metrics-agg!
161
- fluent-plugin-kubernetes_metadata_filter (>= 2.9.2)
162
168
  fluent-plugin-prometheus (>= 2.0)
163
169
  fluent-plugin-record-modifier (= 2.1.0)
164
- fluent-plugin-splunk-hec (>= 1.2.7)
165
- fluentd (>= 1.14.2)
170
+ fluent-plugin-splunk-hec (= 1.3.1)
171
+ fluentd (>= 1.15)
166
172
  http_parser.rb (= 0.8.0)
167
173
  kubeclient (= 4.9.3)
168
- multi_json (= 1.14.1)
169
- oj (= 3.10.2)
174
+ multi_json (~> 1.14)
175
+ oj (~> 3.10)
176
+ rack (>= 3.0.0)
170
177
 
171
178
  BUNDLED WITH
172
179
  2.1.4
@@ -15,6 +15,7 @@ require 'time'
15
15
  require 'fluent/plugin/input'
16
16
  require 'kubeclient'
17
17
  require 'multi_json'
18
+ require 'resolv'
18
19
  module Fluent
19
20
  module Plugin
20
21
  class KubernetesMetricsAggregatorInput < Fluent::Plugin::Input
@@ -177,6 +178,10 @@ module Fluent
177
178
 
178
179
  private
179
180
 
181
+ def update_kubeclient_header
182
+ @client.headers[:Authorization] = 'Bearer ' + File.read(@bearer_token_file) if @bearer_token_file
183
+ end
184
+
180
185
  def parse_tag
181
186
  @tag_prefix, @tag_suffix = @tag.split('*') if @tag.include?('*')
182
187
  end
@@ -207,6 +212,7 @@ module Fluent
207
212
  if @kubernetes_url.nil?
208
213
  # Use Kubernetes default service account if we're in a pod.
209
214
  env_host = ENV['KUBERNETES_SERVICE_HOST']
215
+ env_host = "[#{env_host}]" if env_host =~ Resolv::IPv6::Regex
210
216
  env_port = ENV['KUBERNETES_SERVICE_PORT']
211
217
  if env_host && env_port
212
218
  kubernetes_url_final = "https://#{env_host}:#{env_port}/api/"
@@ -371,6 +377,7 @@ module Fluent
371
377
  end
372
378
 
373
379
  def scrape_limits_requests_metrics
380
+ update_kubeclient_header
374
381
  response = limits_requests_api.get(@client.headers)
375
382
  handle_limits_requests_res(response)
376
383
  rescue StandardError => e
@@ -473,6 +480,7 @@ module Fluent
473
480
  end
474
481
 
475
482
  def scrape_node_metrics
483
+ update_kubeclient_header
476
484
  response = node_api.get(@client.headers)
477
485
  handle_node_response(response)
478
486
  rescue StandardError => e
@@ -556,6 +564,7 @@ module Fluent
556
564
  end
557
565
 
558
566
  def scrape_resource_usage_metrics
567
+ update_kubeclient_header
559
568
  response = resource_usage_api.get(@client.headers)
560
569
  handle_resource_usage_response(response)
561
570
  rescue StandardError => e
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fluent-plugin-k8s-metrics-agg
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.12
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Splunk Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-29 00:00:00.000000000 Z
11
+ date: 2022-11-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -144,6 +144,7 @@ executables: []
144
144
  extensions: []
145
145
  extra_rdoc_files: []
146
146
  files:
147
+ - ".fossa.yml"
147
148
  - ".github/ISSUE_TEMPLATE/bug_report.md"
148
149
  - ".github/ISSUE_TEMPLATE/enhancement_request.md"
149
150
  - ".github/ISSUE_TEMPLATE/failing_test.md"