Open obeyler opened 4 years ago
Question: is there a problem with treating "liveness" of the kubelet process as the indicator for "liveness" of the etcd node record? Put another way, does it make sense to delete the node every time the kubelet process is stopped via monit, and add it back in on monit start?
In fact when kubelet is out the node is out. if kubelet is on the node can be ready or not depending on the network layer so on I think it's a good idea to delete node when kubelet died
To clarify, I'm talking specifically about monit stop
and monit start
events. If the kubelet process crashes out-of-band, the node record should (and will!) remain in the etcd store, so that you can see and troubleshoot that: "hey, that third node is NotReady!" vs. "my 2-node cluster is healthy, I don't see what ----- hey wait a minute, where's the third node?!"
That neatly sidesteps the scenario where people are skipping drains, or haven't enabled pod drainage in the deployment.
may I can put this inside pre-stop script and test :
BOSH_VM_NEXT_STATE = delete BOSH_INSTANCE_NEXT_STATE = delete BOSH_DEPLOYMENT_NEXT_STATE = keep
witch mean that it a Scaling down instance (https://www.bosh.io/docs/pre-stop/#environment-variables)
In fact no we can detect inside pre-stop that it's a scaling down number of node instance and put a flag to say to the drain that it needs to delete the node. So on only in case of scaling down, node will be deleted. Play with monit start/stop on kubelet doesn't delete node. I propose this as a pr #72
Yeah, I figured pre-stop would have to use disk to communicate to a future post-deployment hook.
Is there a reason you didn't want monit stop
to handle this?
I thought it was that you want when you said:
, I'm talking specifically about monit stop and monit start events. If the kubelet process crashes out-of-band, the node record should (and will!) remain in the etcd store, so that you can see and troubleshoot that: "hey, that third node is NotReady!" vs. "my 2-node cluster is healthy, I don't see what ----- hey wait a minute, where's the third node?!"
I was saying I wanted the node records to persist if kubelet stops for any reason other than a monit stop
When you scale down the number of node inside bosh deployment yaml, node deleted are seen as No responding Pod and so on if you have to redeploy the control plane consider that the deployment failed as some node are not in ready state.
To solve that we need to do a kubectl delete node xxxx to remove this node inside the etcd. I think we can add this command inside the drain.
After scale down we have for the deleted VM.