generated from nginx/template-repository
-
Notifications
You must be signed in to change notification settings - Fork 94
Update metrics docs, add run-container guide #352
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
28 commits
Select commit
Hold shift + click to select a range
61a125f
Update metrics docs, add run-container guide
nginx-seanmoloney c486596
Apply suggestion to update metadata for how-to guide.
nginx-seanmoloney e449dc4
Apply suggestion to update markdown format, and code block
nginx-seanmoloney 27d6bd6
Apply suggestion to update locating config file
nginx-seanmoloney 14c7195
Apply suggestion to title
nginx-seanmoloney aeb7db4
Apply suggestion to title
nginx-seanmoloney 9ee6466
Apply suggestion to sentence.
nginx-seanmoloney b5d1854
Apply suggestion to use correct note element
nginx-seanmoloney af7c5b7
Apply suggestion
nginx-seanmoloney 99daffb
Apply suggestion
nginx-seanmoloney 6a40c4d
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney 6302f0e
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney cf726ce
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney 683c2ea
Update content/agent/how-to/run-agent-container.md
nginx-seanmoloney 20a940e
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney dc76859
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney ee50b27
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney 2b2c581
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney 07dbd71
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney c8c3e3a
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney ff61880
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney 49c039d
Update content/agent/otel/configure-otel-metrics.md
nginx-seanmoloney 03f08f5
docs: Change Container to container, based on PR feedback
nginx-seanmoloney 341d617
Merge branch 'agent-release-3.0' into update-export-metrics-docs
JTorreG 7943667
Update content/agent/otel/configure-otel-metrics.md
JTorreG 58194d4
Apply suggestions from code review
JTorreG 5bd7093
docs: improve layout
JTorreG ffad0cc
Merge branch 'agent-release-3.0' into update-export-metrics-docs
JTorreG 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 was deleted.
Oops, something went wrong.
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,105 @@ | ||
--- | ||
title: "Run the NGINX Agent in a container" | ||
weight: 300 | ||
toc: true | ||
type: how-to | ||
product: Agent | ||
--- | ||
|
||
## Overview | ||
|
||
This guide serves as a step-by-step guide to run NGINX Agent in a container. It covers the basic setup needed to get the NGINX Agent up and running efficiently and securely. | ||
|
||
## Before you begin | ||
|
||
Before you begin this guide ensure: | ||
|
||
{{< note >}} | ||
This guide uses Docker but NGINX Agent also works with other container applications. | ||
{{< /note >}} | ||
|
||
- **Docker:** Ensure Docker is installed and configured on your system. [Download Docker from the official site](https://www.docker.com/products/docker-desktop/). | ||
- **Credentials:** Acquire any necessary authentication tokens or credentials required for the NGINX Agent. | ||
|
||
## Prepare the environment | ||
|
||
To run NGINX Agent in a container you will need to download the NGINX Agent | ||
container image and create a configuration file. | ||
|
||
### Pull the NGINX Agent container image | ||
|
||
The NGINX Agent container image must be downloaded from a trusted source such as Docker Hub or a private container registry. | ||
JTorreG marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
Run the following command to pull the official image: | ||
|
||
```bash | ||
<!-- Registry HERE --> | ||
docker pull <Registry HERE>:latest | ||
``` | ||
|
||
Ensure you are using the correct image version. Replace `latest` with the desired version tag if necessary. | ||
|
||
|
||
### Create a configuration file | ||
|
||
Create a configuration file named `nginx-agent.conf` in your current directory | ||
and populate the file with the following structure: | ||
|
||
```yaml | ||
command: | ||
server: | ||
host: "<NGINX-One-Console-URL>" # Command server host | ||
port: 443 # Command server port | ||
auth: | ||
token: "<your-data-plane-key-here>" # Authentication token for the command server | ||
tls: | ||
skip_verify: false | ||
``` | ||
|
||
Replace the placeholder values: | ||
|
||
- `<NGINX-One-Console-URL>`: The URL of your NGINX One Console instance. | ||
- `<your-data-plane-key-here>`: Your Data Plane access token. | ||
|
||
|
||
## Run the container | ||
|
||
Run the NGINX Agent container with the configuration file mounted. | ||
|
||
Use the following command: | ||
|
||
```bash | ||
docker run -d \ | ||
--name nginx-agent \ | ||
-v $(pwd)/nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf \ | ||
nginx/agent:latest | ||
``` | ||
|
||
Key options explained: | ||
|
||
- `-d`: Runs the container in detached mode. | ||
- `--name nginx-agent`: Assigns a name to the container for easy identification. | ||
- `-v $(pwd)/nginx-agent.conf:/etc/nginx-agent/nginx-agent.conf`: Mounts the configuration file into the container. | ||
|
||
|
||
### Verify the container is running | ||
|
||
Check the running status of the container: | ||
|
||
```bash | ||
docker ps | ||
``` | ||
|
||
You should see an entry for `nginx-agent`. The `STATUS` field indicates that the container is running. | ||
|
||
### Monitor logs | ||
|
||
To ensure the container is functioning properly and communicating with NGINX One Console, monitor the container logs. | ||
|
||
Run the following command: | ||
|
||
```bash | ||
docker logs -f nginx-agent | ||
``` | ||
|
||
Look for log entries indicating successful connection to the NGINX One Console and periodic metric transmission. |
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.