custom load balancing within kubernetes custom load balancing within kubernetes kubernetes kubernetes

custom load balancing within kubernetes


This sounds like a use-case where you are doing authentication through the front-end loadbalancer. Have you looked at Istio and Ambassador. Seems like Istio and Envoy could provide the service mesh to route the requests to the pods. Then you would have to write a custom plugin module into Ambassador to create this specific routing and authentication mechanism that you are seeking.

Example of Ambassador custom authentication service: https://www.getambassador.io/user-guide/auth-tutorial

https://www.getambassador.io/user-guide/with-istio

This custom sticky session routing can also be done using other API gateways but still using Istio for routing to the different pods. However it would be best if the pods are defined as separate services in order to have easier segmentation by the API gateway (Ambassador, Kong, Nginx) based on the parameters of the message body.