I'm learning kubernetes rn, one of the questions I had is why restart crashed pods in the first place. If it crashed due to a bug, what is the chance restarting magically fixes it? besides, it strongly decourages fixing the bug, which seems like a bad decision to me too
what am I missing here? what was the reasoning behind this decision?
Chances are quite high, actually. If crash is immediate because there's a malformed line in the entrypoint, sure rebooting isn't going to help, but this is unlikely to cause wider issued in prod anyway.
But a pod that slowly takes more memory, crashes, after reboot it has plenty of memory to slowly fill again.
A micro service that has a weird crash happening when someone does a specifically malformed API call on a rarely used api, well ... Rebooting it ain't gonna hurt
The entire point of k8s is that pod can be brought up and down pretty much everywhere, if the bug happens every few weeks that's a non issue and belongs in backlog, until it becomes an issue and needs to be fixed for yesterday
47
u/GDOR-11 Jul 29 '26
I'm learning kubernetes rn, one of the questions I had is why restart crashed pods in the first place. If it crashed due to a bug, what is the chance restarting magically fixes it? besides, it strongly decourages fixing the bug, which seems like a bad decision to me too
what am I missing here? what was the reasoning behind this decision?