Watch
0
0
Fork
You've already forked hyperhive
0

k8s: a pod's requests are explicit, so its limits cap and reserve nothing

This commit is contained in:
atlas 2026-11-21 23:42:12 +01:00 • committed by maia
commit e1c1bad51a
2 changed files with 114 additions and 36 deletions

View file

@ -102,9 +102,12 @@ credential directory.
(systemd's `K`, `M`, `G` and `T` are Kubernetes' `Ki`, `Mi`, `Gi` and `Ti`; a
byte count passes unchanged; `infinity` sets none) and its `CPUQuota`, a
percent of one core, becomes the cpu limit in millicores (`400%` is
`4000m`). The renderer sets no `requests`, so Kubernetes reserves the limits
on the node. A value in another form fails evaluation. `TasksMax` has no pod
field, so the renderer drops it. The unit's sandbox settings
`4000m`). Both are caps, not reservations, so the renderer sets the requests
too: Kubernetes would otherwise set each to its limit and reserve the whole
cap on the node. The memory request is the unit's `MemoryMin`, else its
`MemoryLow`, else `0`, and the cpu request is `0`, so the pod is Burstable. A
value in another form fails evaluation. `TasksMax` has no pod field, so the
renderer drops it. The unit's sandbox settings
(`MemoryDenyWriteExecute`, `SystemCallFilter`, `PrivateUsers` and the rest)
stay on the host: the pod has the security shape above and no other.
- **Probes:** a service with an opt-in health listener gets its variable set to

View file

@ -93,9 +93,9 @@ store path the container reads, and the volume doesn't.
The pod takes the unit's `MemoryMax` and `CPUQuota` as its container's limits
([manifests](manifests.md#pods)), so `swarm-stt` keeps its 3 GiB and four-core
ceilings. The pod has no `requests`, so Kubernetes reserves those limits on the
node: the node needs that memory and those cores free to schedule the pod.
`TasksMax` has no pod counterpart, so the renderer drops it. The systemd sandbox
ceilings. The pod requests nothing (memory `0`, cpu `0`, as the unit sets no
`MemoryMin` or `MemoryLow`), so the node reserves nothing for it and the pod is
Burstable. `TasksMax` has no pod counterpart, so the renderer drops it. The systemd sandbox
(`MemoryDenyWriteExecute`, `SystemCallFilter`, `PrivateUsers`, the read-only
`ProtectSystem` and the rest) stays on the host. The pod is a non-root user with
a read-only root filesystem, every capability dropped, the runtime's default
@ -114,4 +114,4 @@ a queue. It switches both from the host to the cluster and back, checks each
step for exactly one copy of each, and asserts that the router's pod logs in,
routes an event, and exits 0 when deleted. For `swarm-stt` it asserts that the
pod is Ready, logged in to the store with its ServiceAccount token, carries the
unit's limits, and has its cache volume bound.
unit's limits, requests nothing and is Burstable, and has its cache volume bound.