在容器引擎上定义/ dev / shm的大小 [英] Define size for /dev/shm on container engine
问题描述
我在Debian 8上使用xvfb运行Chrome。它在我打开一个选项卡并尝试加载内容之前一直运行。这个过程默默无闻......
幸运的是,我已经通过使用 docker run --shm-size = 1G
。
有 Chrome中的一个已知错误,导致它在/ dev / shm太小时崩溃。
我正在部署到Container引擎,并检查操作系统规格。主机操作系统有一个固定的7G挂载到/ dev / shm,但实际的容器只分配64M。 Chrome崩溃。
如何在使用kubectl部署到容器引擎时设置/ dev / shm的大小?
在/ dev / shm中加载 emptyDir
并将介质设置为 Memory $ c
规格:
卷:
- 名称:dshm
emptyDir:
medium:内存
容器:
- image:gcr.io/project/image
volumeMounts:
- mountPath:/ dev / shm
名称:dshm
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?
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
这篇关于在容器引擎上定义/ dev / shm的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!