<p>I am trying to use the --tmpfs flag from the docker run command in the Kubernetes YAML file but could not find the way.</p>
<pre><code>sudo docker run --name=ubuntu-gnome -d --rm \
  --tmpfs /run --tmpfs /run/lock --tmpfs /tmp \
  --cap-add SYS_BOOT --cap-add SYS_ADMIN \
  -v /sys/fs/cgroup:/sys/fs/cgroup \
  -p 5901:5901 -p 6901:6901 \
  darkdragon001/ubuntu-gnome-vnc
</code></pre>

<p>You're looking for an emptyDir volume, such as the following:</p>
<pre><code>apiVersion: v1
kind: Pod
metadata:
  name: demo
spec:
  containers:
  - name: container
    ...
    volumeMounts:
    - mountPath: /tmp
      name: tmp
      subPath: tmp
    - mountPath: /run
      name: tmp
      subPath: run
    - mountPath: /run/lock
      name: tmp
      subPath: run-lock
  volumes:
  - name: tmp
    emptyDir:
      medium: Memory
      sizeLimit: 64Mi
</code></pre>
