在容器引擎上定义/ dev / shm的大小 [英] Define size for /dev/shm on container engine

查看:309
本文介绍了在容器引擎上定义/ dev / shm的大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在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

 规格:
卷:
- 名称: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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆