Forum Discussion
No Default POOL
We have an irule for a vip that sends the request to 1 of 4 POOLs depending on the URI. How would you make it so that if 1 of the URIs is not present that no default POOL is available and the request is dropped?
4 Replies
- Kevin_Stewart
Employee
This is how I might do it:
-
Create your 4 pools and apply application-specific monitors to each (to test availability of a given URI).
-
Apply the following iRule logic (modify as required):
when HTTP_REQUEST { if { [active_members poolA] < 1 } { drop } else { switch -glob [string tolower [HTTP::uri]] { "/app1*" { pool poolA } "/app2*" { pool poolB } "/app3*" { pool poolC } default { drop } } } }
So in this case, assuming poolA is the pool that contains the URI that must always be available, the monitor applied to poolA will determine if the given URI is alive. If not, drop the request. Otherwise switch between the pools based on the URI.
-
- Lee_Payne_53457
Cirrostratus
It depends on how you wrote the iRule but I would do a switch statement with a default case to catch it when no matches are made, something like this:
https://devcentral.f5.com/questions/irule-to-select-pool-based-on-fqdn
- PicassoMendez
Nimbostratus
Do I still need to include a POOL in the Virtual Server configuration? I notice if I don't it goes into unknown status.
- Kevin_Stewart
Employee
As long as you're providing pool assignment inside the iRule, then you don't technically need a pool assigned to the VIP.
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com