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

问题描述

我在Debian 8上使用xvfb运行Chrome。它在我打开一个选项卡并尝试加载内容之前一直运行。这个过程默默无闻......



幸运的是,我已经通过使用

在/ 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的大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-01 13:37