This document describes the functionality provided by the xld-nginx-plus-plugin. The purpose of the plugin is to support basic Nginx Plus blue-green functionality.
See the XL Deploy reference manual for background information on XL Deploy and deployment automation concepts.
This plugin adds the Nginx Plus Server type to XL Deploy and makes it possible to designate other servers as being part of a an Nginx Plus Upstream Group. During the execution of a deployment to servers associated with an XL Deploy environment, the plugin will add the following steps to the deployment process:
- The Nginx Plus server is queried to retrieve the Nginx Plus IDs of all environment containers (servers) that are also members of the Nginx upstream group.
- For each environment container (server) that is also a member of the upstream group, the plugin updates the Nginx Plus upstream member server's 'down' attribute to 'true'. Nginx Plus will stop directing traffic to these servers.
- After all servers have been marked as 'down', deployment takes place.
- When deployment is complete, all servers previously marked down will be marked up by setting their 'down' attribute to 'false'.
Members of an Nginx Plus upstream group can be divided into a Blue environment and a Green environment within XL Deploy. XL Deploy can then deploy to one environment at a time while Nginx Plus ensures that end user traffic is never directed to a server that is in the process of being updated.
- Requirements
- XL Release 8.6.1+
- Nginx Plus that supports Nginx Plus API v4
- Copy the latest JAR file from the releases page into the
XL_DEPLOY_SERVER/plugins
directory. - Restart the XL Deploy server.
Begin by configuring an Nginx Plus Server.
Note: This is the Nginx Plus Server and not a member of the Nginx Plus Upstream Group. Leave the Upstream Group configuration section empty.
Enter the IP address and port number Nginx Plus uses to identify this server.
Enter the Nginx Plus upstream group name that this server is part of.
Default value is 4. It is possible that the plugin will function properly with lower versions, though this has not been tested.
Use the drop down to choose the Nginx Plus Server previously configured in XL Deploy.
Divide the upstream group members, adding some as containers in the Blue environment and the rest as containers in the Green environment.
Example of a successful deployment, showing steps: