I would like to know if we have support for websockets. Which steps to do it? Any annotations?
The AWS ALB supported websockets from the beginning. https://aws.amazon.com/blogs/aws/new-aws-application-load-balancer/
Yes, but when you have N replicas deployed, i've a problem, because i receive a 400 error handshake some times.
I fixed adding sessionAffinity on my service definition as ClientIP.
It works now, without session id unknown message error in the polling requests.
Hi @rmrbest I'm curious in how you fixed it. I've checked and ingress doesn't provide sessionAffinity option.
@ricardohsd you define sessionAffinity on your service's spec:
apiVersion: v1
kind: Service
metadata:
...
spec:
type: NodePort
sessionAffinity: ClientIP
Actually I'm also seeing handshake errors even with sessionAffinity: ClientIP. The error happens when socketio tries to upgrade its transport from polling to websockets.
If I enable stickiness in the ALB the errors mostly go away. However, I still get the handshake 400 errors, just less frequently/reproducibly.
Would anyone have ideas for how to debug this? I'm not sure I understand why sessionAffinity: ClientIP is not enough and stickiness needs to be enabled at all.
cc @rmrbest would you be able to share your exact set up and manifests? Thanks!
@sohan : are you able to solve the issue?? could someone provide the solution.
@vrathore18 I wasn't able to solve this issue. We worked around it instead by disabling the polling transport for socket.io. I.e. on our clients, we use:
const io = require('socket.io-client');
const socket = io(path, { transports: ['websocket'] });
I also removed the sessionAffinity setting from our service.
@sohan I have posted instructions on how to use websocket/socket.io in https://github.com/kubernetes-sigs/aws-alb-ingress-controller/issues/1090, socket.io is not websocket
Most helpful comment
Actually I'm also seeing handshake errors even with
sessionAffinity: ClientIP. The error happens when socketio tries to upgrade its transport from polling to websockets.If I enable stickiness in the ALB the errors mostly go away. However, I still get the handshake 400 errors, just less frequently/reproducibly.
Would anyone have ideas for how to debug this? I'm not sure I understand why
sessionAffinity: ClientIPis not enough and stickiness needs to be enabled at all.cc @rmrbest would you be able to share your exact set up and manifests? Thanks!