Error:-
Kubernetes including EKS uses the Rolling deployment by default for deploying the applications with Zero Downtime. Generally this works perfectly fine but during a recent major change we tested our application deployment in staging environment before deploying it into production to determine if any downtime will be there and than arrange the deployment accordingly.
what we did was a curl request which gets executed every 1 second interval and what we figured out was quite unusal that while application written in Kotlin java gave 503 Service unavailable during the deployment which was not expected since we expected zero downtime because we were using Rolling deployment.
Cause:-
To deploy an application which will really update with zero downtime the application should meet some requirements. To mention few of them:
1. application should handle graceful shutdown
2. application should implement readiness and liveness probes correctly
Solution :-
In our case on further examination we found that the application was missing the graceful shutdown for this particular service in the staging environment. In more general the configmap for the particular application was missing which cause the 503 Service unavailable issue while testing after creating the configmap the issue got resolved.
This gives us some hint what could be wrong considering these things is important for zero downtime.