Kubelet restart
In order for Kubernetes to account for the huge pages, the kubelet on each involved node has to be restarted. After restarting and applying the DaemonSet, the HugePages_Total
= 1280.
# cat /proc/meminfo | grep -i hug
AnonHugePages: 124928 kB
ShmemHugePages: 0 kB
FileHugePages: 0 kB
HugePages_Total: 1280
HugePages_Free: 1280
HugePages_Rsvd: 0
HugePages_Surp: 0
Hugepagesize: 2048 kB
Hugetlb: 2621440 kB
When the kubelet is not restarted, the new configuration is not taken into account. The kubectl describe node command
indicates that hugepages-1Gi and 2Mi = 0
Capacity: attachable-volumes-aws-ebs: 25 cpu: 8 ephemeral-storage: 104845292Ki hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 32408692Ki pods: 58 Allocatable: attachable-volumes-aws-ebs: 25 cpu: 7910m ephemeral-storage: 95551679124 hugepages-1Gi: 0 hugepages-2Mi: 0 memory: 31391860Ki pods: 58
After the kubelet has been restarted, hugepages-2Mi
has a value.
Capacity: attachable-volumes-aws-ebs: 25 cpu: 8 ephemeral-storage: 104845292Ki hugepages-1Gi: 0 hugepages-2Mi: 2560Mi memory: 32408692Ki pods: 58 Allocatable: attachable-volumes-aws-ebs: 25 cpu: 7910m ephemeral-storage: 104845292Ki hugepages-1Gi: 0 hugepages-2Mi: 2560Mi memory: 28770420Ki pods: 58
Huge pages can now be allocated at the pod level.