on 21-Dec-2022 12:14
Following up on my previous community article about Layer 7 Content Switching in F5 Distributed Cloud (XC) I wanted to share my experience setting up persistence. Again the terms used in XC differ from the terms we are used to from BIG-IP, but they are not completely unfamiliar to anyone who knows the 101 of web applications. The term used in XC is Stickiness.
This time a made a small change, I changed the LoadBalancer Algorithm to Load Balancer Override. This way I can set the Stickiness in the HTTP Loadbalancer configuration.
In the Routes configuration of the HTTP Loadbalancer I modified the Advanced Options.
The menu item to configure here is Load Balancing Control.
Testing with Cookie Based Stickiness cURL successfully proves my setup is working as intended. A request with cURL will return me a cookie, I called mine MyTastyCookie.
(I tested Source IP Stickiness too, it works equally reliable.)
daniel@tux curl http://demo01.mydomain.com -v
* Trying 72.19.3.202:80...
* Connected to demo01.mydomain.com (72.19.3.202) port 80 (#0)
> GET / HTTP/1.1
> Host: demo01.mydomain.com
> User-Agent: curl/7.83.1
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< date: Mon, 19 Dec 2022 14:25:30 GMT
< server: volt-adc
< expires: Thu, 19 Nov 1981 08:52:00 GMT
< cache-control: no-store, no-cache, must-revalidate
< pragma: no-cache
< vary: Accept-Encoding
< content-length: 176
< content-type: text/html; charset=UTF-8
< x-envoy-upstream-service-time: 6
< set-cookie: MyTastyCookie="d564cc5ca331163f"; Max-Age=60; Path=/; HttpOnly
< x-volterra-location: fr4-fra
<
<!DOCTYPE html>
<html>
<head>
<title>Server 2</title>
</head>
<body>
<h1>This is Server 2</h1>
</html>
Sending this cookie with all my subsequent cURL requests will always take me back to Server 2 from my Origin Pool.
daniel@tux curl http://demo01.mydomain.com -v --cookie MyTastyCookie="d564cc5ca331163f"
* Trying 72.19.3.202:80...
* Connected to demo01.mydomain.com (72.19.3.202) port 80 (#0)
> GET / HTTP/1.1
> Host: demo01.mydomain.com
> User-Agent: curl/7.83.1
> Accept: */*
> Cookie: MyTastyCookie=d564cc5ca331163f
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< date: Mon, 19 Dec 2022 14:25:48 GMT
< server: volt-adc
< expires: Thu, 19 Nov 1981 08:52:00 GMT
< cache-control: no-store, no-cache, must-revalidate
< pragma: no-cache
< vary: Accept-Encoding
< content-length: 176
< content-type: text/html; charset=UTF-8
< x-envoy-upstream-service-time: 3
< x-volterra-location: fr4-fra
<
<!DOCTYPE html>
<html>
<head>
<title>Server 2</title>
</head>
<body>
<h1>This is Server 2</h1>
</html>