Forum Discussion
OpenShift : iRule for redirecting to Status URL if PODs are unreachable
Dears,
We would like to redirect traffic to an external status page if the PODs in our Openshift environment are unreachable. In the ASM config, the members of the related pools are the openshift routers interfaces. I lack knowledge in the field, that's why I am asking for advice here. Would the following iRule work in this situation ?
when HTTP_RESPONSE { if { [HTTP::status] contains "404"} { HTTP::redirect "http://www.siterequest.com/" }}
Regards,
- AMiles_377865
Cirrocumulus
Hello Elliot,
That looks reasonable. The only thing I am a little uncertain of is the exact response a downed POD will make to the F5, which is why I might consider triggering the irule from a monitor instead of the HTTP response event. That way, if your F5 registers all pool members are down, users will be directed straight to the status page.
Best of luck,
Austin
- h_elyot
Nimbostratus
Hi Austin,
Thank you for the reply. Regarding the code itself, I should probably use { if { [HTTP::status] contains "503"} instead of { if { [HTTP::status] contains "404"} Now about triggering the iRule from a monitor,I thought about your idea but I am not sure it will work because monitors do not currently return any information to iRules other that up/down status of the pool. As the pool members are the network interfaces of the Openshift routers and not the Openshift PODs themselves, the result could be misleading.
Regards
- Karim
Cirrostratus
Hi,
The issue with your iRule is that is doesn't not take into consideration the health status of your pool members.
I would suggest this: in the HTTP profile there is a property called "Fallback Host". When all your pool members are marked down by the monitor assigned to the pool, the bigip will send a 302 response.
Many thanks,
Karim
- h_elyot
Nimbostratus
Hi Karim,
Thanks for the suggestion. So using http://www.statuspage.com as Fallback Host in the profile should do the job, instead of using a iRule, if I understand well?
Regards
- Karim
Cirrostratus
Hi,
Yes, the fallback host will redirect client only in the following situations :
-
A pool member is not chosen (the system failed to select a pool or a pool member, or no pool members were available).
-
A pool member is unreachable (when no route to the target exists).
-
A pool member is unresponsive (resets a connection request).
-
A pool member closes an established connection before the request is sent.
More info here : https://support.f5.com/csp/article/K6510
Many thanks,
Karim
-
Hi,
The issue with your iRule is that is doesn't not take into consideration the health status of your pool members.
I would suggest this: in the HTTP profile there is a property called "Fallback Host". When all your pool members are marked down by the monitor assigned to the pool, the bigip will send a 302 response.
Many thanks,
Karim
- h_elyot
Nimbostratus
Hi Karim,
Thanks for the suggestion. So using http://www.statuspage.com/ as Fallback Host in the profile should do the job, instead of using a iRule, if I understand well?
Regards
Hi,
Yes, the fallback host will redirect client only in the following situations :
-
A pool member is not chosen (the system failed to select a pool or a pool member, or no pool members were available).
-
A pool member is unreachable (when no route to the target exists).
-
A pool member is unresponsive (resets a connection request).
-
A pool member closes an established connection before the request is sent.
More info here : https://support.f5.com/csp/article/K6510
Many thanks,
Karim
-
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