From ec663a7b7bb4c175ed8ede15577500625e00612f Mon Sep 17 00:00:00 2001 From: Madhu RAJAGOPAL Date: Fri, 5 Sep 2025 13:20:28 +1200 Subject: [PATCH 1/8] nginx-utils: Added readme * instructions on usage and building --- README.md | 5 ++++- nginx-utils/README.md | 49 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 nginx-utils/README.md diff --git a/README.md b/README.md index d89b878..acb3fc9 100644 --- a/README.md +++ b/README.md @@ -92,4 +92,7 @@ Running job helm-info... OK Running job helm-deployments... OK Supportpkg successfully generated: nic-supportpkg-1711384966.tar.gz -``` \ No newline at end of file +``` + +## The nginx-utils Package +Please refer to its dedicated [README](/nginx-utils/README.md). \ No newline at end of file diff --git a/nginx-utils/README.md b/nginx-utils/README.md new file mode 100644 index 0000000..0c73973 --- /dev/null +++ b/nginx-utils/README.md @@ -0,0 +1,49 @@ +# Introduction +The `kubectl` command of kubernetes offers a `debug` sub-command to investigate pods running (or crashing) on a node using ephemeral debug containers. +The `nginx-utils` image can be spun into a debug container that includes various tools such as curl, tcpdump, iperf, netcat to name a few. + +Benefits: +* Minimal image +* Scanned for vulnerabilities +* Includes well-known troubleshooting tools +* Ability to include custom tools + +# Usage +#### The command to start the debug container using the nginx-utils image version `ghcr.io/nginx/nginx-utils:v0.0.1-docker`: +``` +ns=v4nic-0 +pod=$(kubectl get po -n $ns -o name | awk -F '/' '{print $2}') +kubectl -n $ns debug -it $pod --image=ghcr.io/nginx/nginx-utils:v0.0.1-docker --target=nginx-ingress +``` + +Please refer to the [nginx-utils packages page](https://github.com/nginx/nginx-supportpkg-for-k8s/pkgs/container/nginx-utils) for versions. + +-------------- +#### Example usage of `api_stats.sh` found in the container: +``` +kubectl -n $ns debug -it $pod --image=ghcr.io/nginx/nginx-utils:v0.0.1-docker --target=nginx-ingress + +v4nic-0-nginx-ingress-controller-854796ff97-hhkk5:~# ls +api_stats.sh memory_stats.sh + +v4nic-0-nginx-ingress-controller-854796ff97-hhkk5:~# ./api_stats.sh -h + +Usage: ./api_stats.sh [-p port] + +v4nic-0-nginx-ingress-controller-854796ff97-hhkk5:~# ./api_stats.sh -p 8080 +API_VERSION: 9 +**** /api/9/nginx **** +{ + "version": "1.27.2", + "build": "nginx-plus-r33-p2", + "address": "127.0.0.1", + "generation": 8, +.... +} +``` + +# Building +Please go the root directory of this project, `nginx-supportpkg-for-k8s` and run the command: +``` +make nginx-utils +``` \ No newline at end of file From 30f471e0d64fc7ee6d11502467066e1bbd1c3c57 Mon Sep 17 00:00:00 2001 From: Madhu Rajagopal Date: Fri, 5 Sep 2025 14:45:21 +1200 Subject: [PATCH 2/8] Update nginx-utils/README.md There's a grammatical error: 'go the root directory' should be 'go to the root directory'. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- nginx-utils/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-utils/README.md b/nginx-utils/README.md index 0c73973..8405cae 100644 --- a/nginx-utils/README.md +++ b/nginx-utils/README.md @@ -43,7 +43,7 @@ API_VERSION: 9 ``` # Building -Please go the root directory of this project, `nginx-supportpkg-for-k8s` and run the command: +Please go to the root directory of this project, `nginx-supportpkg-for-k8s` and run the command: ``` make nginx-utils ``` \ No newline at end of file From 30d0735a643c7b9ea4c259d637f62f4a02e63914 Mon Sep 17 00:00:00 2001 From: Madhu Rajagopal Date: Mon, 8 Sep 2025 13:25:28 +1200 Subject: [PATCH 3/8] Kubernetes should be capitalized as it's a proper noun. Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- nginx-utils/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-utils/README.md b/nginx-utils/README.md index 8405cae..e17efb8 100644 --- a/nginx-utils/README.md +++ b/nginx-utils/README.md @@ -1,5 +1,5 @@ # Introduction -The `kubectl` command of kubernetes offers a `debug` sub-command to investigate pods running (or crashing) on a node using ephemeral debug containers. +The `kubectl` command of Kubernetes offers a `debug` sub-command to investigate pods running (or crashing) on a node using ephemeral debug containers. The `nginx-utils` image can be spun into a debug container that includes various tools such as curl, tcpdump, iperf, netcat to name a few. Benefits: From ae4adcdc4b8aabdf2feb2ad072b46ff0592296d8 Mon Sep 17 00:00:00 2001 From: Madhu RAJAGOPAL Date: Mon, 8 Sep 2025 13:32:14 +1200 Subject: [PATCH 4/8] Fix: Update examples to use latest image to pull --- nginx-utils/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/nginx-utils/README.md b/nginx-utils/README.md index e17efb8..f83984c 100644 --- a/nginx-utils/README.md +++ b/nginx-utils/README.md @@ -13,7 +13,7 @@ Benefits: ``` ns=v4nic-0 pod=$(kubectl get po -n $ns -o name | awk -F '/' '{print $2}') -kubectl -n $ns debug -it $pod --image=ghcr.io/nginx/nginx-utils:v0.0.1-docker --target=nginx-ingress +kubectl -n $ns debug -it $pod --image=ghcr.io/nginx/nginx-utils:latest --target=nginx-ingress ``` Please refer to the [nginx-utils packages page](https://github.com/nginx/nginx-supportpkg-for-k8s/pkgs/container/nginx-utils) for versions. @@ -21,7 +21,7 @@ Please refer to the [nginx-utils packages page](https://github.com/nginx/nginx-s -------------- #### Example usage of `api_stats.sh` found in the container: ``` -kubectl -n $ns debug -it $pod --image=ghcr.io/nginx/nginx-utils:v0.0.1-docker --target=nginx-ingress +kubectl -n $ns debug -it $pod --image=ghcr.io/nginx/nginx-utils:latest --target=nginx-ingress v4nic-0-nginx-ingress-controller-854796ff97-hhkk5:~# ls api_stats.sh memory_stats.sh From bbc4f32fb1d62ad058c0ac144486c079b954ee37 Mon Sep 17 00:00:00 2001 From: Madhu RAJAGOPAL Date: Mon, 8 Sep 2025 13:39:46 +1200 Subject: [PATCH 5/8] Fix: replace custom parameters with placeholders for succinctness --- nginx-utils/README.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/nginx-utils/README.md b/nginx-utils/README.md index f83984c..0fc0ff7 100644 --- a/nginx-utils/README.md +++ b/nginx-utils/README.md @@ -11,9 +11,7 @@ Benefits: # Usage #### The command to start the debug container using the nginx-utils image version `ghcr.io/nginx/nginx-utils:v0.0.1-docker`: ``` -ns=v4nic-0 -pod=$(kubectl get po -n $ns -o name | awk -F '/' '{print $2}') -kubectl -n $ns debug -it $pod --image=ghcr.io/nginx/nginx-utils:latest --target=nginx-ingress +kubectl -n debug -it --image=ghcr.io/nginx/nginx-utils:latest --target=nginx-ingress ``` Please refer to the [nginx-utils packages page](https://github.com/nginx/nginx-supportpkg-for-k8s/pkgs/container/nginx-utils) for versions. @@ -21,7 +19,7 @@ Please refer to the [nginx-utils packages page](https://github.com/nginx/nginx-s -------------- #### Example usage of `api_stats.sh` found in the container: ``` -kubectl -n $ns debug -it $pod --image=ghcr.io/nginx/nginx-utils:latest --target=nginx-ingress +kubectl -n debug -it --image=ghcr.io/nginx/nginx-utils:latest --target=nginx-ingress v4nic-0-nginx-ingress-controller-854796ff97-hhkk5:~# ls api_stats.sh memory_stats.sh From f1a7806938d0dd97991d9043bfb57c40ca9a5938 Mon Sep 17 00:00:00 2001 From: Madhu RAJAGOPAL Date: Mon, 8 Sep 2025 13:56:43 +1200 Subject: [PATCH 6/8] Fix: Provide a description of the api_stats.sh script and its usage --- nginx-utils/README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/nginx-utils/README.md b/nginx-utils/README.md index 0fc0ff7..e5f989c 100644 --- a/nginx-utils/README.md +++ b/nginx-utils/README.md @@ -17,7 +17,10 @@ kubectl -n debug -it --image=ghcr.io/nginx/nginx-util Please refer to the [nginx-utils packages page](https://github.com/nginx/nginx-supportpkg-for-k8s/pkgs/container/nginx-utils) for versions. -------------- -#### Example usage of `api_stats.sh` found in the container: +#### Example usage of `api_stats.sh` found in the container: +The `api_stats.sh` script is designed to facilitate accessing the [/api](https://nginx.org/en/docs/http/ngx_http_api_module.html#api) endpoint to query various status information, configuring upstream server groups on-the-fly, and managing key-value pairs without the need of reconfiguring nginx. + +NOTE: The `api_stats.sh` script requires an `/api` endpoint that is listening on `loopback`, in a given `port`. ``` kubectl -n debug -it --image=ghcr.io/nginx/nginx-utils:latest --target=nginx-ingress From ffa2eb03013140a493ec0dd0bae3058f5ea9571a Mon Sep 17 00:00:00 2001 From: Madhu Rajagopal Date: Mon, 8 Sep 2025 14:41:40 +1200 Subject: [PATCH 7/8] Use markdown formatting instead of HTML tags Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- nginx-utils/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-utils/README.md b/nginx-utils/README.md index e5f989c..202edbd 100644 --- a/nginx-utils/README.md +++ b/nginx-utils/README.md @@ -20,7 +20,7 @@ Please refer to the [nginx-utils packages page](https://github.com/nginx/nginx-s #### Example usage of `api_stats.sh` found in the container: The `api_stats.sh` script is designed to facilitate accessing the [/api](https://nginx.org/en/docs/http/ngx_http_api_module.html#api) endpoint to query various status information, configuring upstream server groups on-the-fly, and managing key-value pairs without the need of reconfiguring nginx. -NOTE: The `api_stats.sh` script requires an `/api` endpoint that is listening on `loopback`, in a given `port`. +> **NOTE:** The `api_stats.sh` script requires an `/api` endpoint that is listening on `loopback`, in a given `port`. ``` kubectl -n debug -it --image=ghcr.io/nginx/nginx-utils:latest --target=nginx-ingress From 19fff73b63dc11fa9f05478220b5ca33dcf4766c Mon Sep 17 00:00:00 2001 From: Madhu RAJAGOPAL Date: Mon, 8 Sep 2025 14:52:02 +1200 Subject: [PATCH 8/8] Fix: correct usage text to reflect example version in command --- nginx-utils/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nginx-utils/README.md b/nginx-utils/README.md index e5f989c..5868e14 100644 --- a/nginx-utils/README.md +++ b/nginx-utils/README.md @@ -9,7 +9,7 @@ Benefits: * Ability to include custom tools # Usage -#### The command to start the debug container using the nginx-utils image version `ghcr.io/nginx/nginx-utils:v0.0.1-docker`: +#### The command to start the debug container using the nginx-utils image version `ghcr.io/nginx/nginx-utils:latest`: ``` kubectl -n debug -it --image=ghcr.io/nginx/nginx-utils:latest --target=nginx-ingress ```