diff --git a/Makefile b/Makefile index c478dd0..0e1086e 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,10 @@ build: go build -o cmd/kubectl-nginx_supportpkg +debugger: + docker buildx build --build-context project=nginx-debugger --platform linux/amd64 -t nginx-debugger -f nginx-debugger/Dockerfile . +# docker tag nginx-debugger:latest mrajagopal/f5-utils:latest +# docker push mrajagopal/f5-utils:latest + install: build sudo cp cmd/kubectl-nginx_supportpkg /usr/local/bin \ No newline at end of file diff --git a/nginx-debugger/Dockerfile b/nginx-debugger/Dockerfile new file mode 100644 index 0000000..2bb28b1 --- /dev/null +++ b/nginx-debugger/Dockerfile @@ -0,0 +1,14 @@ +FROM alpine:latest +COPY --chmod=744 --from=project api_stats.sh /root/api_stats.sh + +RUN apk --update add bind-tools curl netcat-openbsd iproute2 iperf tcpdump tshark bash jq \ + && rm -rf /var/cache/apk/* \ + && ln -s /usr/bin/iperf /usr/local/bin/iperf \ + && ls -altrh /usr/local/bin/iperf + +# Setting User and Home +USER root +WORKDIR /root +ENV HOSTNAME=nginx-utils + +CMD ["bash"] \ No newline at end of file diff --git a/nginx-debugger/api_stats.sh b/nginx-debugger/api_stats.sh new file mode 100644 index 0000000..9bf3fc5 --- /dev/null +++ b/nginx-debugger/api_stats.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash +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 + echo "**** $i ****" ; + curl -s "127.0.0.1:8080/$i" | jq .; + echo ""; +done \ No newline at end of file