diff options
author | Julien Dessaux | 2024-10-02 10:36:59 +0200 |
---|---|---|
committer | Julien Dessaux | 2024-10-02 10:39:18 +0200 |
commit | 5e4ac94692ab76f6cb9c4ddaa0b64da36dee5644 (patch) | |
tree | ae2d77fa39af7e22e619ca0b521cc8bebf7d366f | |
parent | capitalize OpenTofu (diff) | |
download | www-5e4ac94692ab76f6cb9c4ddaa0b64da36dee5644.tar.gz www-5e4ac94692ab76f6cb9c4ddaa0b64da36dee5644.tar.bz2 www-5e4ac94692ab76f6cb9c4ddaa0b64da36dee5644.zip |
add /dev/shm on kubernetes blog article
Diffstat (limited to '')
-rw-r--r-- | content/blog/kubernetes/dev-shm.md | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/content/blog/kubernetes/dev-shm.md b/content/blog/kubernetes/dev-shm.md new file mode 100644 index 0000000..9369052 --- /dev/null +++ b/content/blog/kubernetes/dev-shm.md @@ -0,0 +1,36 @@ +--- +title: 'How to increase /dev/shm size on kubernetes' +description: "the equivalent to docker's shm-size flag" +date: '2024-10-02' +tags: +- kubernetes +--- + +## Introduction + +Today I had to find a way to increase the size of the shared memory filesystem offered to containers for a specific workload. `/dev/shm` is a Linux specific `tmpfs` filesystem that some applications use for inter process communications. The defaults size of this filesystem on kubernetes nodes is 64MiB. + +Docker has a `--shm-size 1g` flag to specify that. Though kubernetes does not offer a direct equivalent, we can replicate this with volumes. + +## Configuration in pod specification + +Here are the relevant sections of the spec we need to set: +``` yaml +spec: + template: + spec: + container: + volume_mount: + mount_path = "/dev/shm" + name = "dev-shm" + read_only = false + volume: + empty_dir: + medium = "Memory" + size_limit = "1Gi" + name = "dev-shm" +``` + +## Conclusion + +Well it works! |