fluent-plugin-k8s-metrics-agg 1.1.6 → 1.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/ci_build_test.yaml +192 -0
- data/Gemfile.lock +10 -10
- data/Makefile +3 -5
- data/README.md +0 -1
- data/VERSION +1 -1
- data/ci_scripts/deploy_connector.sh +29 -0
- data/{.circleci → ci_scripts}/install_dep.sh +0 -0
- data/ci_scripts/k8s-splunk.yml +31 -0
- data/docker/Dockerfile +18 -4
- data/docker/Gemfile +2 -2
- data/docker/Gemfile.lock +27 -24
- metadata +10 -9
- data/.circleci/config.yml +0 -88
- data/.circleci/trigger_func_test.sh +0 -42
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11e9b540230a927f8cb2dd469d4b16d16941c8e7cde2d4019394509c8562874e
|
4
|
+
data.tar.gz: 38e231e8cde3aa56f386c3cc835065fec257ecffe502866ae0db8e00a818f970
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 298e621affd96c9185a95e019af9bf947d4f1a81bdb850606fc9c9729ba0f7ec3072ad4df4f176e4280ae70bba1a012d59d183ecd858cc80f1c085c4b99ec44b
|
7
|
+
data.tar.gz: 3ea6fe8cd14f6820a8c3126cc8fc226b28d06786e467fdba6cbdc8d8b1445724a11406a4d28850f87685959ac59170be0e45fab8cee35570476167fb96f3f01e
|
@@ -0,0 +1,192 @@
|
|
1
|
+
name: CI Build Test
|
2
|
+
|
3
|
+
on:
|
4
|
+
pull_request:
|
5
|
+
branches-ignore:
|
6
|
+
- /^release\/.*/
|
7
|
+
- main
|
8
|
+
|
9
|
+
jobs:
|
10
|
+
build:
|
11
|
+
runs-on: ubuntu-20.04
|
12
|
+
steps:
|
13
|
+
- name: Checkout code
|
14
|
+
uses: actions/checkout@v2
|
15
|
+
|
16
|
+
- name: Setup Ruby and install gems
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
bundler-cache: true
|
20
|
+
ruby-version: 2.6.1
|
21
|
+
|
22
|
+
- name: Install dependencies
|
23
|
+
run: |
|
24
|
+
sudo ci_scripts/install_dep.sh
|
25
|
+
|
26
|
+
- name: Builder
|
27
|
+
run: |
|
28
|
+
rake build -t -v
|
29
|
+
cp -R pkg /tmp
|
30
|
+
|
31
|
+
- name: Cache pkg
|
32
|
+
uses: actions/cache@v1
|
33
|
+
with:
|
34
|
+
path: /tmp
|
35
|
+
key: ${{ runner.os }}-build
|
36
|
+
|
37
|
+
unit-test:
|
38
|
+
runs-on: ubuntu-20.04
|
39
|
+
needs:
|
40
|
+
- build
|
41
|
+
steps:
|
42
|
+
- name: Checkout
|
43
|
+
uses: actions/checkout@v2
|
44
|
+
|
45
|
+
- name: Install dependencies
|
46
|
+
run: |
|
47
|
+
sudo ci_scripts/install_dep.sh
|
48
|
+
|
49
|
+
- uses: actions/cache@v2
|
50
|
+
with:
|
51
|
+
path: /tmp
|
52
|
+
key: ${{ runner.os }}-build
|
53
|
+
|
54
|
+
- name: Run unit tests
|
55
|
+
run: |
|
56
|
+
bundle exec rake test -t -v
|
57
|
+
|
58
|
+
func-test:
|
59
|
+
needs:
|
60
|
+
- unit-test
|
61
|
+
runs-on: ubuntu-20.04
|
62
|
+
env:
|
63
|
+
CI_SPLUNK_PORT: 8089
|
64
|
+
CI_SPLUNK_USERNAME: admin
|
65
|
+
CI_SPLUNK_HEC_TOKEN: a6b5e77f-d5f6-415a-bd43-930cecb12959
|
66
|
+
CI_SPLUNK_PASSWORD: helloworld
|
67
|
+
CI_INDEX_EVENTS: ci_events
|
68
|
+
CI_INDEX_OBJECTS: ci_objects
|
69
|
+
CI_INDEX_METRICS: ci_metrics
|
70
|
+
KUBERNETES_VERSION: v1.15.2
|
71
|
+
MINIKUBE_VERSION: v1.21.0
|
72
|
+
GITHUB_ACTIONS: true
|
73
|
+
|
74
|
+
steps:
|
75
|
+
- name: Checkout
|
76
|
+
uses: actions/checkout@v2
|
77
|
+
|
78
|
+
- name: Prepare container build
|
79
|
+
id: prep
|
80
|
+
run: |
|
81
|
+
VERSION=`cat VERSION`
|
82
|
+
TAGS=splunk/k8s-metrics-aggr:recent
|
83
|
+
echo ::set-output name=tags::${TAGS}
|
84
|
+
echo ::set-output name=version::${VERSION}
|
85
|
+
|
86
|
+
- name: Set up QEMU
|
87
|
+
uses: docker/setup-qemu-action@master
|
88
|
+
with:
|
89
|
+
platforms: all
|
90
|
+
|
91
|
+
- name: Set up Docker Buildx
|
92
|
+
id: buildx
|
93
|
+
uses: docker/setup-buildx-action@master
|
94
|
+
|
95
|
+
- name: Build multi-arch kubernetes-metrics image
|
96
|
+
uses: docker/build-push-action@v2
|
97
|
+
with:
|
98
|
+
builder: ${{ steps.buildx.outputs.name }}
|
99
|
+
context: .
|
100
|
+
file: ./docker/Dockerfile
|
101
|
+
platforms: linux/amd64
|
102
|
+
push: false
|
103
|
+
load: true
|
104
|
+
tags: ${{ steps.prep.outputs.tags }}
|
105
|
+
build-args: VERSION=${{ steps.prep.outputs.version }}
|
106
|
+
|
107
|
+
- name: Build k8s-metrics-aggr image
|
108
|
+
run: |
|
109
|
+
docker image ls
|
110
|
+
|
111
|
+
- name: Setup Minikube
|
112
|
+
run: |
|
113
|
+
# Install Kubectl
|
114
|
+
curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${KUBERNETES_VERSION}/bin/linux/amd64/kubectl
|
115
|
+
chmod +x kubectl
|
116
|
+
sudo mv kubectl /usr/local/bin/
|
117
|
+
mkdir -p ${HOME}/.kube
|
118
|
+
touch ${HOME}/.kube/config
|
119
|
+
# Install Minikube
|
120
|
+
curl -Lo minikube https://storage.googleapis.com/minikube/releases/${MINIKUBE_VERSION}/minikube-linux-amd64
|
121
|
+
chmod +x minikube
|
122
|
+
sudo mv minikube /usr/local/bin/
|
123
|
+
# Start Minikube and Wait
|
124
|
+
minikube start --driver=docker --container-runtime=docker --cpus 2 --memory 4096 --kubernetes-version=${KUBERNETES_VERSION} --no-vtx-check
|
125
|
+
export JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'
|
126
|
+
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do
|
127
|
+
sleep 1;
|
128
|
+
done
|
129
|
+
|
130
|
+
- name: Install Splunk
|
131
|
+
run: |
|
132
|
+
# Wait until minikube is ready
|
133
|
+
kubectl apply -f https://docs.projectcalico.org/v3.14/manifests/calico.yaml
|
134
|
+
export JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}'
|
135
|
+
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do
|
136
|
+
echo "wait for minikube ready ..."
|
137
|
+
sleep 1;
|
138
|
+
done
|
139
|
+
kubectl get nodes
|
140
|
+
# Install Splunk on minikube
|
141
|
+
kubectl apply -f ci_scripts/k8s-splunk.yml
|
142
|
+
# Wait until splunk is ready
|
143
|
+
until kubectl logs splunk --tail=2 | grep -q 'Ansible playbook complete'; do
|
144
|
+
sleep 1;
|
145
|
+
done
|
146
|
+
export CI_SPLUNK_HOST=$(kubectl get pod splunk --template={{.status.podIP}})
|
147
|
+
# Setup Indexes
|
148
|
+
curl -k -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/services/data/indexes -d name=$CI_INDEX_EVENTS -d datatype=event
|
149
|
+
curl -k -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/services/data/indexes -d name=$CI_INDEX_OBJECTS -d datatype=event
|
150
|
+
curl -k -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/services/data/indexes -d name=$CI_INDEX_METRICS -d datatype=metric
|
151
|
+
curl -k -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/services/data/indexes -d name=default-events -d datatype=event
|
152
|
+
curl -k -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/services/data/indexes -d name=ns-anno -d datatype=event
|
153
|
+
curl -k -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/services/data/indexes -d name=pod-anno -d datatype=event
|
154
|
+
# Enable HEC services
|
155
|
+
curl -X POST -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD -k https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/servicesNS/nobody/splunk_httpinput/data/inputs/http/http/enable
|
156
|
+
# Create new HEC token
|
157
|
+
curl -X POST -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD -k -d "name=splunk_hec_token&token=a6b5e77f-d5f6-415a-bd43-930cecb12959&disabled=0&index=default-events&indexes=default-events,$CI_INDEX_METRICS,$CI_INDEX_OBJECTS,$CI_INDEX_EVENTS,ns-anno,pod-anno" https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/servicesNS/nobody/splunk_httpinput/data/inputs/http
|
158
|
+
# Restart Splunk
|
159
|
+
curl -k -u $CI_SPLUNK_USERNAME:$CI_SPLUNK_PASSWORD https://$CI_SPLUNK_HOST:$CI_SPLUNK_PORT/services/server/control/restart -X POST
|
160
|
+
|
161
|
+
- name: Deploy k8s connector
|
162
|
+
run: |
|
163
|
+
export CI_SPLUNK_HOST=$(kubectl get pod splunk --template={{.status.podIP}})
|
164
|
+
ci_scripts/deploy_connector.sh
|
165
|
+
|
166
|
+
- name: Deploy log generator
|
167
|
+
run: |
|
168
|
+
cd /opt/splunk-connect-for-kubernetes
|
169
|
+
kubectl apply -f test/test_setup.yaml
|
170
|
+
sleep 65
|
171
|
+
|
172
|
+
- uses: actions/setup-python@v2
|
173
|
+
with:
|
174
|
+
python-version: 3.7
|
175
|
+
|
176
|
+
- name: Run functional tests
|
177
|
+
run: |
|
178
|
+
echo "check the pods"
|
179
|
+
kubectl get pods -A
|
180
|
+
cd /opt/splunk-connect-for-kubernetes
|
181
|
+
kubectl get nodes
|
182
|
+
export PYTHONWARNINGS="ignore:Unverified HTTPS request"
|
183
|
+
export CI_SPLUNK_HOST=$(kubectl get pod splunk --template={{.status.podIP}})
|
184
|
+
cd test
|
185
|
+
pip install --upgrade pip
|
186
|
+
pip install -r requirements.txt
|
187
|
+
echo "Running functional tests....."
|
188
|
+
python -m pytest \
|
189
|
+
--splunkd-url https://$CI_SPLUNK_HOST:8089 \
|
190
|
+
--splunk-user admin \
|
191
|
+
--splunk-password $CI_SPLUNK_PASSWORD \
|
192
|
+
-p no:warnings -s
|
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.
|
4
|
+
fluent-plugin-k8s-metrics-agg (1.1.7)
|
5
5
|
fluentd (>= 1.9.1)
|
6
6
|
kubeclient (~> 4.6.0)
|
7
7
|
multi_json (~> 1.14.1)
|
@@ -19,18 +19,18 @@ GEM
|
|
19
19
|
docile (1.4.0)
|
20
20
|
domain_name (0.5.20190701)
|
21
21
|
unf (>= 0.0.5, < 1.0.0)
|
22
|
-
ffi (1.15.
|
22
|
+
ffi (1.15.4)
|
23
23
|
ffi-compiler (1.0.1)
|
24
24
|
ffi (>= 1.0.0)
|
25
25
|
rake
|
26
|
-
fluentd (1.
|
26
|
+
fluentd (1.14.2)
|
27
27
|
bundler
|
28
28
|
cool.io (>= 1.4.5, < 2.0.0)
|
29
29
|
http_parser.rb (>= 0.5.1, < 0.8.0)
|
30
30
|
msgpack (>= 1.3.1, < 2.0.0)
|
31
31
|
serverengine (>= 2.2.2, < 3.0.0)
|
32
32
|
sigdump (~> 0.2.2)
|
33
|
-
strptime (>= 0.2.
|
33
|
+
strptime (>= 0.2.4, < 1.0.0)
|
34
34
|
tzinfo (>= 1.0, < 3.0)
|
35
35
|
tzinfo-data (~> 1.0)
|
36
36
|
webrick (>= 1.4.2, < 1.8.0)
|
@@ -48,19 +48,19 @@ GEM
|
|
48
48
|
http-parser (1.2.3)
|
49
49
|
ffi-compiler (>= 1.0, < 2.0)
|
50
50
|
http_parser.rb (0.7.0)
|
51
|
-
json (2.
|
51
|
+
json (2.6.1)
|
52
52
|
kubeclient (4.6.0)
|
53
53
|
http (>= 3.0, < 5.0)
|
54
54
|
recursive-open-struct (~> 1.0, >= 1.0.4)
|
55
55
|
rest-client (~> 2.0)
|
56
56
|
mime-types (3.3.1)
|
57
57
|
mime-types-data (~> 3.2015)
|
58
|
-
mime-types-data (3.2021.
|
58
|
+
mime-types-data (3.2021.0901)
|
59
59
|
msgpack (1.4.2)
|
60
60
|
multi_json (1.14.1)
|
61
61
|
netrc (0.11.0)
|
62
62
|
oj (3.10.18)
|
63
|
-
power_assert (2.0.
|
63
|
+
power_assert (2.0.1)
|
64
64
|
public_suffix (4.0.6)
|
65
65
|
rake (13.0.6)
|
66
66
|
recursive-open-struct (1.1.3)
|
@@ -83,11 +83,11 @@ GEM
|
|
83
83
|
power_assert
|
84
84
|
tzinfo (2.0.4)
|
85
85
|
concurrent-ruby (~> 1.0)
|
86
|
-
tzinfo-data (1.2021.
|
86
|
+
tzinfo-data (1.2021.5)
|
87
87
|
tzinfo (>= 1.0.0)
|
88
88
|
unf (0.1.4)
|
89
89
|
unf_ext
|
90
|
-
unf_ext (0.0.
|
90
|
+
unf_ext (0.0.8)
|
91
91
|
webmock (3.5.1)
|
92
92
|
addressable (>= 2.3.6)
|
93
93
|
crack (>= 0.3.2)
|
@@ -107,4 +107,4 @@ DEPENDENCIES
|
|
107
107
|
webmock (~> 3.5.1)
|
108
108
|
|
109
109
|
BUNDLED WITH
|
110
|
-
2.2.
|
110
|
+
2.2.30
|
data/Makefile
CHANGED
@@ -12,11 +12,9 @@ clean: clean_pkg clean_gems
|
|
12
12
|
build: clean_pkg
|
13
13
|
@bundle exec rake build
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
@
|
18
|
-
@cp -rp LICENSE docker/licenses/
|
19
|
-
@docker build --no-cache --pull --build-arg VERSION=$(VERSION) -t splunk/k8s-metrics-aggr:$(VERSION) ./docker
|
15
|
+
.PHONY: docker
|
16
|
+
docker:
|
17
|
+
@docker build --no-cache --pull --build-arg VERSION=$(VERSION) -t splunk/k8s-metrics-aggr:$(VERSION) . -f docker/Dockerfile
|
20
18
|
|
21
19
|
unit-test:
|
22
20
|
@bundle exec rake test
|
data/README.md
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
[![CircleCI](https://circleci.com/gh/git-lfs/git-lfs.svg?style=shield&circle-token=856152c2b02bfd236f54d21e1f581f3e4ebf47ad)](https://circleci.com/gh/splunk/fluent-plugin-k8s-metrics-agg)
|
2
1
|
# Fluentd Plugin for Kubernetes Metrics - Aggregator
|
3
2
|
|
4
3
|
[Fluentd](https://fluentd.org/) input plugin collects kubernetes cluster metrics from the kubeapiserver API. The API is exposed by [KubeApiServer](https://kubernetes.io/docs/reference/command-line-tools-reference/kube-apiserver/) on a kubernetes cluster.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.1.
|
1
|
+
1.1.7
|
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env bash
|
2
|
+
set -e
|
3
|
+
|
4
|
+
#Make sure to check and clean previously failed deployment
|
5
|
+
echo "Checking if previous deployment exist..."
|
6
|
+
if [ "`helm ls --short`" == "" ]; then
|
7
|
+
echo "Nothing to clean, ready for deployment"
|
8
|
+
else
|
9
|
+
helm delete $(helm ls --short)
|
10
|
+
fi
|
11
|
+
|
12
|
+
# Clone splunk-connect-for-kubernetes repo
|
13
|
+
cd /opt
|
14
|
+
git clone https://github.com/splunk/splunk-connect-for-kubernetes.git
|
15
|
+
cd splunk-connect-for-kubernetes
|
16
|
+
|
17
|
+
minikube image load splunk/k8s-metrics-aggr:recent
|
18
|
+
|
19
|
+
echo "Deploying k8s-connect with latest changes"
|
20
|
+
helm install ci-sck --set global.splunk.hec.token=$CI_SPLUNK_HEC_TOKEN \
|
21
|
+
--set global.splunk.hec.host=$CI_SPLUNK_HOST \
|
22
|
+
--set kubelet.serviceMonitor.https=true \
|
23
|
+
--set splunk-kubernetes-metrics.imageAgg.tag=recent \
|
24
|
+
--set splunk-kubernetes-metrics.imageAgg.pullPolicy=IfNotPresent \
|
25
|
+
-f ci_scripts/sck_values.yml helm-chart/splunk-connect-for-kubernetes
|
26
|
+
#wait for deployment to finish
|
27
|
+
until kubectl get pod | grep Running | [[ $(wc -l) == 4 ]]; do
|
28
|
+
sleep 1;
|
29
|
+
done
|
File without changes
|
@@ -0,0 +1,31 @@
|
|
1
|
+
apiVersion: v1
|
2
|
+
kind: Pod
|
3
|
+
metadata:
|
4
|
+
name: splunk
|
5
|
+
spec:
|
6
|
+
hostNetwork: true
|
7
|
+
securityContext:
|
8
|
+
runAsUser: 0
|
9
|
+
runAsGroup: 0
|
10
|
+
containers:
|
11
|
+
- name: splunk
|
12
|
+
image: splunk/splunk:latest
|
13
|
+
ports:
|
14
|
+
- containerPort: 8000
|
15
|
+
hostPort: 8000
|
16
|
+
protocol: TCP
|
17
|
+
- containerPort: 8088
|
18
|
+
hostPort: 8088
|
19
|
+
protocol: TCP
|
20
|
+
- containerPort: 8089
|
21
|
+
hostPort: 8089
|
22
|
+
protocol: TCP
|
23
|
+
env:
|
24
|
+
- name: SPLUNK_START_ARGS
|
25
|
+
value: --accept-license
|
26
|
+
- name: SPLUNK_USER
|
27
|
+
value: root
|
28
|
+
- name: SPLUNK_PASSWORD
|
29
|
+
value: helloworld
|
30
|
+
- name: SPLUNK_LAUNCH_CONF
|
31
|
+
value: OPTIMISTIC_ABOUT_FILE_LOCKING=1
|
data/docker/Dockerfile
CHANGED
@@ -1,3 +1,13 @@
|
|
1
|
+
FROM ruby:2.7.4-buster as builder
|
2
|
+
|
3
|
+
ADD ./ /app/
|
4
|
+
WORKDIR /app
|
5
|
+
RUN gem install bundler
|
6
|
+
RUN bundle update --bundler
|
7
|
+
RUN bundle install
|
8
|
+
|
9
|
+
RUN bundle exec rake build -t -v
|
10
|
+
|
1
11
|
FROM registry.access.redhat.com/ubi8/ruby-27
|
2
12
|
|
3
13
|
ARG VERSION
|
@@ -14,16 +24,20 @@ ENV VERSION=${VERSION}
|
|
14
24
|
ENV FLUENT_USER fluent
|
15
25
|
|
16
26
|
USER root
|
17
|
-
COPY licenses /licenses
|
18
27
|
|
19
|
-
COPY
|
28
|
+
COPY --from=builder /app/pkg/fluent-plugin-*.gem /tmp/
|
29
|
+
|
30
|
+
RUN mkdir /licenses
|
31
|
+
COPY --from=builder /app/LICENSE /licenses/LICENSE
|
32
|
+
|
33
|
+
COPY --from=builder /app/docker/Gemfile* ./
|
20
34
|
|
21
|
-
COPY Gemfile* ./
|
22
35
|
RUN yum update -y \
|
23
36
|
&& yum remove -y nodejs npm \
|
24
37
|
&& gem install bundler \
|
25
38
|
&& gem unpack /tmp/*.gem --target gem \
|
26
|
-
&& bundle install
|
39
|
+
&& bundle install \
|
40
|
+
&& rpm -e --nodeps python3-pip-wheel python3-urllib3-* python3-requests-* python3-libxml2-* python3-dmidecode-* subscription-manager-* libwebp-* libwebp-devel-* glib2-* libjpeg-turbo-devel-* libjpeg-turbo-* mariadb-connector-c-config-* mariadb-connector-c-* mariadb-connector-c-devel-* rsync-* sqlite-libs-* sqlite-devel-* sqlite-* libxml2-* libxml2-devel-* libX11-* libX11-common-* libX11-devel-* libX11-xcb-* nettle-* libsolv-* file-libs-* dbus-daemon-* tar-* qt5-srpm-macros-* perl-parent-* git-* bsdtar-* openssh-clients-* json-c-* binutils-* libtiff-devel-* libtiff-*
|
27
41
|
|
28
42
|
RUN groupadd -r $FLUENT_USER && \
|
29
43
|
useradd -r -g $FLUENT_USER $FLUENT_USER && \
|
data/docker/Gemfile
CHANGED
@@ -3,10 +3,10 @@ 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", "
|
6
|
+
gem "fluentd", ">=1.14.2"
|
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", "
|
9
|
+
gem "fluent-plugin-kubernetes_metadata_filter", ">=2.9.2"
|
10
10
|
gem "kubeclient", "=4.6.0"
|
11
11
|
gem "oj", "=3.10.2"
|
12
12
|
gem 'multi_json', '=1.14.1'
|
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.
|
4
|
+
fluent-plugin-k8s-metrics-agg (1.1.7)
|
5
5
|
fluentd (>= 1.9.1)
|
6
6
|
kubeclient (~> 4.6.0)
|
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 (6.1.4)
|
14
|
-
activesupport (= 6.1.4)
|
15
|
-
activesupport (6.1.4)
|
13
|
+
activemodel (6.1.4.1)
|
14
|
+
activesupport (= 6.1.4.1)
|
15
|
+
activesupport (6.1.4.1)
|
16
16
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
17
17
|
i18n (>= 1.6, < 2)
|
18
18
|
minitest (>= 5.1)
|
@@ -29,15 +29,15 @@ GEM
|
|
29
29
|
cool.io (1.7.1)
|
30
30
|
domain_name (0.5.20190701)
|
31
31
|
unf (>= 0.0.5, < 1.0.0)
|
32
|
-
ffi (1.15.
|
32
|
+
ffi (1.15.4)
|
33
33
|
ffi-compiler (1.0.1)
|
34
34
|
ffi (>= 1.0.0)
|
35
35
|
rake
|
36
|
-
fluent-plugin-kubernetes_metadata_filter (2.
|
37
|
-
fluentd (>= 0.14.0, < 1.
|
38
|
-
kubeclient (< 5)
|
36
|
+
fluent-plugin-kubernetes_metadata_filter (2.9.2)
|
37
|
+
fluentd (>= 0.14.0, < 1.15)
|
38
|
+
kubeclient (>= 4.0.0, < 5.0.0)
|
39
39
|
lru_redux
|
40
|
-
fluent-plugin-prometheus (2.0.
|
40
|
+
fluent-plugin-prometheus (2.0.2)
|
41
41
|
fluentd (>= 1.9.1, < 2)
|
42
42
|
prometheus-client (>= 2.1.0)
|
43
43
|
fluent-plugin-record-modifier (2.1.0)
|
@@ -48,15 +48,17 @@ GEM
|
|
48
48
|
net-http-persistent (~> 3.1)
|
49
49
|
openid_connect (~> 1.1.8)
|
50
50
|
prometheus-client (>= 2.1.0)
|
51
|
-
fluentd (1.
|
51
|
+
fluentd (1.14.2)
|
52
|
+
bundler
|
52
53
|
cool.io (>= 1.4.5, < 2.0.0)
|
53
|
-
http_parser.rb (>= 0.5.1, < 0.
|
54
|
+
http_parser.rb (>= 0.5.1, < 0.8.0)
|
54
55
|
msgpack (>= 1.3.1, < 2.0.0)
|
55
56
|
serverengine (>= 2.2.2, < 3.0.0)
|
56
57
|
sigdump (~> 0.2.2)
|
57
|
-
strptime (>= 0.2.
|
58
|
+
strptime (>= 0.2.4, < 1.0.0)
|
58
59
|
tzinfo (>= 1.0, < 3.0)
|
59
60
|
tzinfo-data (~> 1.0)
|
61
|
+
webrick (>= 1.4.2, < 1.8.0)
|
60
62
|
yajl-ruby (~> 1.0)
|
61
63
|
http (4.4.1)
|
62
64
|
addressable (~> 2.3)
|
@@ -71,7 +73,7 @@ GEM
|
|
71
73
|
ffi-compiler (>= 1.0, < 2.0)
|
72
74
|
http_parser.rb (0.5.3)
|
73
75
|
httpclient (2.8.3)
|
74
|
-
i18n (1.8.
|
76
|
+
i18n (1.8.11)
|
75
77
|
concurrent-ruby (~> 1.0)
|
76
78
|
json-jwt (1.13.0)
|
77
79
|
activesupport (>= 4.2)
|
@@ -86,8 +88,8 @@ GEM
|
|
86
88
|
mini_mime (>= 0.1.1)
|
87
89
|
mime-types (3.3.1)
|
88
90
|
mime-types-data (~> 3.2015)
|
89
|
-
mime-types-data (3.2021.
|
90
|
-
mini_mime (1.1.
|
91
|
+
mime-types-data (3.2021.0901)
|
92
|
+
mini_mime (1.1.2)
|
91
93
|
minitest (5.14.4)
|
92
94
|
msgpack (1.4.2)
|
93
95
|
multi_json (1.14.1)
|
@@ -108,7 +110,7 @@ GEM
|
|
108
110
|
prometheus-client (2.1.0)
|
109
111
|
public_suffix (4.0.6)
|
110
112
|
rack (2.2.3)
|
111
|
-
rack-oauth2 (1.
|
113
|
+
rack-oauth2 (1.19.0)
|
112
114
|
activesupport
|
113
115
|
attr_required
|
114
116
|
httpclient
|
@@ -125,28 +127,29 @@ GEM
|
|
125
127
|
sigdump (~> 0.2.2)
|
126
128
|
sigdump (0.2.4)
|
127
129
|
strptime (0.2.5)
|
128
|
-
swd (1.
|
130
|
+
swd (1.3.0)
|
129
131
|
activesupport (>= 3)
|
130
132
|
attr_required (>= 0.0.5)
|
131
133
|
httpclient (>= 2.4)
|
132
134
|
tzinfo (2.0.4)
|
133
135
|
concurrent-ruby (~> 1.0)
|
134
|
-
tzinfo-data (1.2021.
|
136
|
+
tzinfo-data (1.2021.5)
|
135
137
|
tzinfo (>= 1.0.0)
|
136
138
|
unf (0.1.4)
|
137
139
|
unf_ext
|
138
|
-
unf_ext (0.0.
|
140
|
+
unf_ext (0.0.8)
|
139
141
|
validate_email (0.1.6)
|
140
142
|
activemodel (>= 3.0)
|
141
143
|
mail (>= 2.2.5)
|
142
144
|
validate_url (1.0.13)
|
143
145
|
activemodel (>= 3.0.0)
|
144
146
|
public_suffix
|
145
|
-
webfinger (1.
|
147
|
+
webfinger (1.2.0)
|
146
148
|
activesupport
|
147
149
|
httpclient (>= 2.4)
|
150
|
+
webrick (1.7.0)
|
148
151
|
yajl-ruby (1.4.1)
|
149
|
-
zeitwerk (2.
|
152
|
+
zeitwerk (2.5.1)
|
150
153
|
|
151
154
|
PLATFORMS
|
152
155
|
ruby
|
@@ -154,11 +157,11 @@ PLATFORMS
|
|
154
157
|
DEPENDENCIES
|
155
158
|
bigdecimal (= 3.0.0)
|
156
159
|
fluent-plugin-k8s-metrics-agg!
|
157
|
-
fluent-plugin-kubernetes_metadata_filter (
|
160
|
+
fluent-plugin-kubernetes_metadata_filter (>= 2.9.2)
|
158
161
|
fluent-plugin-prometheus (>= 2.0)
|
159
162
|
fluent-plugin-record-modifier (= 2.1.0)
|
160
|
-
fluent-plugin-splunk-hec (>= 1.2.
|
161
|
-
fluentd (
|
163
|
+
fluent-plugin-splunk-hec (>= 1.2.7)
|
164
|
+
fluentd (>= 1.14.2)
|
162
165
|
http_parser.rb (= 0.5.3)
|
163
166
|
kubeclient (= 4.6.0)
|
164
167
|
multi_json (= 1.14.1)
|
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.
|
4
|
+
version: 1.1.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Splunk Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-11-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -144,13 +144,11 @@ executables: []
|
|
144
144
|
extensions: []
|
145
145
|
extra_rdoc_files: []
|
146
146
|
files:
|
147
|
-
- ".circleci/config.yml"
|
148
|
-
- ".circleci/install_dep.sh"
|
149
|
-
- ".circleci/trigger_func_test.sh"
|
150
147
|
- ".github/ISSUE_TEMPLATE/bug_report.md"
|
151
148
|
- ".github/ISSUE_TEMPLATE/enhancement_request.md"
|
152
149
|
- ".github/ISSUE_TEMPLATE/failing_test.md"
|
153
150
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
151
|
+
- ".github/workflows/ci_build_test.yaml"
|
154
152
|
- ".gitignore"
|
155
153
|
- CLA.md
|
156
154
|
- CONTRIBUTING.md
|
@@ -162,6 +160,9 @@ files:
|
|
162
160
|
- README.md
|
163
161
|
- Rakefile
|
164
162
|
- VERSION
|
163
|
+
- ci_scripts/deploy_connector.sh
|
164
|
+
- ci_scripts/install_dep.sh
|
165
|
+
- ci_scripts/k8s-splunk.yml
|
165
166
|
- docker/CONTRIBUTING.md
|
166
167
|
- docker/Dockerfile
|
167
168
|
- docker/Gemfile
|
@@ -185,7 +186,7 @@ homepage: https://github.com/splunk/fluent-plugin-k8s-metrics-agg
|
|
185
186
|
licenses:
|
186
187
|
- Apache-2.0
|
187
188
|
metadata: {}
|
188
|
-
post_install_message:
|
189
|
+
post_install_message:
|
189
190
|
rdoc_options: []
|
190
191
|
require_paths:
|
191
192
|
- lib
|
@@ -200,8 +201,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
200
201
|
- !ruby/object:Gem::Version
|
201
202
|
version: '0'
|
202
203
|
requirements: []
|
203
|
-
rubygems_version: 3.1
|
204
|
-
signing_key:
|
204
|
+
rubygems_version: 3.0.1
|
205
|
+
signing_key:
|
205
206
|
specification_version: 4
|
206
207
|
summary: A fluentd input plugin that collects kubernetes cluster metrics.
|
207
208
|
test_files:
|
data/.circleci/config.yml
DELETED
@@ -1,88 +0,0 @@
|
|
1
|
-
version: 2
|
2
|
-
jobs:
|
3
|
-
build:
|
4
|
-
docker:
|
5
|
-
- image: circleci/ruby:2.6.1-node-browsers
|
6
|
-
working_directory: ~/repo
|
7
|
-
steps:
|
8
|
-
- checkout
|
9
|
-
- setup_remote_docker:
|
10
|
-
reusable: true
|
11
|
-
- run:
|
12
|
-
name: Install dependencies
|
13
|
-
command: |
|
14
|
-
.circleci/install_dep.sh
|
15
|
-
- run:
|
16
|
-
name: Builder
|
17
|
-
command: |
|
18
|
-
rake build -t -v
|
19
|
-
cp -R pkg /tmp
|
20
|
-
- persist_to_workspace:
|
21
|
-
root: /tmp
|
22
|
-
paths:
|
23
|
-
- pkg
|
24
|
-
|
25
|
-
unit_test:
|
26
|
-
docker:
|
27
|
-
- image: circleci/ruby:2.6.1-node-browsers
|
28
|
-
working_directory: ~/repo
|
29
|
-
steps:
|
30
|
-
- attach_workspace:
|
31
|
-
at: /tmp
|
32
|
-
- checkout
|
33
|
-
- setup_remote_docker:
|
34
|
-
reusable: true
|
35
|
-
- run:
|
36
|
-
name: Install dependencies
|
37
|
-
command: |
|
38
|
-
.circleci/install_dep.sh
|
39
|
-
- run:
|
40
|
-
name: Run unit tests
|
41
|
-
command: |
|
42
|
-
bundle exec rake test -t -v
|
43
|
-
|
44
|
-
func_test_main:
|
45
|
-
docker:
|
46
|
-
- image: circleci/ruby:2.6.1-node-browsers
|
47
|
-
working_directory: ~/repo
|
48
|
-
steps:
|
49
|
-
- checkout
|
50
|
-
- setup_remote_docker:
|
51
|
-
reusable: true
|
52
|
-
- run:
|
53
|
-
name: trigger
|
54
|
-
command: |
|
55
|
-
.circleci/trigger_func_test.sh main
|
56
|
-
|
57
|
-
func_test_develop:
|
58
|
-
docker:
|
59
|
-
- image: circleci/ruby:2.6.1-node-browsers
|
60
|
-
working_directory: ~/repo
|
61
|
-
steps:
|
62
|
-
- checkout
|
63
|
-
- setup_remote_docker:
|
64
|
-
reusable: true
|
65
|
-
- run:
|
66
|
-
name: trigger
|
67
|
-
command: |
|
68
|
-
.circleci/trigger_func_test.sh develop
|
69
|
-
|
70
|
-
workflows:
|
71
|
-
version: 2
|
72
|
-
build_test_push:
|
73
|
-
jobs:
|
74
|
-
- build:
|
75
|
-
filters:
|
76
|
-
branches:
|
77
|
-
ignore:
|
78
|
-
- /^release\/.*/
|
79
|
-
- main
|
80
|
-
- unit_test:
|
81
|
-
requires:
|
82
|
-
- build
|
83
|
-
- func_test_main:
|
84
|
-
requires:
|
85
|
-
- unit_test
|
86
|
-
- func_test_develop:
|
87
|
-
requires:
|
88
|
-
- unit_test
|
@@ -1,42 +0,0 @@
|
|
1
|
-
#!/usr/bin/env bash
|
2
|
-
|
3
|
-
# trigger SCK 'main' branch to introduce this new image from this commit
|
4
|
-
# to working version of every other component.
|
5
|
-
ORGANIZATION=splunk
|
6
|
-
PROJECT=splunk-connect-for-kubernetes
|
7
|
-
BRANCH=$1
|
8
|
-
|
9
|
-
# Trigger functional test
|
10
|
-
curl -X POST --header "Content-Type: application/json" \
|
11
|
-
-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
|
12
|
-
cat build.json
|
13
|
-
BUILD_NUM=$(jq -r .build_num build.json)
|
14
|
-
sleep 10
|
15
|
-
|
16
|
-
# Wait until finish or maximum 20 minutes
|
17
|
-
TIMEOUT=20
|
18
|
-
DONE="FALSE"
|
19
|
-
until [ "$TIMEOUT" -lt 0 ] || [ "$DONE" == "TRUE" ]; do
|
20
|
-
curl https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/$BUILD_NUM?circle-token=$CIRCLE_TOKEN > build_progress.json
|
21
|
-
STATUS=$(jq -r .status build_progress.json)
|
22
|
-
echo "STATUS = $STATUS"
|
23
|
-
if [ "$STATUS" != "running" ] && [ "$STATUS" != "queued" ]; then
|
24
|
-
DONE="TRUE"
|
25
|
-
else
|
26
|
-
let TIMEOUT--
|
27
|
-
sleep 60
|
28
|
-
fi
|
29
|
-
done
|
30
|
-
|
31
|
-
BUILD_URL=$(jq -r .build_url build_progress.json)
|
32
|
-
if [ "$DONE" == "FALSE" ]; then
|
33
|
-
# Cancel hanging job and fail
|
34
|
-
curl -X POST https://circleci.com/api/v1/project/$ORGANIZATION/$PROJECT/$BUILD_NUM/cancel?circle-token=$CIRCLE_TOKEN
|
35
|
-
else
|
36
|
-
if [ "$STATUS" != "success" ] && [ "$STATUS" != "fixed" ]; then
|
37
|
-
echo "Functional test have failed please see:"
|
38
|
-
echo $BUILD_URL
|
39
|
-
exit 1
|
40
|
-
fi
|
41
|
-
exit 0
|
42
|
-
fi
|