You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Kubernetes中kube-node-lease命名空间的作用是什么?

kube-node-lease Explained: Why You're Not Seeing Resources in Kubernetes 1.15

Let's break this down clearly—first covering what this namespace does, then figuring out why your kubectl get all command isn't returning results.

What's the purpose of kube-node-lease?

As you noted, this namespace exists to manage lightweight node heartbeats for availability tracking. Kubernetes uses two methods to check if nodes are healthy:

  • Full NodeStatus updates: These are larger payloads sent periodically, which can add unnecessary load to the API server.
  • Lease objects: Each node gets a corresponding Lease in kube-node-lease—these are tiny, infrequent updates that serve the same availability-checking purpose without the overhead of full status reports.

This feature launched as beta in Kubernetes 1.13 and was enabled by default in most clusters, including 1.15.

Why kubectl get all -n kube-node-lease returns nothing

Here's the key gotcha: kubectl get all doesn't actually fetch every resource type. It only includes a predefined set of common resources like pods, deployments, services, and jobs. Lease objects belong to the coordination.k8s.io API group, which isn't included in the "all" alias.

To see the Lease objects for your nodes, run this command instead:

kubectl get leases -n kube-node-lease

Or to be fully explicit about the resource type:

kubectl get leases.coordination.k8s.io -n kube-node-lease

You should now see one Lease object per active node in your cluster.

Official documentation context for Kubernetes 1.15

While dedicated docs for kube-node-lease were a bit sparse in 1.15, you can find details in two core places:

  1. The Kubernetes API reference for the Lease resource (under coordination.k8s.io/v1beta1 for 1.15)
  2. The node lifecycle documentation, which covers how heartbeats (including leases) are used to determine node health

If you still don't see leases after running the correct command, double-check that the NodeLease feature gate is enabled (it should be on by default in 1.15).

内容的提问来源于stack exchange,提问作者Ivan Aracki

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.06 09:47:48