diff --git a/Gemfile.lock b/Gemfile.lock index 80476d6..3e9602a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,8 +1,8 @@ PATH remote: . specs: - fluent-plugin-kubernetes-metrics (1.1.4) - fluentd (~> 1.9.1) + fluent-plugin-kubernetes-metrics (1.1.5) + fluentd (>= 1.9.1) kubeclient (~> 4.6.0) multi_json (~> 1.14.1) oj (~> 3.10.2) @@ -10,31 +10,32 @@ PATH GEM remote: https://rubygems.org/ specs: - addressable (2.6.0) - public_suffix (>= 2.0.2, < 4.0) - concurrent-ruby (1.1.6) - cool.io (1.6.0) - crack (0.4.3) - safe_yaml (~> 1.0.0) - docile (1.3.1) + addressable (2.7.0) + public_suffix (>= 2.0.2, < 5.0) + concurrent-ruby (1.1.8) + cool.io (1.7.1) + crack (0.4.5) + rexml + docile (1.3.5) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - ffi (1.12.2) + ffi (1.14.2) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake - fluentd (1.9.2) + fluentd (1.12.1) + bundler cool.io (>= 1.4.5, < 2.0.0) http_parser.rb (>= 0.5.1, < 0.7.0) msgpack (>= 1.3.1, < 2.0.0) - serverengine (>= 2.0.4, < 3.0.0) + serverengine (>= 2.2.2, < 3.0.0) sigdump (~> 0.2.2) strptime (>= 0.2.2, < 1.0.0) tzinfo (>= 1.0, < 3.0) tzinfo-data (~> 1.0) yajl-ruby (~> 1.0) - hashdiff (0.3.8) - http (4.3.0) + hashdiff (1.0.1) + http (4.4.1) addressable (~> 2.3) http-cookie (~> 1.0) http-form_data (~> 2.2) @@ -42,33 +43,33 @@ GEM http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) - http-form_data (2.2.0) - http-parser (1.2.1) + http-form_data (2.3.0) + http-parser (1.2.3) ffi-compiler (>= 1.0, < 2.0) http_parser.rb (0.6.0) - json (2.3.1) + json (2.5.1) kubeclient (4.6.0) http (>= 3.0, < 5.0) recursive-open-struct (~> 1.0, >= 1.0.4) rest-client (~> 2.0) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2019.1009) - msgpack (1.3.3) + mime-types-data (3.2021.0225) + msgpack (1.4.2) multi_json (1.14.1) netrc (0.11.0) - oj (3.10.2) - power_assert (1.1.3) - public_suffix (3.0.3) - rake (13.0.1) - recursive-open-struct (1.1.0) + oj (3.10.18) + power_assert (2.0.0) + public_suffix (4.0.6) + rake (13.0.3) + recursive-open-struct (1.1.3) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - safe_yaml (1.0.4) - serverengine (2.2.1) + rexml (3.2.4) + serverengine (2.2.3) sigdump (~> 0.2.2) sigdump (0.2.4) simplecov (0.16.1) @@ -76,16 +77,16 @@ GEM json (>= 1.8, < 3) simplecov-html (~> 0.10.0) simplecov-html (0.10.2) - strptime (0.2.3) - test-unit (3.3.0) + strptime (0.2.5) + test-unit (3.3.9) power_assert - tzinfo (2.0.1) + tzinfo (2.0.4) concurrent-ruby (~> 1.0) - tzinfo-data (1.2019.3) + tzinfo-data (1.2021.1) tzinfo (>= 1.0.0) unf (0.1.4) unf_ext - unf_ext (0.0.7.6) + unf_ext (0.0.7.7) webmock (3.5.1) addressable (>= 2.3.6) crack (>= 0.3.2) diff --git a/Makefile b/Makefile index 1e00e3f..97cf261 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,5 @@ VERSION := $(shell sh -c 'cat VERSION') +NODEJS_VERSION := 14.15.1 clean_pkg: @rm -rf pkg/* docker/*.gem @@ -16,7 +17,7 @@ docker: build install-deps @cp pkg/fluent-plugin-*.gem docker @mkdir -p docker/licenses @cp -rp LICENSE docker/licenses/ - @docker build --no-cache --pull --build-arg VERSION=$(VERSION) -t splunk/k8s-metrics:$(VERSION) ./docker + @docker build --no-cache --pull --build-arg VERSION=$(VERSION) --build-arg NODEJS_VERSION=$(NODEJS_VERSION) -t splunk/k8s-metrics:$(VERSION) ./docker unit-test: @bundle exec rake test @@ -28,5 +29,7 @@ install-deps: unpack: build @cp pkg/fluent-plugin-*.gem docker + @mkdir -p docker/gem + @rm -rf docker/gem/* @gem unpack docker/fluent-plugin-*.gem --target docker/gem @cd docker && bundle install \ No newline at end of file diff --git a/VERSION b/VERSION index 1b87bcd..314c3d7 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.1.4 \ No newline at end of file +1.1.5 \ No newline at end of file diff --git a/docker/Dockerfile b/docker/Dockerfile index 3da286e..cd43c76 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,6 +1,7 @@ -FROM registry.access.redhat.com/ubi8/ruby-25 +FROM registry.access.redhat.com/ubi8/ruby-27 ARG VERSION +ARG NODEJS_VERSION LABEL name="Splunk Connect for Kubernetes Metrics container" \ maintainer="DataEdge@splunk.com" \ @@ -19,9 +20,13 @@ COPY *.gem /tmp/ COPY licenses /licenses COPY Gemfile* ./ -RUN gem install bundler \ +RUN yum update -y \ + && npm install -g n \ + && yum remove -y nodejs \ + && n ${NODEJS_VERSION} \ + && gem install bundler \ && gem unpack /tmp/*.gem --target gem \ - && bundle install + && bundle install RUN groupadd -r $FLUENT_USER && \ useradd -r -g $FLUENT_USER $FLUENT_USER && \ diff --git a/docker/Gemfile b/docker/Gemfile index cec790e..ad14bc0 100644 --- a/docker/Gemfile +++ b/docker/Gemfile @@ -3,16 +3,16 @@ source 'https://rubygems.org' # This is separate gemfile for building docker image that has all plugins # for kubernetes log collection agent # List all required gems here and install via bundler to resolve dependencies -gem "fluentd", "=1.9.1" -gem "fluent-plugin-prometheus", "=1.7.0" +gem "fluentd", "=1.11.5" +gem "fluent-plugin-prometheus", "=1.8.5" gem "fluent-plugin-record-modifier", "=2.1.0" - +gem "fluent-plugin-kubernetes_metadata_filter", "=2.5.3" gem "fluent-plugin-jq", "=0.5.1" -gem "oj", "=3.10.2" +gem "oj", "=3.10.18" gem 'multi_json', '=1.14.1' -gem 'bigdecimal', '=2.0.0' +gem 'bigdecimal', '=3.0.0' gem 'kubeclient', '=4.6.0' gem 'http_parser.rb', '=0.5.3' -gem "fluent-plugin-splunk-hec", "= 1.2.3" +gem "fluent-plugin-splunk-hec", ">= 1.2.5" gem 'fluent-plugin-kubernetes-metrics', path: 'gem/' \ No newline at end of file diff --git a/docker/Gemfile.lock b/docker/Gemfile.lock index 44a0f89..93bcc0b 100644 --- a/docker/Gemfile.lock +++ b/docker/Gemfile.lock @@ -1,8 +1,8 @@ PATH remote: gem specs: - fluent-plugin-kubernetes-metrics (1.1.3) - fluentd (~> 1.9.1) + fluent-plugin-kubernetes-metrics (1.1.5) + fluentd (>= 1.9.1) kubeclient (~> 4.6.0) multi_json (~> 1.14.1) oj (~> 3.10.2) @@ -10,53 +10,58 @@ PATH GEM remote: https://rubygems.org/ specs: - activemodel (5.2.4.3) - activesupport (= 5.2.4.3) - activesupport (5.2.4.3) + activemodel (6.1.3) + activesupport (= 6.1.3) + activesupport (6.1.3) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) - aes_key_wrap (1.0.1) + aes_key_wrap (1.1.0) attr_required (1.0.1) - bigdecimal (2.0.0) - bindata (2.4.5) - concurrent-ruby (1.1.6) - connection_pool (2.2.2) - cool.io (1.6.0) + bigdecimal (3.0.0) + bindata (2.4.8) + concurrent-ruby (1.1.8) + connection_pool (2.2.3) + cool.io (1.7.1) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) - ffi (1.12.2) + ffi (1.14.2) ffi-compiler (1.0.1) ffi (>= 1.0.0) rake fluent-plugin-jq (0.5.1) fluentd (>= 0.14.10, < 2) multi_json (~> 1.13) - fluent-plugin-prometheus (1.7.0) - fluentd (>= 0.14.20, < 2) + fluent-plugin-kubernetes_metadata_filter (2.5.3) + fluentd (>= 0.14.0, < 1.12) + kubeclient (< 5) + lru_redux + fluent-plugin-prometheus (1.8.5) + fluentd (>= 1.9.1, < 2) prometheus-client (< 0.10) fluent-plugin-record-modifier (2.1.0) fluentd (>= 1.0, < 2) - fluent-plugin-splunk-hec (1.2.3) + fluent-plugin-splunk-hec (1.2.5) fluentd (>= 1.4) multi_json (~> 1.13) net-http-persistent (~> 3.1) openid_connect (~> 1.1.8) prometheus-client (< 0.10.0) - fluentd (1.9.1) + fluentd (1.11.5) cool.io (>= 1.4.5, < 2.0.0) http_parser.rb (>= 0.5.1, < 0.7.0) msgpack (>= 1.3.1, < 2.0.0) - serverengine (>= 2.0.4, < 3.0.0) + serverengine (>= 2.2.2, < 3.0.0) sigdump (~> 0.2.2) strptime (>= 0.2.2, < 1.0.0) tzinfo (>= 1.0, < 3.0) tzinfo-data (~> 1.0) yajl-ruby (~> 1.0) - http (4.3.0) + http (4.4.1) addressable (~> 2.3) http-cookie (~> 1.0) http-form_data (~> 2.2) @@ -64,14 +69,14 @@ GEM http-accept (1.7.0) http-cookie (1.0.3) domain_name (~> 0.5) - http-form_data (2.2.0) - http-parser (1.2.1) + http-form_data (2.3.0) + http-parser (1.2.3) ffi-compiler (>= 1.0, < 2.0) http_parser.rb (0.5.3) httpclient (2.8.3) - i18n (1.8.2) + i18n (1.8.9) concurrent-ruby (~> 1.0) - json-jwt (1.11.0) + json-jwt (1.13.0) activesupport (>= 4.2) aes_key_wrap bindata @@ -79,19 +84,20 @@ GEM http (>= 3.0, < 5.0) recursive-open-struct (~> 1.0, >= 1.0.4) rest-client (~> 2.0) + lru_redux (1.1.0) mail (2.7.1) mini_mime (>= 0.1.1) mime-types (3.3.1) mime-types-data (~> 3.2015) - mime-types-data (3.2019.1009) + mime-types-data (3.2021.0225) mini_mime (1.0.2) - minitest (5.14.0) - msgpack (1.3.3) + minitest (5.14.4) + msgpack (1.4.2) multi_json (1.14.1) net-http-persistent (3.1.0) connection_pool (~> 2.2) netrc (0.11.0) - oj (3.10.2) + oj (3.10.18) openid_connect (1.1.8) activemodel attr_required (>= 1.0.0) @@ -104,7 +110,7 @@ GEM webfinger (>= 1.0.1) prometheus-client (0.9.0) quantile (~> 0.2.1) - public_suffix (4.0.3) + public_suffix (4.0.6) quantile (0.2.1) rack (2.2.3) rack-oauth2 (1.16.0) @@ -113,55 +119,56 @@ GEM httpclient json-jwt (>= 1.11.0) rack (>= 2.1.0) - rake (13.0.1) - recursive-open-struct (1.1.0) + rake (13.0.3) + recursive-open-struct (1.1.3) rest-client (2.1.0) http-accept (>= 1.7.0, < 2.0) http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - serverengine (2.2.1) + serverengine (2.2.3) sigdump (~> 0.2.2) sigdump (0.2.4) - strptime (0.2.3) - swd (1.1.2) + strptime (0.2.5) + swd (1.2.0) activesupport (>= 3) attr_required (>= 0.0.5) httpclient (>= 2.4) - thread_safe (0.3.6) - tzinfo (1.2.6) - thread_safe (~> 0.1) - tzinfo-data (1.2019.3) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) + tzinfo-data (1.2021.1) tzinfo (>= 1.0.0) unf (0.1.4) unf_ext - unf_ext (0.0.7.6) + unf_ext (0.0.7.7) validate_email (0.1.6) activemodel (>= 3.0) mail (>= 2.2.5) - validate_url (1.0.8) + validate_url (1.0.13) activemodel (>= 3.0.0) public_suffix webfinger (1.1.0) activesupport httpclient (>= 2.4) yajl-ruby (1.4.1) + zeitwerk (2.4.2) PLATFORMS ruby DEPENDENCIES - bigdecimal (= 2.0.0) + bigdecimal (= 3.0.0) fluent-plugin-jq (= 0.5.1) fluent-plugin-kubernetes-metrics! - fluent-plugin-prometheus (= 1.7.0) + fluent-plugin-kubernetes_metadata_filter (= 2.5.3) + fluent-plugin-prometheus (= 1.8.5) fluent-plugin-record-modifier (= 2.1.0) - fluent-plugin-splunk-hec (= 1.2.3) - fluentd (= 1.9.1) + fluent-plugin-splunk-hec (>= 1.2.5) + fluentd (= 1.11.5) http_parser.rb (= 0.5.3) kubeclient (= 4.6.0) multi_json (= 1.14.1) - oj (= 3.10.2) + oj (= 3.10.18) BUNDLED WITH 2.1.4 diff --git a/docker/build.sh b/docker/build.sh index a0601e1..fdf1ca9 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -e TAG=$1 +NODEJS_VERSION=14.15.1 # Install dependecies gem install bundler @@ -16,4 +17,4 @@ VERSION=`cat VERSION` echo "Copying licenses to be included in the docker image..." mkdir -p docker/licenses cp -rp LICENSE docker/licenses/ -docker build --no-cache --pull --build-arg VERSION=$VERSION --no-cache -t splunk/k8s-metrics:$TAG ./docker +docker build --no-cache --pull --build-arg VERSION=$VERSION --build-arg NODEJS_VERSION=$NODEJS_VERSION --no-cache -t splunk/k8s-metrics:$TAG ./docker diff --git a/fluent-plugin-kubernetes-metrics.gemspec b/fluent-plugin-kubernetes-metrics.gemspec index 3c26a72..4ae3b8d 100644 --- a/fluent-plugin-kubernetes-metrics.gemspec +++ b/fluent-plugin-kubernetes-metrics.gemspec @@ -24,7 +24,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'simplecov', '~> 0.16.1' spec.add_development_dependency 'test-unit', '~> 3.3.0' spec.add_development_dependency 'webmock', '~> 3.5.1' - spec.add_runtime_dependency 'fluentd', '~> 1.9.1' + spec.add_runtime_dependency 'fluentd', '>= 1.9.1' spec.add_runtime_dependency 'kubeclient', '~> 4.6.0' spec.add_runtime_dependency 'multi_json', '~> 1.14.1' spec.add_runtime_dependency 'oj', '~> 3.10.2'