Sticky session in Kubernetes

As we know RESTful API is stateless, every request will be forward to backend server by round robin mechanism.

But in some scenario we need sticky session which means request from one client should be forward to one backend server.

After checking kubernetes documentation we added some annotations under ingress configuration, and it works well.

annotations: "cookie" "router" "sha1"

If you open Developer Tools in Chrome, you will find the cookie.