Skip to content

Allow moving netns directory into StateDir #4973

Merged
estesp merged 1 commit intocontainerd:masterfrom
lorenz:move-netns-into-statedir
Feb 10, 2021
Merged

Allow moving netns directory into StateDir #4973
estesp merged 1 commit intocontainerd:masterfrom
lorenz:move-netns-into-statedir

Conversation

@lorenz
Copy link
Copy Markdown
Contributor

@lorenz lorenz commented Jan 27, 2021

The directory where cri puts the netns references is currently hardcoded. This moves it into StateDir which can be configured.

Having this configurable is useful for systems with read-only root filesystems where one needs tight controls over where software
is able to write to.

@k8s-ci-robot
Copy link
Copy Markdown

Hi @lorenz. Thanks for your PR.

I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@lorenz lorenz force-pushed the move-netns-into-statedir branch 2 times, most recently from b6315c0 to b1d5c22 Compare January 27, 2021 13:14
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Jan 27, 2021

Build succeeded.

Copy link
Copy Markdown
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

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

The default behavior should not change

@lorenz
Copy link
Copy Markdown
Contributor Author

lorenz commented Jan 28, 2021

Meaning I should gate this behind a setting?

@AkihiroSuda
Copy link
Copy Markdown
Member

Yes, that seems safer to keep compatibility.

@crosbymichael
Copy link
Copy Markdown
Member

@lorenz One question, what underlying system are you running on that does not have /var/run as tmpfs? Ideally in all modern systems, /run is tmpfs and /var/run should symlink to /run

@crosbymichael
Copy link
Copy Markdown
Member

I still think this change is fine to make, we just need to make sure we are backward compatible in cause of a user upgrading containerd while pods are running.

@lorenz
Copy link
Copy Markdown
Contributor Author

lorenz commented Feb 4, 2021

@crosbymichael This is a custom operating system being developed. It does not even have /var and the entire root is a read-only filesystem. It also doesn't have /run.
I'll implement a flag to gate this.

@lorenz
Copy link
Copy Markdown
Contributor Author

lorenz commented Feb 10, 2021

@AkihiroSuda Done, the new behavior is now gated behind netns_mounts_under_state_dir.

@AkihiroSuda AkihiroSuda added kind/enhancement area/cri Container Runtime Interface (CRI) labels Feb 10, 2021
@AkihiroSuda
Copy link
Copy Markdown
Member

Thanks, the code looks good but could you squash the commits

@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Feb 10, 2021

Build succeeded.

@lorenz lorenz force-pushed the move-netns-into-statedir branch from 8afa66d to 36d0bc1 Compare February 10, 2021 17:33
@lorenz
Copy link
Copy Markdown
Contributor Author

lorenz commented Feb 10, 2021

Done

@AkihiroSuda AkihiroSuda changed the title Move netns directory into StateDir Allow moving netns directory into StateDir Feb 10, 2021
@theopenlab-ci
Copy link
Copy Markdown

theopenlab-ci Bot commented Feb 10, 2021

Build succeeded.

Copy link
Copy Markdown
Member

@estesp estesp left a comment

Choose a reason for hiding this comment

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

LGTM

@estesp estesp merged commit 2adb2ea into containerd:master Feb 10, 2021
@lorenz lorenz deleted the move-netns-into-statedir branch February 10, 2021 18:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/cri Container Runtime Interface (CRI) kind/enhancement needs-ok-to-test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants