Sticky Requests for K8 hostname based on primary key (modulo routing)

11/20/2017

Is it possible to configure k8 so that based on some data in a request it is always routed to the same hostname?

Perhaps something using stateful sets? Can we do a modulo based routing so that a request like POST /myroute { _id : 1 }

will always go to one hostname,

and a request like

POST /myroute { _id : 2 } will always go to another??

Or is there away so that each host can ignore requests based on the payload. This is a pretty standard routing method, similar to a distributed hash table.

Sorry if I'm not explaining this well. But does anyone have any example of this type of k8 configuration?

-- cphoover
devops
kubernetes

1 Answer

11/21/2017
-- Grigoriev Nick
Source: StackOverflow