Service Discovery

Service Discovery is a license key controlled feature and is not available on all Traffic Manager variants. See the Ivanti Web site for details about supported configurations.

Traffic Manager pools can contain dynamic node lists populated and managed by a Service Discovery plug-in script. This ability allows you to configure your pools to be autoscaled by an external or remote service through a suitable script or program.

This feature is related to the Traffic Manager’s built-in autoscaling capability. Although, through Service Discovery, a pool’s node list is managed externally rather than internally. To learn more about pool autoscaling, see Autoscaling.

To configure a new pool to use Service Discovery, set the pool type to Dynamic... and select a suitable Service Discovery Plug-in from the drop-down list:

Alternatively, to convert an existing static pool to use a Service Discovery plug-in, click Services > Pools > Edit > Service Discovery and set service_discovery!enabled to “Yes”:

The following settings enable you to further configure Service Discovery for your pool:

Setting

Description

service_discovery!enabled

Turns Service Discovery on or off for a pool.

You cannot enable Service Discovery if this pool is already using either Autoscaling or DNS-derived Autoscaling. If you are currently using either of these features for this pool, you must disable them before enabling Service Discovery.

service_discovery!plugin

The Service Discovery plug-in to use for this pool.

service_discovery!plugin_args

The arguments to pass to the plug-in, as a single string.

All built-in plug-ins expect arguments in the form "--key1=value1 --key2=value2". For full details of the arguments required for each plug-in, see the Catalogs > Service Discovery Plugins catalog > Built-in Plugins UI Help page.

For user-provided plug-ins, this setting is optional.

For all plug-in types, this setting is not included in Technical Support Reports due to the possibility of security credentials being specified in the argument string.

service_discovery!interval

The poll interval for the plug-in, in whole seconds.

This setting specifies the amount of time that must pass between each execution of the plug-in. If the previous execution has not finished, or timed out before the interval has elapsed, the plug-in does not run again until it has completed.

To override this default interval with a temporary shorter interval, use the "interval_override" field in the plug-in response. For more information, see Custom User Plug-ins.

service_discovery!timeout

The timeout value for each execution of the plug-in.

This setting specifies how long the Traffic Manager must wait before assuming a plug-in execution cycle has failed or halted.

In the event a plug-in does not complete execution within the timeout period, the pool continues to use the most recently-obtained list of nodes.

Service Discovery plug-ins are standalone scripts or executable binaries which retrieve a list of nodes (active, draining, and disabled) from a remote service. A pool configured to use one of these plug-ins can update its nodes list based on the response from the plug-in.

Plug-ins are either built-in or user-provided, and stored in the "Service Discovery Plugins" catalog. To view the list of plug-ins, click Catalogs > Service Discovery.

Built-in Plug-ins

The Traffic Manager includes a number of predefined plug-in scripts designed to provide a dynamically-generated node list using the named external service. Each plug-in requires you to provide a series of input arguments in order to establish a connection to the service. These arguments are provided in the pool configuration and are unique to a specific pool. Hence, you can re-use the plug-in with multiple pools each obtaining their node list from a different instance of the external service.

The Traffic Manager provides the ability to test a connection in the plug-in catalog page. The required arguments are listed in the plug-in description in the form a list of --argument=value expressions. In the “Test Plugin” section, type an argument string into the Arguments text box, then click Test to test the connection.

The results of the test are displayed as soon as they are received.

Some plug-ins might require further software or tools to operate correctly. See the UI Help pages that accompany the plug-in for full details.

Custom User Plug-ins

The Traffic Manager includes the capability for adding custom service discovery plug-in scripts and programs. Plug-ins must be executable directly from a terminal (for example, a script starting with a "#!" line) and provide the node list in a specific format on STDOUT. The Traffic Manager does not use or respond to either the exit code or STDERR, although error reporting is possible through the script output format described in this section.

Ivanti recommends that you do not request user credentials or other sensitive information through the input arguments interface (service_discovery!plugin_args) in the pool configuration. If you need to pass in potentially sensitive argument values, consider instead using environment variables or a separate input file read from disk. Note, however, that plug-in arguments are not included in Technical Support Reports.

The Traffic Manager operates a specification version system for custom Service Discovery plug-ins. Each new Traffic Manager release might introduce a new specification version to take advantage of new features and better performance. Older specification versions continue to be supported until such a time as it becomes necessary to deprecate them for technical or support reasons. Ivanti communicates the currently-supported specification versions in the UI Help pages and through the product release notes. For full details, contact Pulse Secure Technical Support.

The script output must conform to a JSON structure, containing the following properties at the top level:

Property

Type

Description

version

Integer

Required. The version of the plug-in specification this script conforms to.

code

Integer

Required. An HTTP status code to represent the status of the run. Use "200" for successful completion.

error

String

Optional. An error message to be printed to the Traffic Manager Event Log if the plug-in has failed in some way.

interval_override

Integer

Optional. Overrides the poll interval specified in the pool configuration with a smaller interval, until the next time the plug-in runs. If this value is larger than the configured pool interval, it is ignored.

nodes

Hash Array

Required. A list of nodes.

The list of nodes contains:

ip

Required string. The address of the node.

port

Required integer. The port number of this node.

weight

Optional integer. A number used to represent the weighting to apply to this node, relative to all other nodes. Use this field if your service uses a weighted load balancing algorithm, such as weighted round robin. For more information, see Load Balancing.

draining

Optional boolean. Set to true to establish this node as being in a "draining" state.

disabled

Optional boolean. Set to true to establish this node as disabled and not accepting traffic. This can be useful as a default, or fall-back, position in your script, such that the pool is populated with a notional list of what nodes would be present in the event of an error.

The following JSON structure gives an example of a custom plug-in output:

{

   "version":1,

   "nodes":[

      { "ip":"192.0.2.0", "port":80 },

      { "ip":"192.0.2.1", "port":81, "draining":true }

   ],

   "code":200

}