It doesn’t matter that k8s does graceful shutdowns all the time, the point is you must handle when they do not as well, and if you did that the graceful ones are only a special case. The culture around k8s in practice ignores this to a dangerous degree.
I agree wholeheartedly with you that handling abnormal termination is probably the first thing you should do.
But I disagree with you on "the culture around k8s in practice ignores this to a dangerous degree" — yes, k8s clusters have built-in methods of handling normal termination¹. But that because abnormal termination — while an expected and "normal" consequence of production in the sense that it will, invariably, happen — still has knock-on effects, like 500s. If I SIGKILL your serving process, those requests are dead². The graceful stuff is there to avoid inadvertently nuking requests like that during normal deployments.
Again, I absolutely agree: your desired workload should survive everything from SIGKILL to the machine just up and vanishing into thin air, and the subsequent delay that it will take health checks to realize "huh, weird, that VM just poofed out of existence". (And you should probably deal with that first, as systemic failures like what MS hit are less preferable than a few 5xxs here and there.)
¹which for a workload, amounts to, pretty much "handle SIGTERM", or more practically, "your web framework, if it is worth its salt, should already be doing this for you"
²while sometimes an upstream LB can smartly retry idempotent requests, if the requests aren't idempotent, there is no choice but 5xx
You are arguing from idealism, while I am from what people actually do when presented with those mechanisms.
I know infinitely more SV cos with zero abnormal termination recovery than those with graceful shutdowns for the simple reason one is tested all the time and the other is too hard to deal with so everyone hopes they have moved to the next company before dealing with it.
Perhaps k8s should remove graceful shutdown and make "abnormal" termination the only way to shut down. With a hostile, "crash-only software" environment, teams must make their code robust by design: https://en.wikipedia.org/wiki/Crash-only_software
This isn't my experience at all. In my experience if developers are thinking about anything it's recovery so that's more "baked in". If I were running an SRE function I could see myself making more noise about graceful shutdowns because that's not typically top of mind for developers.
So you might get the impression I'm brain rotted and obsessed with graceful shutdown to the exclusion of recovery..
But that honestly seems like not a me problem so much as..
Replies (1)
It doesn’t matter that k8s does graceful shutdowns all the time, the point is you must handle when they do not as well, and if you did that the graceful ones are only a special case. The culture around k8s in practice ignores this to a dangerous degree.
Replies (2)
But I disagree with you on "the culture around k8s in practice ignores this to a dangerous degree" — yes, k8s clusters have built-in methods of handling normal termination¹. But that because abnormal termination — while an expected and "normal" consequence of production in the sense that it will, invariably, happen — still has knock-on effects, like 500s. If I SIGKILL your serving process, those requests are dead². The graceful stuff is there to avoid inadvertently nuking requests like that during normal deployments.
Again, I absolutely agree: your desired workload should survive everything from SIGKILL to the machine just up and vanishing into thin air, and the subsequent delay that it will take health checks to realize "huh, weird, that VM just poofed out of existence". (And you should probably deal with that first, as systemic failures like what MS hit are less preferable than a few 5xxs here and there.)
¹which for a workload, amounts to, pretty much "handle SIGTERM", or more practically, "your web framework, if it is worth its salt, should already be doing this for you"
²while sometimes an upstream LB can smartly retry idempotent requests, if the requests aren't idempotent, there is no choice but 5xx
Replies (2)
I know infinitely more SV cos with zero abnormal termination recovery than those with graceful shutdowns for the simple reason one is tested all the time and the other is too hard to deal with so everyone hopes they have moved to the next company before dealing with it.
Replies (1)
So you might get the impression I'm brain rotted and obsessed with graceful shutdown to the exclusion of recovery..
But that honestly seems like not a me problem so much as..