How to configure sticky routes based on x-forwarded-for header in OpenShift 4?

Solution Verified - Updated -

Issue

  • There is a use case where the http route needs to be stateful (sticky) to make sure the visitor always returns to the same pod (as long the pod exists). Is there any way to make the HAProxy to use balance: source but look at the ip address in the x-forwarded-for header instead of the source ip seen by HAProxy?

Environment

  • Red Hat OpenShift Container Platform (RHOCP)
    • 4
  • Sticky sessions
  • HAProxy
  • x-forwarded-for

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content