Define size for /dev/shm on container engine
25,084
Mounting an emptyDir
to /dev/shm and setting the medium to Memory
did the trick!
spec:
volumes:
- name: dshm
emptyDir:
medium: Memory
containers:
- image: gcr.io/project/image
volumeMounts:
- mountPath: /dev/shm
name: dshm
Related videos on Youtube
Comments
-
posit labs almost 2 years
I'm running Chrome with xvfb on Debian 8. It works until I open a tab and try to load content. The process dies silently...
Fortunately, I have gotten it to run smoothly on my local docker using
docker run --shm-size=1G
.There is a known bug in Chrome that causes it to crash when /dev/shm is too small.
I am deploying to Container engine, and inspecting the OS specs. The host OS has a solid 7G mounted to /dev/shm, but the actual container is only allocated 64M. Chrome crashes.
How can I set the size of /dev/shm when using kubectl to deploy to container engine?
-
posit labs over 6 yearsPossible duplicate of How to increase shm size of a kubernetes container (--shm-size equivalent of docker)
-
speedplane over 6 yearsI just posted a similar question, relating to app engine flexible instead of container engine. stackoverflow.com/questions/46414587/…
-
-
Nutritioustim over 6 yearsI'm having a similar issue, but with docker swarm. I don't see
spec:
orcontainers:
entries in the docker-compose reference. How does this map to the volumes spec? -
posit labs over 6 yearsPlease re-read the question. I already use --shm-size to run locally. This is a question about kubectl configuration
-
posit labs over 6 yearsI recommend posting a new question that is specific to docker swarm
-
welch about 6 yearsThank you!!! One truly cannot configure options to the docker launch in the kube config (and the devs are consistently obtuse about not understanding the need for this). Your config has our docker-ized selenium test no longer randomly crashing.
-
WeiChing 林煒清 almost 6 yearsbut where to constrains the size of emptyDir?
-
Mitar almost 6 yearsSize limit is being worked on here: github.com/kubernetes/kubernetes/pull/63641
-
bu11d0zer about 5 yearsBe aware that sizeLimit on the emptyDir will result in pod evictions if the limit is exceeded. This is much worse behavior than memory-hungry apps crashing.
-
EnriqueH over 3 yearsIt worked for me on a Kubernetes (AWS EKS) cluster. Thanks SO MUCH