k8s node status capacity和allocatable区别
node status
capacity: 节点上的总资源,固定值
allocatable: 可供pod使用的总资源,固定值
kubectl get node kind-control-plane -oyaml
默认情况下,allocatable和capacity相等,pod可使用节点的所有资源。
为了保证系统组件和k8s组件运行正常,需要预留部分资源。
node.status.allocatable = node.status.capacity - kubelet.kube-reserved - kubelet.system-reserved - kubelet.eviction-threshold
有pod调度后,可用资源减少了。