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 duration
annotation 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:
- kubectl get ingress (Get the current ingress)
PS C:\aks> kubectl get ingress -n my-namespace
NAME CLASS HOSTS ADDRESS PORTS AGE
my-ingress <none> * 52.152.91.154 80 10m
- Edit the ingress configuration using
edit
command
kubectl edit ingress my-ingress -n my-namespace
(It will open a new file in a notepad)
PS C:\aks> kubectl edit ingress my-ingress -n my-namespace
ingress.networking.k8s.io/my-ingress edited
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