Skip to content

Instantly share code, notes, and snippets.

@markruler
Last active February 2, 2023 11:25
Show Gist options
  • Save markruler/e4a075e8a5aae26c3eb484a276a50729 to your computer and use it in GitHub Desktop.
Save markruler/e4a075e8a5aae26c3eb484a276a50729 to your computer and use it in GitHub Desktop.
cgroup.memory "cannot allocate memory"

"cannot allocate memory"

kubectl get pod -A --field-selector spec.nodeName=worker-node -o wide
kubectl describe pod calico-node-hh2g8 -n kube-system
...
Events:
  Type     Reason                    Age                   From                  Message
  ----     ------                    ----                  ----                  -------
  Normal   Scheduled                 <unknown>             default-scheduler     Successfully assigned kube-system/calico-node-hh2g8 to worker-node
  Warning  FailedCreatePodContainer  4m4s (x141 over 34m)  kubelet, worker-node  unable to ensure pod container exists: failed to create container for [kubepods burstable podb0d985c4-50be-4330-86d9-2f398c125645] : mkdir /sys/fs/cgroup/memory/kubepods/burstable/podb0d985c4-50be-4330-86d9-2f398c125645: cannot allocate memory

cgroup.memory=nokmem

# GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet"
GRUB_CMDLINE_LINUX="crashkernel=auto rhgb quiet cgroup.memory=nokmem"
grub2-mkconfig -o /boot/grub2/grub.cfg
reboot

Something different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment