Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to set shm-size for /dev/shm shared by a pod #14609

Closed
dtmdl opened this issue Jun 15, 2022 · 3 comments · Fixed by #14625
Closed

Unable to set shm-size for /dev/shm shared by a pod #14609

dtmdl opened this issue Jun 15, 2022 · 3 comments · Fixed by #14625
Assignees
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.

Comments

@dtmdl
Copy link

dtmdl commented Jun 15, 2022

Is this a BUG REPORT or FEATURE REQUEST? (leave only one on its own line)
/kind feature

Description
I am trying to increase the size of the shared /dev/shm attached to the containers in a pod.

There is no --shm-size option to podman pod create and the --shm-size option for podman run is rejected when the container is being added to a pod with --share ipc enabled (as is the default).

Steps to reproduce the issue:

  1. podman pod create --name shm-pod --shm-size 256M

  2. podman pod create --name shm-pod

  3. podman run --shm-size 256M --rm -t --pod shm-pod alpine mount | grep shm

  4. podman run --rm -t --pod shm-pod alpine mount | grep shm

Describe the results you received:

  1. podman pod create with --shm-size
Error: unknown flag: --shm-size
See 'podman pod create --help'
  1. podman pod create
b2bcda49a5f182b1d9694e1577a6ffe1ce3dffb8bdce3c7e6d5b16004ae67440
  1. podman run with --shm-size
Error: invalid config provided: cannot set shmsize when running in the host IPC Namespace
  1. podman run
shm on /dev/shm type tmpfs (rw,context="system_u:object_r:container_file_t:s0:c825,c880",nosuid,nodev,noexec,relatime,size=64000k,uid=1001,gid=1001,inode64)

Describe the results you expected:

I would like some way to specify --shm-size for a pod with --share ipc.

Additional information you deem important (e.g. issue happens only occasionally):

Using pod create --share to un-share the ipc namespace (which is awkward, as it requires listing the default shared namespaces excluding ipc) does allow specifying --shm-size on the podman run command, but then /dev/shm is not shared.

Output of podman version:

Client:       Podman Engine
Version:      4.0.2
API Version:  4.0.2
Go Version:   go1.17.7

Built:      Thu May 19 19:18:11 2022
OS/Arch:    linux/amd64
@openshift-ci openshift-ci bot added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 15, 2022
@Luap99
Copy link
Member

Luap99 commented Jun 16, 2022

@cdoern PTAL

@rhatdan
Copy link
Member

rhatdan commented Jun 16, 2022

@cdoern this needs to be added to podman pod create.

@cdoern
Copy link
Contributor

cdoern commented Jun 16, 2022

ok, I will work on this today

cdoern added a commit to cdoern/podman that referenced this issue Jun 20, 2022
expose the --shm-size flag to podman pod create and add proper handling and inheritance
for the option.

resolves containers#14609

Signed-off-by: Charlie Doern <[email protected]>
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 20, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/feature Categorizes issue or PR as related to a new feature. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants