I need some help with Kong. I have just started playing around Kong.
My high level design:
Kong is sitting behind ALB on an EKS cluster. And Kong is acting as a gateway and forwarding request to the backend services.
ALB → Multi instance Kong → Multi instance backend services(pods)
My use case:
Multiple clients connect with ALB and they upload images. We run multiple instances of backend services as pods. Now we want to send one complete image to one single pod and for this we need session based stickiness.(we can not use IP based stickiness)
If we enabled duration based cookies on ALB for achieving stickiness then traffic from a particular client will go to a particular Kong instance. Now from Kong to backend pods how can I make sure that the traffic should go to a particular pod during an image upload from a client ?
Can we achieve this by using the session plugin provided by Kong ? If yes then how ?
Does session plugin need any other plugin(auth plugin) for generating session ?
Is it possible to achieve stickiness in DBLess mode ?
Do I need to use hash_on, hash_on_cookie, hash_on_cookie_path for achieving stickiness ? If yes then how can I configure it in DBLess mode in the helm chart ?
This is my declarative-config.yaml for my Kong running in DBLess mode.
The below config I am using to achieve stickiness. (I have used ALB ingress controller in front of kong gateway and kong gateway is in front of multiple instances of httpserver)
But I am not able to achieve stickiness with the below config, I am not sure what I am missing here.
Can someone please help me with this.
- name: httpserver-service
- name: duration
- name: httpserver-service-health
- name: health
- name: httpserver-service-upstream
- target: httpserver-service.default.svc.cluster.local:8084
- username: some-consumer-user
- name: session
- name: hmac-auth
- consumer: some-consumer-user