Skip to content

Add support for --pids-limit in kube #24418

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

Closed
fpoirotte opened this issue Oct 30, 2024 · 6 comments · Fixed by #25645
Closed

Add support for --pids-limit in kube #24418

fpoirotte opened this issue Oct 30, 2024 · 6 comments · Fixed by #25645
Labels
kind/feature Categorizes issue or PR as related to a new feature. kube stale-issue

Comments

@fpoirotte
Copy link
Contributor

Feature request description

Hi,

Currently, there is no equivalent of the --pids-limit option in podman kube play.
Would it be possible to add such an option?

I would be interested in having the option to limit the number of processes that can run simultaneously in a pod or in a container (depending on whether or not the shareProcessNamespace option has been enabled inside the pod's definition).

Suggest potential solution

Maybe this could be handled as a new (podman-specific) annotation, or as a new command-line option?

I think a new annotation makes more sense. That way, running podman kube generate on a container/pod where the --pids-limit option has been set would keep track of its value (so that running podman kube play on the generated YAML file would retain the same value).

Have you considered any alternatives?

I'm not aware of any alternative solution to this problem.

Additional context

AFAIK there is no strict equivalent to this option in Kubernetes either. The closest thing I could find is https://kubernetes.io/docs/concepts/policy/pid-limiting/#pod-pid-limits which sets a global PID limit on the node running the pods, rather than on individual containers/pods.

@fpoirotte fpoirotte added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 30, 2024
@Luap99 Luap99 added the kube label Oct 30, 2024
Copy link

A friendly reminder that this issue had no activity for 30 days.

@aquirdTurtle
Copy link

Seconding this... An option to set this via the .kube unit definition file would seem fitting as well. There's an option to do this for container units using the PidsLimit variable, but no equivalent for the kube units. The default is 2048 which is quite small, and causing me serious problems at the moment. Moving from docker-run containers to podman, and the default in docker seems to be unlimited. https://docs.podman.io/en/v5.2.2/markdown/podman-systemd.unit.5.html

@aquirdTurtle
Copy link

If we had support for this as an argument to podman kube play we could use the PodmanArgs command in qubelet stuff if nothing else.

@jankaluza
Copy link
Member

I will take this one.

jankaluza pushed a commit to jankaluza/podman that referenced this issue Mar 21, 2025
This commit adds new annotation called:

io.podman.annotations.pids-limit/$ctrname

This annotation is used to define the PIDsLimit for
a particular pod. It is also automatically defined
when newly added --pids-limit option is used.

Fixes: containers#24418

Signed-off-by: Jan Kaluza <[email protected]>
jankaluza pushed a commit to jankaluza/podman that referenced this issue Mar 21, 2025
This commit adds new annotation called:

io.podman.annotations.pids-limit/$ctrname

This annotation is used to define the PIDsLimit for
a particular pod. It is also automatically defined
when newly added --pids-limit option is used.

Fixes: containers#24418

Signed-off-by: Jan Kaluza <[email protected]>
jankaluza pushed a commit to jankaluza/podman that referenced this issue Mar 21, 2025
This commit adds new annotation called:

io.podman.annotations.pids-limit/$ctrname

This annotation is used to define the PIDsLimit for
a particular pod. It is also automatically defined
when newly added --pids-limit option is used.

Fixes: containers#24418

Signed-off-by: Jan Kaluza <[email protected]>
jankaluza pushed a commit to jankaluza/podman that referenced this issue Mar 26, 2025
This commit adds new annotation called:

io.podman.annotations.pids-limit/$ctrname

This annotation is used to define the PIDsLimit for
a particular pod. It is also automatically defined
when newly added --pids-limit option is used.

Fixes: containers#24418

Signed-off-by: Jan Kaluza <[email protected]>
@aquirdTurtle
Copy link

Dumb question... will we have to wait for the minor release scheduled for May for this feature or will it come in a patch release? If podman is following semver I'd expect May which is a bit sad...

@Luap99
Copy link
Member

Luap99 commented Mar 27, 2025

Dumb question... will we have to wait for the minor release scheduled for May for this feature or will it come in a patch release? If podman is following semver I'd expect May which is a bit sad...

This will need to wait for May yes as it is a feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. kube stale-issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants