Skip to content

Commit fed2bf3

Browse files
committed
feat: introduce NGINX API stats script
1 parent 98a5ca5 commit fed2bf3

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

Makefile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ build:
22
go build -o cmd/kubectl-nginx_supportpkg
33

44
debugger:
5-
docker buildx build --platform linux/amd64 -t nginx-debugger -f nginx-debugger/Dockerfile .
5+
docker buildx build --build-context project=nginx-debugger --platform linux/amd64 -t nginx-debugger -f nginx-debugger/Dockerfile .
6+
# docker tag nginx-debugger:latest mrajagopal/f5-utils:latest
7+
# docker push mrajagopal/f5-utils:latest
68

79
install: build
810
sudo cp cmd/kubectl-nginx_supportpkg /usr/local/bin

nginx-debugger/Dockerfile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
FROM alpine:latest
2+
COPY --chmod=744 --from=project api_stats.sh /root/api_stats.sh
23

3-
RUN apk --update add bind-tools curl netcat-openbsd iproute2 iperf bash && rm -rf /var/cache/apk/* \
4+
RUN apk --update add bind-tools curl netcat-openbsd iproute2 iperf tcpdump tshark bash jq \
5+
&& rm -rf /var/cache/apk/* \
46
&& ln -s /usr/bin/iperf /usr/local/bin/iperf \
57
&& ls -altrh /usr/local/bin/iperf
68

7-
ADD https://github.com/coredns/coredns/releases/download/v1.11.4/coredns_1.11.4_linux_amd64.tgz /coredns.tgz
8-
RUN tar -xzvf /coredns.tgz && rm -f /coredns.tgz
9+
# Setting User and Home
10+
USER root
11+
WORKDIR /root
12+
ENV HOSTNAME=nginx-utils
913

1014
CMD ["bash"]

nginx-debugger/api_stats.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/usr/bin/env bash
2+
for i in /api/8/processes /api/8/connections /api/8/slabs /api/8/http/requests /api/8/http/server_zones /api/8/http/location_zones /api/8/http/caches /api/8/http/upstreams /api/8/http/keyvals; do
3+
echo "**** $i ****" ;
4+
curl -s "127.0.0.1:8080/$i" | jq .;
5+
echo "";
6+
done

0 commit comments

Comments
 (0)