Can we make envoy create a cookie? Sticky sessions issue

Hi, I have a bit of a situation where an app that relies on websockets isn’t working when there are multiple pods in the deployment. I need some way of setting session affinity so that all requests from any particular user go to the same pod. Due to the setup here, we do not see the requestors IP address.

I was thinking that I could use a session cookie to do this, but the app doesn’t set any useful cookies (it’s a third party app we can’t change). So, is it possible to configure the envoy sidecar to generate and return a cookie to the user with a UUID (presumably in the VirtualService)? Then, I could a DestinationRule to configure sticky sessions based on that same cookie?

Can an EnvoyFilter be used to do this?

This was my mistake. I hadn’t read the manual thoroughly, and didn’t understand that a DestinationRule loadbalancing on a cookie would create that cookie if it didn’t exist. Easy fix.