Docker to BIG-IP: Map container names to pool/node

Problem this snippet solves:

The associated iRule is used in the DevCentral article:

This is a variation of

How to use this snippet:

Attach to virtual server. Expects two data groups exist: dg_docker_container and dg_docker_pool

Code :

  set host_hdr [getfield [HTTP::host] ":" 1]
  set host_short [getfield $host_hdr "." 1]

  set node_addr [class match -value [string tolower $host_short] equals dg_docker_container]
  if { $node_addr ne "" } {
    node $node_addr
  } else {
    set pool_name [class match -value [string tolower $host_short] equals dg_docker_pool]
    if { $pool_name ne "" }
      pool $pool_name
    } else {

Tested this on version:

Published Sep 01, 2015
Version 1.0

Was this article helpful?

No CommentsBe the first to comment