When the kubectl pod delete command is issued, it isn’t waiting for the shutdown hook in a Java Kafka consumer and producer application to complete processing any unprocessed events. What steps need to be taken to ensure the application gracefully exits after the kubectl pod delete command is fired?
Tried Prestop lifecycle hook.
Prestop:
kill -SIGTERM pid ; sleep 5min
Added kill as well as sleep to reduce the event loss.
But this is not working as expected. Please suggest a better way of handling this.
vishwaja reddy is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.