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

T6219: Add support for container sysctl parameter #3614

Merged
merged 2 commits into from
Jun 10, 2024
Merged

Conversation

nvollmar
Copy link
Contributor

@nvollmar nvollmar commented Jun 9, 2024

I can't append to #3288, so I took the liberty to build upon it.
Aligned configuration with system sysctl and added completion with allowed sysctl values for container

Change Summary

Allow setting sysctl settings for containers

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

https://vyos.dev/T6219

Related PR(s)

#3288

Component(s) name

container

Proposed changes

Adds support for configuring a container with the sysctl option:

container {
    name c1 {
        allow-host-networks
        image "busybox:stable"
        sysctl {
            parameter kernel.msgmax {
                value "8192"
            }
        }
    }
}

How to test

set container name c1 image busybox:stable
set container name c1 allow-host-networks
set container name c1 sysctl parameter kernel.msgmax value 8192

Smoketest result

test_basic (__main__.TestContainer.test_basic) ... ok
test_dual_stack_network (__main__.TestContainer.test_dual_stack_network) ... 
IP address "192.0.2.1" can not be used for a container, reserved for the
container engine!

ok
test_ipv4_network (__main__.TestContainer.test_ipv4_network) ... 
IP address "192.0.2.1" can not be used for a container, reserved for the
container engine!

ok
test_ipv6_network (__main__.TestContainer.test_ipv6_network) ... 
IP address "2001:db8::1" can not be used for a container, reserved for
the container engine!

ok
test_uid_gid (__main__.TestContainer.test_uid_gid) ... 
Cannot set "gid" without "uid" for container

ok

----------------------------------------------------------------------
Ran 5 tests in 146.650s

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

Copy link

github-actions bot commented Jun 9, 2024

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Jun 9, 2024

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link

github-actions bot commented Jun 9, 2024

Conflicts have been resolved. A maintainer will review the pull request shortly.

@nvollmar nvollmar force-pushed the T6219 branch 2 times, most recently from f9fb6c9 to 9214333 Compare June 9, 2024 22:58
@nvollmar nvollmar marked this pull request as draft June 9, 2024 22:59
@nvollmar nvollmar marked this pull request as ready for review June 10, 2024 05:39
@sever-sever
Copy link
Member

Probably will be conflict with #3607

@nvollmar
Copy link
Contributor Author

Yep, just added that as separate commit to get the builds green.
Will rebase/remove once #3607 is merged

@nvollmar
Copy link
Contributor Author

rebased

smoketest/scripts/cli/test_container.py Outdated Show resolved Hide resolved
@c-po c-po merged commit eaf20bb into vyos:current Jun 10, 2024
9 checks passed
@nvollmar nvollmar deleted the T6219 branch June 10, 2024 11:09
@nvollmar
Copy link
Contributor Author

@sever-sever would be great if that could be backported to Sagitta

@c-po
Copy link
Member

c-po commented Jun 11, 2024

@Mergifyio backport sagitta

Copy link
Contributor

mergify bot commented Jun 11, 2024

backport sagitta

✅ Backports have been created

sever-sever pushed a commit that referenced this pull request Jun 11, 2024
…3629)

* container: T6219: Add support for container sysctl / kernel parameters

(cherry picked from commit 717ea64)

* T6219: align with system sysctl and limit parameters to supported

(cherry picked from commit f030464)

---------

Co-authored-by: Ben Pilgrim <ben@pilgrim.me.uk>
Co-authored-by: Nicolas Vollmar <nvollmar@gmail.com>
@sever-sever
Copy link
Member

@Mergifyio backport circinus-stream sagitta-stream

Copy link
Contributor

mergify bot commented Jun 11, 2024

backport circinus-stream sagitta-stream

✅ Backports have been created

c-po added a commit that referenced this pull request Jun 11, 2024
T6219: Add support for container sysctl parameter (backport #3614)
c-po added a commit that referenced this pull request Jun 11, 2024
T6219: Add support for container sysctl parameter (backport #3614)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

5 participants