Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 0 additions & 6 deletions content/includes/agent/installation/update-container.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,3 @@ wget https://raw.githubusercontent.com/nginx/agent/refs/heads/main/scripts/packa

If your NGINX Agent container was previously a member of a Config Sync Group, then your NGINX Agent config must be manually updated to add the Config Sync Group label.
See [Add Config Sync Group]({{< ref "/nginx-one-console/nginx-configs/config-sync-groups/manage-config-sync-groups.md" >}}) for more information.

### Rolling back from NGINX Agent v3 to v2

If you need to roll back your environment to NGINX Agent v2, the upgrade process creates a backup of the NGINX Agent v2 config in the file `/etc/nginx-agent/nginx-agent-v2-backup.conf`.

Replace the contents of `/etc/nginx-agent/nginx-agent.conf` with the contents of `/etc/nginx-agent/nginx-agent-v2-backup.conf` and then reinstall an older version of NGINX Agent.
99 changes: 95 additions & 4 deletions content/includes/agent/installation/update.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,25 @@ nd-files:
- content/nginx-one-console/agent/install-upgrade/update.md
---

{{< call-out "note" >}} If you are using a version **older than NGINX Agent v2.31.0**, you must stop NGINX Agent before updating:

The following is a summary of changes and improvements that went into NGINX Agent v3.

- Enhanced connection handling with improved error management and retry logic.
- Improved reliability when publishing NGINX configurations to NGINX Data planes.
- Revamped logging framework for easier troubleshooting and diagnostics.
- Improved NGINX Data plane health monitoring.
- Simplified Agent Configuration file.
- Built-in OpenTelemetry (OTel) support for standardized observability and monitoring.
[Learn more about exporting metrics to NGINX One Console]({{< ref "/nginx-one-console/agent/configure-otel-metrics/" >}})
- Explicit forward proxy support.
- Enable Kubernetes control planes connections NGINX One Console

## Upgrading the Agent on Virtual Machine/Bare Metal Server

When upgrading to NGINX Agent v3, the installer automatically backs up all configuration files before proceeding. It also converts your v2 configuration to the v3 format, ensuring compatibility and preserving settings.

{{< call-out "note" >}}
If you are using a version **older than NGINX Agent v2.31.0**, you must stop NGINX Agent before updating:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You may want to include the syntax to get the version. I know you have it in a later step, but having it earlier would help the user settle any doubts about the version they have installed.


- `sudo systemctl stop nginx-agent`

Expand All @@ -20,9 +38,9 @@ The same steps apply if you are **upgrading from NGINX Agent v2 to NGINX Agent v

1. Make a backup copy of the following locations to ensure that you can successfully recover if the upgrade does not complete
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The document earlier explains that the upgrade process makes a backup of your config files for you. Yet, step one has the use make backup files themselves. Why both?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The installer will only back up the nginx-agent.conf file not the /nginx-agent directory.

successfully:

- `/etc/nginx-agent`
- Every configuration directory specfied in `/etc/nginx-agent/nginx-agent.conf` as a `config_dirs` value
```shell
sudo cp -r /etc/nginx-agent /etc/nginx-agent.bak
```

1. Install the updated version of NGINX Agent:

Expand All @@ -39,3 +57,76 @@ The same steps apply if you are **upgrading from NGINX Agent v2 to NGINX Agent v
sudo apt-get update
sudo apt-get install -y --only-upgrade nginx-agent -o Dpkg::Options::="--force-confold"
```
1. Verify the installation by checking the version:
```shell
sudo nginx-agent -v
```
1. Verify the agent service is running by checking the logs

```shell
sudo cat /var/log/nginx-agent/agent.log | grep -i "Starting NGINX Agent"
```

### Rolling back from NGINX Agent v3 to v2

If you need to roll back your environment to NGINX Agent v2, the upgrade process creates a backup of the NGINX Agent v2 config in the file `/etc/nginx-agent/nginx-agent.conf.v2-backup`.

Replace the contents of `/etc/nginx-agent/nginx-agent.conf` with the contents of `/etc/nginx-agent/nginx-agent.conf.v2-backup` and then reinstall an older version of NGINX Agent.


## Upgrading Container and Kubernetes deployments

{{< call-out "warning" >}} NGINX Agent v3 introduces a new configuration schema that replaces all v2 environment variables. The names, structure, and sometimes the semantics of these variables have changed. There is no backward compatibility, so any automation or manifests using v2 variables must be updated to the new v3 equivalents before upgrading.

{{< /call-out >}}

### Recommended Approach

Start by reviewing the configuration in the yaml file, this example shows a subset of the v2 env vars.
To see the complete v2 and v3 lists use the following links:

- [Full list of v2 environment variables]({{< ref "/agent/configuration/configuration-overview" >}})
- [Full list of v3 environment variables]({{< ref "/nginx-one-console/agent/configure-instances/configuration-overview/" >}})


Taking an example docker-compose file running a NGINX Agent v2 and update to v3.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be better to show the v2 ENV vars right beside the updated v3 names for them in a table, rather than showing multiple examples files.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a good idea to show an example on what each variable value should look like/its format etc

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Including whether or not to use quotes.


```yaml
# NGINX Agent v2
nginx-agent:
image: private-registry.nginx.com/nginx-plus/agent:debian
container_name: nginx-agent
environment:
NGINX_LICENSE_JWT: <YOUR_JWT_HERE>
NGINX_AGENT_SERVER_GRPCPORT: 443
NGINX_AGENT_SERVER_HOST: <Host Server>
NGINX_AGENT_SERVER_TOKEN: <Auth Token>
NGINX_AGENT_TLS_ENABLE: true
```


1. Update the image to point to NGINX Agent v3

1. Replace the v2 envioronment variables with v3

1. Start the updated services:
```shell
docker-compose up -d
```
```yaml
# NGINX Agent v3
nginx-agent:
image: private-registry.nginx.com/nginx-plus/agentv3:debian
container_name: nginx-agent
environment:
NGINX_LICENSE_JWT: <YOUR_JWT_HERE>
NGINX_AGENT_COMMAND_SERVER_PORT: 443
NGINX_AGENT_COMMAND_SERVER_HOST: <Host Server>
NGINX_AGENT_COMMAND_AUTH_TOKEN: <Auth Token>
NGINX_AGENT_COMMAND_TLS_SKIP_VERIFY: false
```

4. Testing
- Verify the container is running
- Check agent logs to confirm the upgrade: `"Starting NGINX Agent" version=v3`
- Verify NGINX instance is displayed as online NGINX Console instances view