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

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

问题描述

我在 Debian 8 上使用 xvfb 运行 Chrome.它一直工作到我打开一个标签并尝试加载内容.进程无声无息地死去...

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...

幸运的是,我使用 docker run --shm-size=1G 让它在本地 docker 上顺利运行.

Fortunately, I have gotten it to run smoothly on my local docker using docker run --shm-size=1G.

Chrome 中存在一个已知错误导致它当/dev/shm 太小时崩溃.

There is a known bug in Chrome that causes it to crash when /dev/shm is too small.

我正在部署到容器引擎,并检查操作系统规范.主机操作系统有一个固定的 7G 挂载到/dev/shm,但实际容器只分配了 64M.Chrome 崩溃.

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.

使用kubectl部署到容器引擎时如何设置/dev/shm的大小?

How can I set the size of /dev/shm when using kubectl to deploy to container engine?

推荐答案

emptyDir 安装到/dev/shm 并将媒体设置为 Memory 就成功了!

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天全站免登陆