Skip to content

remove limit for number of containers in containers.conf #125

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

Conversation

rccrdpccl
Copy link
Contributor

@rccrdpccl rccrdpccl commented Apr 4, 2025

This settings was never persisted in ansible, however we normally reach this number easily. The symptoms are pods crashing badly

Summary by CodeRabbit

  • New Features
    • Enhanced container management by enabling the system to support an unlimited number of process IDs, improving operational scalability and flexibility.
    • Added functionality to restart the podman service, ensuring smoother operations.

Copy link

coderabbitai bot commented Apr 4, 2025

Walkthrough

Two new tasks have been added to the Ansible playbook. The first task, "Unlimited number of pids for podman," utilizes the ansible.builtin.lineinfile module to modify the containers.conf file located at /usr/share/containers/containers.conf, replacing a commented line with pids_limit = -1. The second task, "Restart podman service," employs the ansible.builtin.systemd_service module to restart the podman service, ensuring the daemon is reloaded.

Changes

File(s) Change Summary
test/.../network_setup/tasks/main.yaml Added the "Unlimited number of pids for podman" task to update /usr/share/containers/containers.conf using the lineinfile module and "Restart podman service" task to restart the podman service.

Sequence Diagram(s)

sequenceDiagram
    actor User
    participant Playbook as Ansible Playbook
    participant Lineinfile as lineinfile Module
    participant Config as containers.conf
    participant Systemd as systemd_service Module

    User->>Playbook: Execute network_setup role
    Playbook->>Lineinfile: Run "Unlimited number of pids for podman" task
    Lineinfile->>Config: Search for line matching '^#pids_limit = .*'
    Config-->>Lineinfile: Return line (if found)
    Lineinfile->>Config: Replace with 'pids_limit = -1'
    Config-->>Lineinfile: Confirm update
    Lineinfile-->>Playbook: Task complete
    Playbook->>Systemd: Run "Restart podman service" task
    Systemd-->>Playbook: Restart service complete
Loading

Poem

I’m a rabbit with a coder’s delight,
Hopping through config files into the night.
With a swift "lineinfile", I tweak the brew,
Unlimited PIDs now shine through!
Carrots and code, a duo so bright!

🐇✨


🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai plan to trigger planning for file edits and PR creation.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@openshift-ci openshift-ci bot requested review from carbonin and CrystalChun April 4, 2025 09:41
@openshift-ci openshift-ci bot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 4, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/playbooks/roles/network_setup/tasks/main.yaml (1)

15-20: Configuration Update: Remove PID Limit for Containerd
The new task effectively removes the PID limit by uncommenting and setting the pids_limit to 0 in /usr/share/containers/containers.conf. This addresses the crashing pods issue due to reaching the PID limit.

However, please verify that:

  • The regex '^#pids_limit = .*' reliably matches the commented-out configuration across various environments.
  • In cases where the line might already be uncommented or set differently, the task’s idempotence behaves as expected.
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 52da144 and eb09d3a.

📒 Files selected for processing (1)
  • test/playbooks/roles/network_setup/tasks/main.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Security scan

@rccrdpccl rccrdpccl force-pushed the unlimit-number-of-pids-per-container branch from eb09d3a to 2708bec Compare April 4, 2025 10:00
@openshift-ci openshift-ci bot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 4, 2025
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
test/playbooks/roles/network_setup/tasks/main.yaml (1)

21-25: Restart Podman Service to Apply New Configuration:
This task uses the ansible.builtin.systemd_service module to restart the podman service with daemon_reload enabled, which is a good practice to ensure that the configuration changes are applied immediately. However, please confirm that appropriate privilege escalation (e.g., become: true) is in effect at the play or role level, as modifying system configuration files and restarting services typically require elevated permissions.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between eb09d3a and 2708bec.

📒 Files selected for processing (1)
  • test/playbooks/roles/network_setup/tasks/main.yaml (1 hunks)
🔇 Additional comments (1)
test/playbooks/roles/network_setup/tasks/main.yaml (1)

15-20: Unlimited PIDs Configuration in containers.conf:
The new task correctly updates the containers configuration by setting pids_limit to 0, which effectively removes the process ID limit as intended. Please verify that the provided regular expression (^#pids_limit = .*) matches the commented line format across all target deployments. This will help ensure that no valid configuration lines are inadvertently skipped.

Signed-off-by: Riccardo Piccoli <rpiccoli@redhat.com>
@rccrdpccl rccrdpccl force-pushed the unlimit-number-of-pids-per-container branch from 2708bec to f21c523 Compare April 4, 2025 10:44
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
test/playbooks/roles/network_setup/tasks/main.yaml (2)

15-20: Review "Unlimited number of pids for podman" Task – Validate Regex Robustness

This task correctly updates the configuration by ensuring that the commented-out PID limit line is replaced with pids_limit = -1. Please double-check that the regular expression '^# pids_limit = .*' will match all possible variations (e.g. potential leading spaces or different comment styles) in the actual containers.conf. Adjusting the regex for optional whitespace (for example, by using something like '^\\s*#\\s*pids_limit\\s*=\\s*.*') might improve idempotence and robustness.


21-25: Review "Restart podman service" Task – Verify Module Usage

This task restarts the podman service and reloads the daemon, which is essential after modifying containers.conf. Please confirm that using the module ansible.builtin.systemd_service is appropriate for your Ansible version and target environment; in many cases, the commonly used module is ansible.builtin.systemd. If you encounter any issues with systemd_service, consider switching to ansible.builtin.systemd.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2708bec and f21c523.

📒 Files selected for processing (1)
  • test/playbooks/roles/network_setup/tasks/main.yaml (1 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: Security scan

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 4, 2025
Copy link

openshift-ci bot commented Apr 4, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: carbonin, rccrdpccl

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-bot openshift-merge-bot bot merged commit 1ca5747 into openshift-assisted:master Apr 4, 2025
8 checks passed
@rccrdpccl rccrdpccl deleted the unlimit-number-of-pids-per-container branch April 9, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants