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

Open
#27 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
48/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
aws, kubernetes, shell, terraform

Research direction

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.

Written by the indexing model from the issue text.

Description

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.

Dominant language
HCL
Stars
8
Forks
5
Avg merge
42m
Merged PRs (30d)
13

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More DevOps issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.