-
Notifications
You must be signed in to change notification settings - Fork 2
nginx-utils: Added readme #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
ec663a7
nginx-utils: Added readme
mrajagopal 30f471e
Update nginx-utils/README.md
mrajagopal 30d0735
Kubernetes should be capitalized as it's a proper noun.
mrajagopal ae4adcd
Fix: Update examples to use latest image to pull
mrajagopal bbc4f32
Fix: replace custom parameters with placeholders for succinctness
mrajagopal f1a7806
Fix: Provide a description of the api_stats.sh script and its usage
mrajagopal ffa2eb0
Use markdown formatting instead of HTML tags
mrajagopal 19fff73
Fix: correct usage text to reflect example version in command
mrajagopal 735ad74
Merge branch '195-add-readme-for-the-nginx-utils-package' of https://…
mrajagopal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# 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:latest`: | ||
``` | ||
kubectl -n <namespace> debug -it <nic-pod-name> --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. | ||
|
||
-------------- | ||
#### Example usage of `api_stats.sh` found in the container: | ||
mrajagopal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
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 <namespace> debug -it <nic-pod-name> --image=ghcr.io/nginx/nginx-utils:latest --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 to the root directory of this project, `nginx-supportpkg-for-k8s` and run the command: | ||
``` | ||
make nginx-utils | ||
``` |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.