I am facing a problem where my backend application is doing some complex calculation and due to which its taking more more than 2 minutes to complete and I am constantly getting 504 gateway timeout.
When I check the logs using pod logs watch command, I can see that the process is running smoothly and its finished its task without any error.
Please help to fix.
Here is my solution:
My backend application (SprintBoot app) was performing some complex calculation and I was getting 504 Gateway Timeout, while the calculation was performing its work at the backend.
After investing the issue, I found out that this problem is related to
idle timeout durationannotation in the kubernetes ingress configuration. My timeout was set to 120 seconds which wasn't enough for calculation and the calculation was taking more time to complete.To resolve this issue, I updated the following annotation in the ingress.
alb.ingress.kubernetes.io/load-balancer-attributes: idle_timeout.timeout_seconds=300.To update in Windows, I performed the following steps:
editcommandkubectl edit ingress my-ingress -n my-namespace(It will open a new file in a notepad)In the notepad , you can go-ahead and modify the service name and save it.
Once you see this message
ingress.networking.k8s.io/my-ingress edited, this means the changes have been applied.I took help from following articles and wanna share here for the readers