You can set a cookie name to overwrite the default, auto-generated one for the route. This allows the application receiving route traffic to know the cookie name. By deleting the cookie it can force the next request to re-choose an endpoint. So, if a server was overloaded it tries to remove the requests from the client and redistribute them.
Procedure
-
Annotate the route with the desired cookie name:
$ oc annotate route <route_name> router.openshift.io/<cookie_name>="-<cookie_annotation>"For example, to annotate the cookie name of
my_cookieto themy_routewith the annotation ofmy_cookie_anno:$ oc annotate route my_route router.openshift.io/my_cookie="-my_cookie_anno" -
Save the cookie, and access the route:
$ curl $my_route -k -c /tmp/my_cookie