Forum Discussion

Patrik_Jonsson's avatar
Nov 14, 2013

Have a member dedicated for softlaunch/test

Hi there!

We have a situation where the developers wants to have a pool member that's used only for testing purposes and only:

  1. From our external office IP.
  2. When it's up.

Here's a simplified version of the irule right now:

set [HTTP::host] host

switch $host {
    "subomain1.domain.com"          { pool subomain1.domain.com-5601_pool }
    "subomain2.domain.com"          { pool subomain2.domain.com-5602_pool }
    "subomain3.domain.com"          { pool subomain3.domain.com-5603_pool }
    default             { pool www.domain.com-5600_pool }
}

Suggestion 1:

A thought would be to add priority groups and set ie. 100 for the production servers and 0 for the test server. This would make me have to expand the pool selection irule:

if { [LB::status node 10.0.0.1] eq "up" && [IP::remote_addr] eq $office } {
    set testnode 1
} else {
    set testnode 0
}

set [HTTP::host] host

switch $host {
    "subomain1.domain.com"          { if{ $testnode } { pool subomain1.domain.com-5601_pool member 10.0.0.1 } else { pool subomain1.domain.com-5601_pool } }
    "subomain2.domain.com"          { if{ $testnode } { pool subomain2.domain.com-5601_pool member 10.0.0.1 } else { pool subomain2.domain.com-5601_pool } }
    "subomain3.domain.com"          { if{ $testnode } { pool subomain3.domain.com-5601_pool member 10.0.0.1 } else { pool subomain3.domain.com-5601_pool } }
    default             { if{ $testnode } { pool subomain1.domain.com-5601_pool member 10.0.0.1 } else { pool subomain1.domain.com-5601_pool } }
}

Suggestion 2:

Add http bindings on the sites for port 80 and the host header of domain.

set [HTTP::host] host   
if { [LB::status node 10.0.0.1] eq "up" && [IP::remote_addr] eq $office } {
    pool testpool.domain.com
} else {
    switch $host {
        "subomain1.domain.com"          { pool subomain1.domain.com-5601_pool }
        "subomain2.domain.com"          { pool subomain2.domain.com-5602_pool }
        "subomain3.domain.com"          { pool subomain3.domain.com-5603_pool }
    default             { pool www.domain.com-5600_pool }
}

This is still in the design phase and I already feel nausea when looking at option 1 and option 2 seems like a viable alternative but I can't get it out of my head that there has to be a better way. I'm a big fan of standardization and clean rules and try to avoid quick and dirty fixes in general.

Surely this must not be the first time someone got a request like this? Grateful for any suggestions or input!

Kind regards,

Patrik

3 Replies

No RepliesBe the first to reply