I’m working on a project that will stand up multiple pods of compute resources in our AWS environment and will begin to spread our customer load across those pods. Each pod is fronted by AWS ALBs backed by containerized services.
What I’m trying to accomplish with workers is to enable the mutli-pod routing in a worker based on a specific header that we’ll be setting in our customer premise deployed software.
The flow will be as follows:
- Software connects to the current domain: agent.mydomain.com
- If the header “multi-pod-routing” is present, but has no value, send the connection along to the currently configured origin (no real change in proxying behavior)
- If the header is not present, send the connection to the currently configured origin
- My services will then do some work and tell the software what it’s value for the “multi-pod-routing” header should be
- The software will then make another connection to agent.mydomain.com with “multi-pod-routing: 12345-abcdef-67890-ghijk”
- I’ll have a map in a KV store of origin to header value
- Get the origin for the given value and then send the connection to the proper origin
I think I have a handle on checking the header and value and how to create a KV namespace, populate it, and read from the KV namespace, but what I’m not grasping (yet, I’m new) is how to send the connections to the origins properly. I don’t want to redirect because I don’t want the name in the connection to change (software is always connecting to agent.mydomain.com), I want to continue having the connection proxied through CF. Is this possible with workers? Thanks in advance for all pointers or advice.