
Explanation:
The correct approach is to handle the SIGTERM signal in the application. When Kubernetes terminates a Pod, it sends a SIGTERM signal to allow the application to shut down gracefully. Updating the code to catch this signal (Option A) ensures the application closes the database connection and performs cleanup before termination.
Ultimate access to all questions.
How can you modify your application to ensure a graceful shutdown during a deployment update in Google Kubernetes Engine, particularly to properly close database connections before termination?
A
Update your code to process a received SIGTERM signal to gracefully disconnect from the database.
B
Configure a PodDisruptionBudget to prevent the Pod from being forcefully shut down.
C
Increase the terminationGracePeriodSeconds for your application.
D
Configure a PreStop hook to shut down your application.
No comments yet.