Citrix NetScaler plugin
The Citrix NetScaler Application Delivery Controller plugin enables Deploy to manage deployments to applications and web servers whose traffic is managed by a NetScaler load-balancing device.
For more information, see NetScaler plugin.
- Remove servers or services out of the load balancing pool before deployment.
- Add servers or services back into the load balancing pool after deployment is complete.
The plugin supports two modes of working:
- Service group-based
The plugin works in conjunction with the “group-based” orchestrator to disable and enable containers which are part of a single deployment group.
The group-based orchestrator will divide up the deployment into multiple phases, based on the ‘deploymentGroup’ property of the containers that are being targeted. Each of these group will be disabled in the NetScaler before they are deployed to, and will be re-enabled after deployment to that group. This will ensure that there is no downtime during the deployment.
The plugin will add the following four properties to every deployable and deployed to control which service, in which service group, this deployed affects.
||STRING||The name of the service group that the service, running on the targeted container, is registered under (default:
||STRING||The name of the service in the service group (default:
||STRING||The port the service, in the service group, is running on (default:
Note: This is a string on the deployable to support placeholder replacement.
The plugin will add the following properties to every container to control how the server is managed in the NetScaler ADC, and how long it should take to do a graceful disable of the server:
||STRING||The IP address or name this server is registered under in the NetScaler load balancer.|
||STRING||Whether this is a ‘server’ or a ‘service’ in the NetScaler load balancer (default: server).|
||INTEGER||The amount of seconds before the server is disabled in the NetScaler load balancer. A value of -1 triggers use of the defaultShutdownDelay of the NetScaler device (default: -1).|
The plugin will add three steps to the deployment of each deployment group:
- A disable server step. This will stop the traffic to the servers that is managed by the load balancer.
- A wait step. In this step, a wait period is added for the maximum shutdown delay period.
- An enable server step. This will enable the traffic to the servers that were previously disabled.
Setting up a load-balancing configuration
To setup Deploy to use your NetScaler ADC device, follow the steps below:
- Create a NetScaler (
netscaler.NetScaler) configuration item in the Infrastructure tree under a host, and add it as a
udm.Environment. The host configuration item indicates how to connect to the NetScaler device.
- Add all the containers that the NetScaler device manages to the
managedServerscollection of the created NetScaler CIs.
For the service group based setup, you can create dictionaries restricted to containers in the environment. Each dictionary must contain the following keys:
As a second option, you can do an initial deployment and set the values correctly on all the deployeds. During an upgrade deployment these values will be copied from the previous deployment.
netscalerAddress property of each of the containers so that the NetScaler configuration item knows how the container is managed within the NetScaler ADC device. During any deployment to the environment, the NetScaler plugin will ensure that the load-balancing logic is implemented.
Load-balancing a mixed application server and web server environment
If you have an Apache
httpd server which fronts a website backed by one or more application servers, it is possible to setup a more complex loadbalancing scenario, ensuring that the served website is not broken during the deployment. For this, the
www.ApacheHttpdServer configuration item from the standard web server plugin is augmented with a property called
When a deployment is completed to one or more of the containers mentioned in the
applicationServers, that reside in the same environment as the web server, the following happens in addition to the standard behavior:
- Before the first application server is be deployed to, the web server is removed from the load-balancing configuration.
- After the last application server linked to the web server has been deployed to, the web server is added into the load-balancing configuration.
By default, the disable and enable server scripts are called:
They contain the NetScaler CLI commands to influence the load balancing. They are FreeMarker templates which have access to the following variables during resolution:
servers: A list of
ServerOrService) that are to be enabled/disabled.
netscaler.NetScalerload balancer that manages the servers.