gpu-nodegroup: containerd_storage = "instance_store" starts kubelet before nodeadm localStorage RAID0 — DaemonSets (device plugins) bind to the hidden root-disk /var/lib/kubelet

Aperta
#27 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
aws, kubernetes, shell, terraform

Direzione di ricerca

Start with terraform/modules/eks-gpu-nodegroup/templates/userdata.sh.tpl and trace how the boothook handles containerd_storage = "instance_store" and restarts containerd and kubelet. Check the existing regression test mentioned for the pending Neuron work, then verify the rendered user data and boot ordering on an NVIDIA instance-store node. Done means device and EFA plugins register after localStorage is mounted, without the SystemdCgroup error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Summary

With containerd_storage = "instance_store" (added in #12 / #24), GPU nodegroup user data starts kubelet before nodeadm applies localStorage RAID0. The node registers early, DaemonSet pods start on the root-disk /var/lib/kubelet, then nodeadm-run.service bind-mounts the RAID0 volume over a non-empty /var/lib/kubelet and restarts containerd + kubelet. Containers started in that window survive the restarts but keep host paths into the now-hidden root-disk directory.

The visible symptom: device plugins never register with the new kubelet, so the node stays Ready but advertises 0 accelerators.

Observed (live)

  • trn2.48xlarge managed nodegroup, EKS 1.35, AMI amazon-eks-node-al2023-x86_64-neuron-1.35-v20261031, containerd_storage = "instance_store".
  • neuron-device-plugin logged Registration failed for resource aws.amazon.com/neuron: context deadline exceeded in a loop, and the node showed aws.amazon.com/neuron: 0 / aws.amazon.com/neuroncore: 0.
  • The plugin's /proc/<pid>/mountinfo showed /var/lib/kubelet/device-plugins coming from /dev/nvme0n1p1 (the root disk), not /dev/md127 (RAID0). It was registering against a stale kubelet.sock left by the first kubelet.
  • The plugin's PID was lower than nodeadm-run's, i.e. it started before localStorage was applied.

This was on Neuron. NVIDIA nodegroups render the same boothook, so they are very likely affected the same way, but this has not been reproduced on an NVIDIA node yet.

Boot timeline (journal)

07:57:33  nodeadm-config.service            (writes config, does NOT start kubelet)
07:58:09  Started containerd.service        <- boothook `systemctl restart containerd`
07:58:09  Started kubelet.service           <- boothook `systemctl restart kubelet`  => node registers, DaemonSets start
07:58:48  Starting nodeadm-run.service
07:58:49  Mounted mnt-k8s-disks-0.mount     (RAID0)
07:58:49  Stopping kubelet / containerd
07:58:49  var-lib-kubelet.mount: Directory /var/lib/kubelet to mount over is not empty, mounting anyway.
07:58:52  Started containerd / kubelet      (now on RAID0)

Root cause

terraform/modules/eks-gpu-nodegroup/templates/userdata.sh.tpl (boothook) unconditionally runs:

if ! systemctl restart containerd; then ... fi
if ! systemctl restart kubelet;    then ... fi

This is the SystemdCgroup reload workaround for the NVIDIA AMI (nvidia-ctk runtime configure drops SystemdCgroup; awslabs/amazon-eks-ami#2705). On the AMI above neither daemon was running when the boothook fired (the journal's first Started containerd/kubelet lines come from the boothook), so restart started them, before cloud-final and before nodeadm-run.service. Whether the NVIDIA AMI behaves identically is unverified, but even if containerd is already up there, systemctl restart kubelet still starts kubelet early. With ebs storage this is harmless (nothing is mounted later). With instance_store, nodeadm-run's setup-local-disks moves /var/lib/kubelet, /var/lib/containerd and /var/log/pods onto RAID0 after pods are already running.

Everything that keeps a hostPath under /var/lib/kubelet can be hit if it starts in that window: device plugins (nvidia-device-plugin, aws-efa-k8s-device-plugin, Neuron), CSI node plugins (plugins_registry), pod-resources consumers (dcgm-exporter).

Karpenter GPU NodePools are not affected: their userData has no restart, and Karpenter/nodeadm start kubelet once, after localStorage.

Proposed fix

When containerd_storage = "instance_store", do not (re)start containerd or kubelet in the boothook. nodeadm-run stops and restarts both after applying localStorage (see timeline), and that restart should load the final on-disk /etc/containerd/config.toml (incl. the SystemdCgroup = true overlay), so the reload workaround should not be needed on this path — to be confirmed on the NVIDIA AMI. Alternatives: systemctl try-restart (restart only if already running) for both units.

Notes:

  • This changes rendered user data for existing NVIDIA instance_store nodegroups (new Launch Template version → managed NG rolling update), so it should land as an explicit, documented change.
  • It should be verified on an NVIDIA instance_store node before merging: device plugin + EFA plugin register and the SystemdCgroup symptom (expected cgroupsPath to be of format "slice:prefix:name") does not come back.
  • The pending Neuron nodegroup work already skips this restart for Neuron nodegroups (the reload is NVIDIA-specific) and adds a regression test; NVIDIA rendering is intentionally unchanged there to keep zero diff.

Workaround for affected nodes

Delete the DaemonSet pods that started before nodeadm-run finished (they are recreated on the RAID0-backed paths), e.g. kubectl -n kube-system delete pod -l <device-plugin selector> --field-selector spec.nodeName=<node>, or use containerd_storage = "ebs" until fixed.

Lingua principale
HCL
Stelle
8
Fork
5
Merge medio
42m
PR unite (30g)
13

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Issue simili

Altre issue su DevOps

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.