Skip to content

bug(helm): ulimit fail-fast entrypoints crashloop when the runtime hard nofile limit is below 65536 #5535

Description

@shayan1995

Problem

The ulimit -Sn {{ .Values.fileDescriptorLimit | int }} || exit 1 entrypoints added to nico-pxe, nico-hardware-health, and nico-ssh-console-rs (#4960, #5262) crashloop on any runtime whose container hard nofile limit is below the 65536 default. Reproduced on dev6: the containerd hard limit there is 65535 — one below the default — so all three deployments CrashLoopBackOff on a current main deploy, with only dash's terse ulimit: error setting limit (Invalid argument) as diagnostic.

A second failure mode from the same line: a fileDescriptorLimit: null override (Helm null deletes the chart default) or a non-numeric value renders ulimit -Sn 0, which dash accepts — the server then starts with zero usable FDs and fails with misleading I/O errors.

Fix

In all three chart entrypoints:

  1. Clamp to the runtime hard limit: h=$(ulimit -Hn); [ "$N" -gt "$h" ] && N=$h (or echo a clear error before exiting).
  2. Guard the template against null/non-numeric: | default 65536 | int plus a positivity check (or required).
  3. Extend the chart unittests to cover both.

Consider the v2.0 backport (#5263) — same line, and a stable-line patch upgrade should not be able to crashloop a working PXE service.

Follow-up question (separate)

The 65536 default exists because of FD exhaustion during high-concurrency ingestion (#4955). Whether that consumption is a genuine leak (needs a code fix before prod) or legitimate concurrent-connection load (raising the limit is the right call) has not been established — worth a profiling pass on ssh-console/hardware-health FD usage under ingestion load.

Metadata

Metadata

Assignees

Labels

bugA defect in existing software (deprecated - use issue type, but it's needed for reporting now)

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions