diff --git a/.circleci/build_and_push_to_dockerhub.sh b/.circleci/build_and_push_to_dockerhub.sh index 4a9765c..3c12bd1 100755 --- a/.circleci/build_and_push_to_dockerhub.sh +++ b/.circleci/build_and_push_to_dockerhub.sh @@ -2,10 +2,10 @@ set -e echo "Building docker image..." cp /tmp/pkg/fluent-plugin-kubernetes-metrics-*.gem docker +VERSION=`cat VERSION` echo "Copying licenses to be included in the docker image..." mkdir docker/licenses cp -rp LICENSE docker/licenses/ -VERSION=`cat VERSION` docker build --build-arg VERSION=$VERSION --no-cache -t splunk/fluent-plugin-kubernetes-metrics:ci ./docker docker tag splunk/fluent-plugin-kubernetes-metrics:ci splunk/${DOCKERHUB_REPO_NAME}:${VERSION} docker tag splunk/fluent-plugin-kubernetes-metrics:ci splunk/${DOCKERHUB_REPO_NAME}:latest diff --git a/.gitignore b/.gitignore index a21f250..1f2a87d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ pkg coverage/ .idea/ docker/gems/ +docker/gem/ docker/licenses/ /.bundle/ docker/.bundle/ \ No newline at end of file diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 79507e8..2414ce1 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -2,7 +2,7 @@ Fluentd Plugin for Kubernetes Metrics is developed by Splunkers and the open-source community. -We thank all of our [contributors](https://github.com/splunk/fluent-plugin-kubernetes-objects/graphs/contributors)! +We thank all of our [contributors](https://github.com/splunk/fluent-plugin-kubernetes-metrics/graphs/contributors)! **For the detailed history of contributions** of a given file, try diff --git a/Rakefile b/Rakefile index a1eb595..4793b50 100644 --- a/Rakefile +++ b/Rakefile @@ -23,7 +23,6 @@ namespace :docker do task :build, [:tag] => :build do |_t, args| raise 'Argument `tag` was not provided.' unless args.tag - cp Dir['pkg/fluent-plugin-kubernetes-metrics-*.gem'], 'docker/' sh "docker build --build-arg VERSION=$(cat VERSION) --no-cache -t splunk/connect-for-kubernetes:#{args.tag} ./docker" end end diff --git a/docker/Dockerfile b/docker/Dockerfile index 811b812..c7049b0 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -22,13 +22,13 @@ COPY licenses /licenses COPY Gemfile* ./ RUN gem install bundler \ - && bundle install \ - && bundle exec gem install /tmp/*.gem + && gem unpack /tmp/*.gem --target gem \ + && bundle install RUN groupadd -r $FLUENT_USER && \ useradd -r -g $FLUENT_USER $FLUENT_USER && \ - mkdir -p /fluentd/log fluentd/etc /fluentd/plugins &&\ + mkdir -p /fluentd/log /fluentd/etc /fluentd/plugins && \ chown -R $FLUENT_USER /fluentd && chgrp -R $FLUENT_USER /fluentd USER $FLUENT_USER -CMD exec fluentd -c /fluentd/etc/fluent.conf +CMD bundle exec fluentd -c /fluentd/etc/fluent.conf diff --git a/docker/Gemfile b/docker/Gemfile index 538f8f7..c19f4dd 100644 --- a/docker/Gemfile +++ b/docker/Gemfile @@ -15,3 +15,5 @@ gem 'kubeclient', '=4.6.0' gem 'http_parser.rb', '=0.5.3' gem "fluent-plugin-splunk-hec", "= 1.2.1" + +gem "fluent-plugin-kubernetes-metrics", path: "gem/" \ No newline at end of file diff --git a/docker/Gemfile.lock b/docker/Gemfile.lock index ba3807d..fee3f76 100644 --- a/docker/Gemfile.lock +++ b/docker/Gemfile.lock @@ -1,3 +1,13 @@ +PATH + remote: gem + specs: + fluent-plugin-kubernetes-metrics (1.1.3) + fluentd (~> 1.9.1) + http_parser.rb (= 0.5.3) + kubeclient (~> 4.6.0) + multi_json (~> 1.14.1) + oj (~> 3.10.2) + GEM remote: https://rubygems.org/ specs: @@ -152,6 +162,7 @@ PLATFORMS DEPENDENCIES bigdecimal (= 2.0.0) fluent-plugin-jq (= 0.5.1) + fluent-plugin-kubernetes-metrics! fluent-plugin-prometheus (= 1.7.0) fluent-plugin-record-modifier (= 2.1.0) fluent-plugin-splunk-hec (= 1.2.1) diff --git a/docker/README.md b/docker/README.md index 78cf954..eb64953 100644 --- a/docker/README.md +++ b/docker/README.md @@ -1,4 +1,4 @@ # Docker Image for Splunk Connect for Kubernetes Fluentd with input plugin for k8s metrics # To Build -`docker build --build-arg VERSION=$(cat VERSION) --no-cache -t splunk/fluent-plugin-kubernetes-metrics:ci ./docker` \ No newline at end of file +`docker build --build-arg VERSION=$(cat VERSION) -t splunk/splunk/k8s-metrics:local ./docker` \ No newline at end of file diff --git a/docker/build.sh b/docker/build.sh index 8ef4c2b..ce52ac0 100755 --- a/docker/build.sh +++ b/docker/build.sh @@ -16,4 +16,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 --build-arg VERSION=$VERSION --no-cache -t splunk/k8s-metrics:$TAG ./docker +docker build --build-arg VERSION=$VERSION --no-cache -t splunk/k8s-metrics:$TAG ./docker \ No newline at end of file