- Docs
- Servers and nodes
- Node pools
- Node resources and limits
Node resources and limits
Every node has a hard limit on how many pods it runs. Below that limit, a slice of CPU and memory is reserved for the OS and system processes, so pods cannot take the memory the node needs to stay in the cluster. Before the node runs out of memory or disk, the kubelet (the Kubernetes agent on each node) removes pods to protect node stability.
Pod limit
Syself sets maxPods: 220 in the kubelet configuration. The kubelet refuses the 221st pod.
The effective workload capacity is a bit lower than 220. A few of the slots go to per-node DaemonSet pods that Syself runs on every node, so plan your workload capacity against about 213 pods, not 220. The Syself node daemons run as systemd services, not pods, so they cost nothing from the pod limit.
The pod limit must not exceed the number of usable IP addresses on the node's pod subnet. Each pod gets one IP from the node's slice of the cluster pod CIDR (100.64.0.0/11). The controller manager carves that CIDR into per-node blocks. Syself sets the per-node mask to /24 (256 addresses, about 254 usable) with the controller manager's --node-cidr-mask-size, so maxPods: 220 sits just under the per-node IP budget. Against the /11 pod CIDR that allows 8192 nodes. It is not a cluster variable and cannot be changed: a node's pod subnet is fixed once assigned, so the per-node mask cannot change on an existing cluster.
Why a fresh node shows less than its hardware
Run kubectl describe node on an idle node and you see two numbers for CPU and memory:
- Capacity: the raw hardware: all the CPU cores and all the RAM.
- Allocatable: what the scheduler may hand to pods. This is always less than Capacity.
The gap exists because a node does not run only pods. A node also runs the OS and system daemons, and none of them are pods, so the scheduler cannot see or account for them. These daemons include systemd, sshd, ntpd-rs (the time sync daemon), auditd, containerd (the container runtime), one shim process per running container, the kubelet, and the Syself node daemons. If pods could claim all the memory, the kernel would kill or swap out the system daemons. The kubelet would miss its heartbeat, the node would flip to NotReady, and containerd would stop starting or stopping containers.
The kubelet prevents this with reserved capacity that the scheduler never allocates:
Allocatable = Capacity - systemReserved - evictionHard
The systemReserved slice is described below. The evictionHard thresholds add another buffer on top, described in the next section.
CPU and memory reservation
Syself's systemReserved baseline is:
systemReserved:
cpu: 100m
memory: 300Mi
ephemeral-storage: 1Gi
pid: "8192"
These are not what runs. When each node joins the cluster, Syself reads the node's actual CPU count and total RAM, then rewrites the cpu and memory fields with values sized for that node. The ephemeral-storage and pid fields are preserved from the baseline.
Memory reservation
Every node needs memory to run the operating system, kubelet, containerd, and Syself node daemons. These components need roughly the same amount of memory regardless of how large the node is. That's why smaller nodes reserve a larger percentage of their RAM, while larger nodes reserve less.
Including a 300 MiB safety margin for memory eviction, the approximate split looks like this:
| Node RAM | Reserved for the system | Available for pods |
|---|---|---|
| 4 GB | 35% | 65% |
| 8 GB | 28% | 72% |
| 16 GB | 19% | 81% |
| 32 GB | 12% | 88% |
| 64 GB | 9% | 91% |
| 128 GB | 8% | 92% |
These percentages are approximate. The actual values depend on the memory reported by the kernel, which can be slightly lower than the advertised node size.
To see how much memory is available for pods on a particular node, compare its Capacity and Allocatable values:
kubectl get node <name> -o jsonpath='{.status.capacity.memory} {.status.allocatable.memory}{"\n"}'
Pods cannot use the memory reserved for the system. Kubernetes limits the memory available to pods accordingly. If the node starts running low on memory, the kubelet can evict pods to protect the system.
Syself Autopilot uses this approach because it manages everything from small cloud VMs to large bare-metal servers. A fixed reservation would take too much memory away from smaller nodes or leave larger nodes without enough protection.
CPU reservation
CPU works differently from memory. The reserved amount is small, a fraction of a core on cloud servers and about one core on the largest bare-metal servers, and it grows slowly with the number of CPUs. However, this doesn't mean that CPU is taken away from pods. They can still use all available CPU when the system doesn't need it. Unlike memory pressure, CPU pressure does not cause the kubelet to evict pods.
Eviction thresholds
evictionHard thresholds trigger immediate pod eviction (no grace period) when a node is under pressure. They protect node stability by shedding workload before the node reaches a critical state.
| Signal | Threshold |
|---|---|
memory.available | 300Mi |
nodefs.available | 10% |
imagefs.available | 15% |
nodefs.inodesFree | 5% |
pid.available | 10% |
The pid.available threshold evicts pods before the node runs out of process IDs (PIDs), the identifiers Linux assigns to running processes.
When any threshold is crossed, the kubelet evicts pods in priority order, lowest-priority first. System-critical pods (those with priorityClassName: system-node-critical or system-cluster-critical) are the last to be removed. After eviction, the kubelet does not reschedule the removed pods locally; the scheduler places them elsewhere.
The nodefs thresholds protect the writable DATA partition mounted at /var, where kubelet and containerd keep their state. The OS root itself is a sealed read-only dm-verity image and is never written. There is no separate image disk, so imagefs resolves to the same partition. Running close to either threshold causes eviction pressure, which shows in kubectl describe node under Conditions.
Where each setting lives
| Setting | Location |
|---|---|
maxPods, systemReserved, evictionHard | Syself's kubelet configuration (applied to every node) |
| Per-node CPU and memory reservation | Adjusted by Syself at node join time based on actual hardware |
node-cidr-mask-size | Set by Syself via the controller manager configuration |
| Cluster pod and service CIDR | Cluster.spec.clusterNetwork |
The cluster pod and service CIDRs are fixed at cluster creation. You cannot change them on a running cluster. If you need to run more nodes or more pods per node than the defaults allow, set wider CIDRs on the Cluster object before you create it.
Related
Where the pod and service CIDRs are set, once, at creation.