Citrix NetScaler plugin

The Citrix NetScaler Application Delivery Controller plugin enables XL 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.

Features

  • 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.

Functionality

The plugin supports two modes of working:

  1. Service group-based
  2. Server/Service-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.

Service group-based

The plugin will add the following four properties to every deployable and deployed to control which service, in which service group, this deployed affects.

Property Type Description
netscalerServiceGroup STRING The name of the service group that the service, running on the targeted container, is registered under (default: {{NETSCALER_SERVICE_GROUP}}.
netscalerServiceGroupName STRING The name of the service in the service group (default: {{NETSCALER_SERVICE_GROUP_NAME}}).
netscalerServiceGroupPort STRING The port the service, in the service group, is running on (default: {{NETSCALER_SERVICE_GROUP_PORT}}).
Note: This is a string on the deployable to support placeholder replacement.

Server/Service-based

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:

Property Type Description
netscalerAddress STRING The IP address or name this server is registered under in the NetScaler load balancer.
netscalerType STRING Whether this is a ‘server’ or a ‘service’ in the NetScaler load balancer (default: server).
netscalerShutdownDelay 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).

Behavior

The plugin will add three steps to the deployment of each deployment group:

  1. A disable server step. This will stop the traffic to the servers that is managed by the load balancer.
  2. A wait step. In this step, a wait period is added for the maximum shutdown delay period.
  3. An enable server step. This will enable the traffic to the servers that were previously disabled.

Setting up a load-balancing configuration

To setup XL Deploy to use your NetScaler ADC device, follow the steps below:

  1. Create a NetScaler (netscaler.NetScaler) configuration item in the Infrastructure tree under a host, and add it as a member to the udm.Environment. The host configuration item indicates how to connect to the NetScaler device.
  2. Add all the containers that the NetScaler device manages to the managedServers collection of the created NetScaler CIs.

Service group-based

For the service group based setup, you can create dictionaries restricted to containers in the environment. Each dictionary must contain the following keys:

  • NETSCALER_SERVICE_GROUP
  • NETSCALER_SERVICE_GROUP_NAME
  • NETSCALER_SERVICE_GROUP_PORT

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.

Server/Service-based

Configure the 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 applicationServers.

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:

  1. Before the first application server is be deployed to, the web server is removed from the load-balancing configuration.
  2. After the last application server linked to the web server has been deployed to, the web server is added into the load-balancing configuration.

Customization

By default, the disable and enable server scripts are called:

  • netscaler/disable-server.cli.ftl
  • netscaler/enable-server.cli.ftl

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 NetScalerItem (ServiceGroup or ServerOrService) that are to be enabled/disabled.
  • loadBalancer: The netscaler.NetScaler load balancer that manages the servers.