K8S 容器调大共享内存

如何调大 K8S 容器中的共享内存大小,挂载 Memory 类型的临时存储即可, 如下图示例:

apiVersion: v1
kind: Pod
metadata:
  name: test-shm
spec:
  containers:
  - image: busybox
    name: centos
    command: [ "sleep", "1000000" ]
    imagePullPolicy: "IfNotPresent"
    volumeMounts:
      - mountPath: /dev/shm 
        name: cache-volume
  volumes:
  - emptyDir:
      medium: Memory  # 重点
    name: cache-volume

正文完