@Timo Notheisen this issue has been fixed in ALB Controller v1.6.7. https://learn.microsoft.com/azure/application-gateway/for-containers/alb-controller-release-notes
Please let us know how it goes!
Jack
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I have a server that supports server-sent events. When running this server locally, everything works as expected.
But as soon as I deploy it in an AKS Kubernetes cluster in front of an Azure Application Gateway for Containers, the SSE connection times out after 60 seconds. After some research, I found the following documentation: https://learn.microsoft.com/en-us/azure/application-gateway/for-containers/server-sent-events?tabs=server-sent-events-gateway-api. There it's stated that you should create a RoutePolicy
and configure a timeout of 0s. But doing so doesn't change anything. The observed timeout remains 60s.
I then played around with the RoutePolicy
a bit. And in case the timeout is higher than 0s and lower than 300s, the RoutePolicy
works. But (as mentioned above) 0s doesn't seem to do anything at all. And any value greater than 300s leads to a 300s timeout. So the 300s appears to be the maximum.
Kubernetes version: 1.29.11.
alb-controller Helm Chart version: 1.3.7
I created a minimal example, which you can find on GitHub: https://github.com/tnotheis/SseServerTest
You can run the SSE server locally with the following command:
dotnet run dotnet run -p .\SseServerTest\SseServerTest.csproj
Afterwards, open http://localhost:5293/sse in your browser. You will receive 1 event per second, which makes it easy to see after which time a timeout occurs.
You will notice that, when running it locally, there will never be a timeout.
I further added a kubernetes.yaml file, which contains all Kubernetes resources necessary to deploy the application into a cluster with an already existing Azure Application Gateway for Containers. Just make sure to replace the name of the gateway
resource as well as the hostname (both places are marked with TODO
comments).
@Timo Notheisen this issue has been fixed in ALB Controller v1.6.7. https://learn.microsoft.com/azure/application-gateway/for-containers/alb-controller-release-notes
Please let us know how it goes!
Jack
Hi Timo Notheisen,
Thank you for your reply.
I understand your latest comment. Regardless of the timeout settings, it always times out after 60 seconds. If that is the case, This suggests that the timeout might be overridden, possibly due to an older configuration with a default timeout of 60 seconds in the Ingress. Could you please check the configuration for any default settings that might be causing this issue? Let me know if you find any configuration conflicts
Additionally, as you mentioned that it works locally but encounters issues when deployed in AKS, could you please provide some information on how you set up the SSE locally? It would be helpful to get an overview of the overall setup and the steps you followed for both the local environment and the AKS deployment. This will allow us to identify any potential configuration conflicts or differences