Skip to content
This repository was archived by the owner on Sep 26, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions .circleci/build_and_push_to_dockerhub.sh

This file was deleted.

11 changes: 0 additions & 11 deletions .circleci/build_and_push_to_github_release.sh

This file was deleted.

26 changes: 0 additions & 26 deletions .circleci/check_version_trigger_release.sh

This file was deleted.

67 changes: 1 addition & 66 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,47 +66,6 @@ jobs:
name: trigger
command: |
.circleci/trigger_func_test.sh develop
release:
docker:
- image: circleci/ruby:2.6.1-node-browsers
working_directory: ~/repo
steps:
- attach_workspace:
at: /tmp
- checkout
- setup_remote_docker:
reusable: true
- run:
name: Install dependencies
command: |
.circleci/install_dep.sh
- run:
name: Build and push docker image to dockerhub
command: |
.circleci/build_and_push_to_dockerhub.sh
- run:
name: Upload gem to Github
command: |
.circleci/build_and_push_to_github_release.sh
- run:
name: Upload gem to Ruby Gem
command: |
.circleci/push_gems_to_rubygems.sh

check_version:
docker:
- image: circleci/ruby:2.6.1-node-browsers
working_directory: ~/repo
steps:
- attach_workspace:
at: /tmp
- checkout
- setup_remote_docker:
reusable: true
- run:
name: Check VERSION file for change
command: |
.circleci/check_version_trigger_release.sh

workflows:
version: 2
Expand All @@ -126,28 +85,4 @@ workflows:
- unit_test
- func_test_develop:
requires:
- unit_test
- check_version:
requires:
- unit_test
filters:
branches:
only: develop
release:
jobs:
- build:
filters:
branches:
only: master
- unit_test:
requires:
- build
- func_test_master:
requires:
- unit_test
- func_test_develop:
requires:
- unit_test
- release:
requires:
- unit_test
- unit_test
2 changes: 0 additions & 2 deletions .circleci/gem_credentials

This file was deleted.

8 changes: 0 additions & 8 deletions .circleci/push_gem.sh

This file was deleted.

7 changes: 0 additions & 7 deletions .circleci/push_gems_to_rubygems.sh

This file was deleted.

1 change: 1 addition & 0 deletions .circleci/trigger_func_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ curl -X POST --header "Content-Type: application/json" \
-d '{"build_parameters": {"CIRCLE_JOB":"build_test", "TRIG_BRANCH":"'"$CIRCLE_BRANCH"'", "TRIG_PROJECT":"'"$CIRCLE_PROJECT_REPONAME"'", "TRIG_REPO":"'"$CIRCLE_REPOSITORY_URL"'"}}' "https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/tree/$BRANCH?circle-token=$CIRCLE_TOKEN" > build.json
cat build.json
BUILD_NUM=$(jq -r .build_num build.json)
sleep 10

# Wait until finish or maximum 20 minutes
TIMEOUT=20
Expand Down
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ GEM
http-parser (1.2.1)
ffi-compiler (>= 1.0, < 2.0)
http_parser.rb (0.5.3)
json (2.1.0)
json (2.3.1)
kubeclient (4.6.0)
http (>= 3.0, < 5.0)
recursive-open-struct (~> 1.0, >= 1.0.4)
Expand Down
19 changes: 15 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
VERSION := $(shell sh -c 'cat VERSION')

clean:
@rm -rf pkg/* docker/gem/ docker/gems/ docker/*.gem docker/licenses
clean_pkg:
@rm -rf pkg/* docker/*.gem

build: clean
clean_gems:
@rm -rf docker/gem/ docker/gems/

clean: clean_pkg clean_gems
@rm -rf docker/licenses

build: clean_pkg
@bundle exec rake build

docker: build install-deps
Expand All @@ -18,4 +24,9 @@ unit-test:
install-deps:
@gem install bundler
@bundle update --bundler
@bundle install
@bundle install

unpack: build
@cp pkg/fluent-plugin-*.gem docker
@gem unpack docker/fluent-plugin-*.gem --target docker/gem
@cd docker && bundle install
2 changes: 1 addition & 1 deletion docker/Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ gem 'bigdecimal', '=2.0.0'
gem 'kubeclient', '=4.6.0'
gem 'http_parser.rb', '=0.5.3'

gem "fluent-plugin-splunk-hec", "~> 1.2"
gem "fluent-plugin-splunk-hec", "= 1.2.3"
gem 'fluent-plugin-kubernetes-metrics', path: 'gem/'
28 changes: 15 additions & 13 deletions docker/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
PATH
remote: gem
specs:
fluent-plugin-kubernetes-metrics (1.1.3)
fluentd (~> 1.9.1)
kubeclient (~> 4.6.0)
multi_json (~> 1.14.1)
oj (~> 3.10.2)

GEM
remote: https://rubygems.org/
specs:
Expand Down Expand Up @@ -26,20 +35,13 @@ GEM
fluent-plugin-jq (0.5.1)
fluentd (>= 0.14.10, < 2)
multi_json (~> 1.13)
fluent-plugin-kubernetes_metadata_filter (2.4.2)
fluentd (>= 0.14.0, < 2)
kubeclient (< 5)
lru_redux
fluent-plugin-prometheus (1.7.0)
fluentd (>= 0.14.20, < 2)
prometheus-client (< 0.10)
fluent-plugin-record-modifier (2.1.0)
fluentd (>= 1.0, < 2)
fluent-plugin-splunk-hec (1.2.1)
activesupport (~> 5.2)
fluent-plugin-kubernetes_metadata_filter (~> 2.4.2)
fluent-plugin-splunk-hec (1.2.3)
fluentd (>= 1.4)
http_parser.rb (= 0.5.3)
multi_json (~> 1.13)
net-http-persistent (~> 3.1)
openid_connect (~> 1.1.8)
Expand Down Expand Up @@ -77,7 +79,6 @@ 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)
Expand Down Expand Up @@ -105,13 +106,13 @@ GEM
quantile (~> 0.2.1)
public_suffix (4.0.3)
quantile (0.2.1)
rack (2.2.2)
rack-oauth2 (1.10.1)
rack (2.2.3)
rack-oauth2 (1.16.0)
activesupport
attr_required
httpclient
json-jwt (>= 1.11.0)
rack
rack (>= 2.1.0)
rake (13.0.1)
recursive-open-struct (1.1.0)
rest-client (2.1.0)
Expand Down Expand Up @@ -152,9 +153,10 @@ 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)
fluent-plugin-splunk-hec (= 1.2.3)
fluentd (= 1.9.1)
http_parser.rb (= 0.5.3)
kubeclient (= 4.6.0)
Expand Down
6 changes: 3 additions & 3 deletions lib/fluent/plugin/in_kubernetes_metrics.rb
Original file line number Diff line number Diff line change
Expand Up @@ -202,11 +202,11 @@ def initialize_rest_client
if env_host && env_port
if @use_rest_client_ssl
@kubelet_url = "https://#{env_host}:#{env_port}/stats/summary"
@kubelet_url_stats = "https://#{env_host}:#{env_port}/stats/"
@kubelet_url_stats = "https://#{env_host}:#{env_port}/stats"
@cadvisor_url = "https://#{env_host}:#{env_port}/metrics/cadvisor"
else
@kubelet_url = "http://#{env_host}:#{env_port}/stats/summary"
@kubelet_url_stats = "http://#{env_host}:#{env_port}/stats/"
@kubelet_url_stats = "http://#{env_host}:#{env_port}/stats"
@cadvisor_url = "http://#{env_host}:#{env_port}/metrics/cadvisor"
end
end
Expand Down Expand Up @@ -275,7 +275,7 @@ def stats_proxy_api(node)
@stats_api =
begin
@client.discover unless @client.discovered
@client.rest_client["/nodes/#{node}:#{@kubelet_port}/proxy/stats/"].tap do |endpoint|
@client.rest_client["/nodes/#{node}:#{@kubelet_port}/proxy/stats"].tap do |endpoint|
log.info("Use URL #{endpoint.url} for scraping stats metrics")
end
end
Expand Down
4 changes: 2 additions & 2 deletions test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def kubelet_summary_api_url
end

def kubelet_stats_api_url
'http://generics-aws-node-name:10255/stats/'
'http://generics-aws-node-name:10255/stats'
end

def kubelet_cadvisor_api_url
Expand Down Expand Up @@ -113,7 +113,7 @@ def stub_metrics_stats

def stub_metrics_proxy_stats
open(File.expand_path('stats.json', __dir__)).tap do |f|
stub_request(:get, "#{k8s_url}/v1/nodes/generics-aws-node-name:10255/proxy/stats/")
stub_request(:get, "#{k8s_url}/v1/nodes/generics-aws-node-name:10255/proxy/stats")
.to_return(body: f.read)
end.close
end
Expand Down