What's the reason for a lease to be used by node? For kube API to know the status of the node, can't kubelet of that node just send the requests directly to the API server instead of updating the lease? I can't see how the lease is helpful for nodes. Although I agree with you for distributed case we need leases.
Good question, my understanding is that the main reason for using the lease API is for performance, in particular for larger clusters. You can find a detailed explanation on why leases are now used for node heartbeats here: github.com/kubernetes/enhancements/tree/master/keps/sig-node/589-efficient-node-heartbeats
@@jmmtechnology4539 I did check it out and as you said it's because of the performance. They used to do this earlier but because of etcd going out of storage easily due to these update frequency being just 10s and it has to store this info. They moved away from it by introducing a lease for this. Great read!. Thanks a lot for the resource. Would love if you make more videos on these concepts explaining things internally, why they did what they did. Thanks a lot.