pihole Kubernetes
pihole web Interface no accessable on Kubernets , php-crashing
php -i -> works
php-cgi -I -> error bus error en crash
do you have huge pages enabled on your linux system, check (this message is enabled):
cat /sys/kernel/mm/redhat_transparent_hugepage/enabled
[always] madvise never
The problem with Kubbernetes and php-cgi huge pages needs assigned to the container or php-cgi crashes, as I have mayastor running in Kubernetes I can't disable hughe pages so to assign it add :
you need to set a hugepage limit on the container, here in my setup I did 512Mi
resources:
limits:
cpu: "1"
hugepages-2Mi: 512Mi
memory: 2Gi
requests:
cpu: 100m
memory: 128Mi
Background stuff from :
How to configure huge pages
clyso@compute-21:~$ grep Hugepagesize /proc/meminfo
Hugepagesize: 2048 kB
clyso@compute-21:~$
echo 1024 > /proc/sys/vm/nr_hugepages
echo "vm.nr_hugepages=1024" > /etc/sysctl.d/hugepages.conf
total huge pages
clyso@compute-21:/etc/sysctl.d# grep HugePages_Total /proc/meminfo
HugePages_Total: 1024
clyso@compute-21:/etc/sysctl.d#
free hugepages
clyso@compute-21:/etc/sysctl.d# grep HugePages_Free /proc/meminfo
HugePages_Free: 1024
clyso@compute-21:/etc/sysctl.d#
free memory
clyso@compute-21:/etc/sysctl.d# grep MemFree /proc/meminfo
MemFree: 765177380 kB
clyso@compute-21:/etc/sysctl.d#
How to make huge pages available in kubernetes?
restart kubernetes kublet on worker node
sudo systemctl restart kubelet.service
Allocated resources
clyso@compute-21:~$ kubectl describe node compute-21 | grep -A 8 "Allocated resources:"
Allocated resources:
(Total limits may be over 100 percent, i.e., overcommitted.)
Resource Requests Limits
-------- -------- ------
cpu 4950m (10%) 15550m (32%)
memory 27986Mi (3%) 292670Mi (37%)
ephemeral-storage 0 (0%) 0 (0%)
hugepages-1Gi 0 (0%) 0 (0%)
hugepages-2Mi 400Mi (19%) 400Mi (19%)
clyso@compute-21:~$
Capacity
clyso@compute-21:~$ kubectl describe node compute-21 | grep -A 13 "Capacity:"
Capacity:
cpu: 48
ephemeral-storage: 1536640244Ki
hugepages-1Gi: 0
hugepages-2Mi: 2Gi
memory: 792289900Ki
pods: 110
Allocatable:
cpu: 48
ephemeral-storage: 1416167646526
hugepages-1Gi: 0
hugepages-2Mi: 2Gi
memory: 790090348Ki
pods: 110
clyso@compute-21:~$
Sources:
https://kubernetes.io/docs/tasks/manage-hugepages/scheduling-hugepages/
https://www.kernel.org/doc/Documentation/vm/hugetlbpage.txt
Author
Posted on
Categories