Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@haircommander
Copy link
Member

What type of PR is this?

/kind documentation
/kind ci

What this PR does / why we need it:

previously, the documentation and testing around user namespaces was pretty poor. Let's update both in one feld swoop, so we know we're testing the stuff we claim works in our docs

Which issue(s) this PR fixes:

Special notes for your reviewer:

Does this PR introduce a user-facing change?

none

@openshift-ci openshift-ci bot added release-note-none Denotes a PR that doesn't merit a release note. kind/documentation Categorizes issue or PR as related to documentation. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/ci Categorizes issue or PR as related to CI labels Nov 29, 2021
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 29, 2021
@codecov
Copy link

codecov bot commented Nov 29, 2021

Codecov Report

Merging #5476 (da8f9a0) into main (fc844e4) will increase coverage by 0.00%.
The diff coverage is n/a.

@@           Coverage Diff           @@
##             main    #5476   +/-   ##
=======================================
  Coverage   43.27%   43.28%           
=======================================
  Files         120      120           
  Lines       11995    11995           
=======================================
+ Hits         5191     5192    +1     
+ Misses       6309     6308    -1     
  Partials      495      495           

@haircommander haircommander force-pushed the userns-test-and-docs branch 2 times, most recently from a5cd9d6 to 45ff227 Compare November 29, 2021 22:33
@mrunalp
Copy link
Member

mrunalp commented Nov 30, 2021

@giuseppe @nalind ptal

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

### CRI-O configuration
To enable pods to be able to use the userns-mode annotation, the pod must be allowed to interpret the experimental annotation `io.kubernetes.cri-o.userns-mode`.
#### 1.23.0 and beyond
In CRI-O versions greater than 1.23.0, this can be done by creating a custom workload. This can be done by creating a file with the following contents in /etc/crio/crio.conf.d/01-userns-workload.conf
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
In CRI-O versions greater than 1.23.0, this can be done by creating a custom workload. This can be done by creating a file with the following contents in /etc/crio/crio.conf.d/01-userns-workload.conf
In CRI-O versions greater than 1.23.0, create a file with the following contents in /etc/crio/crio.conf.d/01-userns-workload.conf

"This can be done" got a little redundant.

## Setup

### /etc/sub{g,u}id
To start, the host will have to have `/etc/subuid` and `/etc/subgid` files set correctly. By default, the [library CRI-O uses for container storage](https://github.com/containers/storage) assumes there will be entries in each of these files for the `containers` user. If one would like to have a different user's entries in `/etc/sub?id` files, then the field `remap-user` and `remap-group` can be configured in `/etc/containers/storage.conf` in the `[storage.options]` table.
Copy link
Contributor

Choose a reason for hiding this comment

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

I try to avoid pronouns on a man page. Suggest dropping "If one would like" at the start of the third sentence for instance. Etc throughout, YMMV.

allowed_annotations = ["io.kubernetes.cri-o.userns-mode"]
```

This will allow any pod with the `io.kubernetes.cri-o.userns-mode` annotation to configure a user namespace. CRI-O opts for this approach to give admins the ability to toggle the behavior on their nodes, just in case an admin doesn't want their users to be able to create user namespace. An admin can also set a different `activation_annotation` if they'd like a different annotation to allow pods to configure user namespaces.
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer "administrator" to "admin"

@TomSweeneyRedHat
Copy link
Contributor

LGTM in general, just a couple Sweeney-tics to consider.

@nee1esh
Copy link

nee1esh commented Dec 1, 2021

/retest-required

1 similar comment
@nee1esh
Copy link

nee1esh commented Dec 1, 2021

/retest-required

@haircommander
Copy link
Member Author

not ok 219 userns annotation auto should succeed
# (in test file ./userns_annotation.bats, line 28)
#   `ctr_id=$(crictl run "$TESTDATA"/container_sleep.json "$sboxconfig")' failed
# time="2021-12-01T21:25:00Z" level=warning msg="Support for the 'registries' option has been dropped but it is referenced in \"/etc/crio/crio.conf.d/01-registries.conf\".  Please use containers-registries.conf(5) for configuring unqualified-search registries instead."
# time="2021-12-01 21:25:00.679796716Z" level=info msg="Starting CRI-O, version: 1.23.0, git: 6f2b52908ee579f4f2aceea367e3ca86525c243d(dirty)"
# level=info msg="Using default capabilities: CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FSETID, CAP_FOWNER, CAP_SETGID, CAP_SETUID, CAP_SETPCAP, CAP_NET_BIND_SERVICE, CAP_KILL"
# time="2021-12-01 21:25:00.973610374Z" level=info msg="Starting CRI-O, version: 1.23.0, git: 6f2b52908ee579f4f2aceea367e3ca86525c243d(dirty)"
# level=info msg="Using default capabilities: CAP_CHOWN, CAP_DAC_OVERRIDE, CAP_FSETID, CAP_FOWNER, CAP_SETGID, CAP_SETUID, CAP_SETPCAP, CAP_NET_BIND_SERVICE, CAP_KILL"
# time="2021-12-01T21:25:09Z" level=fatal msg="running container: run pod sandbox: rpc error: code = Unknown desc = failed to pin namespaces [0xc0007cb380 0xc0007cb3b0 0xc0007cb3e0 0xc0007cb410]: [pinns:e]: Failed to unshare namespaces: Invalid argument\n[pinns:e]: Failed to read from the sync pipe: Success\n exit status 1"
# # --- crio.log :: ---

link
@giuseppe I am guessing we're expected to not be able to configure user namespaces correctly on rhel 7?

@haircommander
Copy link
Member Author

/retest-required

@haircommander haircommander added this to the 1.23 milestone Dec 2, 2021
@haircommander haircommander force-pushed the userns-test-and-docs branch 2 times, most recently from 7b607ea to d98f78f Compare December 6, 2021 21:31
@haircommander
Copy link
Member Author

/retest

@haircommander
Copy link
Member Author

@cri-o/cri-o-maintainers PTAL

@haircommander
Copy link
Member Author

/retest-required

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

Just one nit, otherwise LGTM

@@ -0,0 +1,65 @@
# User namespaces and CRI-O
Copy link
Member

Choose a reason for hiding this comment

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

Let's link this tutorial from somewhere.

Copy link
Member Author

Choose a reason for hiding this comment

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

added!

@saschagrunert
Copy link
Member

/retest-required

@nalind
Copy link
Collaborator

nalind commented Dec 9, 2021

@haircommander does the RHEL 7 node have the user.max_user_namespaces sysctl set to a non-zero value? IIRC it isn't set to a non-zero value by default there, while it is in later releases.

@haircommander
Copy link
Member Author

@haircommander does the RHEL 7 node have the user.max_user_namespaces sysctl set to a non-zero value? IIRC it isn't set to a non-zero value by default there, while it is in later releases.

I will try that!

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

LGTM

@haircommander
Copy link
Member Author

/override ci/openshift-jenkins/integration_crun
/retest-required

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 14, 2021

@haircommander: Overrode contexts on behalf of haircommander: ci/openshift-jenkins/integration_crun

Details

In response to this:

/override ci/openshift-jenkins/integration_crun
/retest-required

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.

@haircommander
Copy link
Member Author

/test integration_crun

Copy link
Member

@saschagrunert saschagrunert left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Dec 16, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, haircommander, saschagrunert

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

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [giuseppe,haircommander,saschagrunert]

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

@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

1 similar comment
@openshift-bot
Copy link

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@haircommander: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/openshift-jenkins/e2e_crun_cgroupv2 da8f9a0 link false /test e2e_cgroupv2
ci/openshift-jenkins/integration_crun_cgroupv2 da8f9a0 link false /test integration_cgroupv2

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

@haircommander
Copy link
Member Author

/override e2e-agnostic

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@haircommander: /override requires a failed status context or a job name to operate on.
The following unknown contexts were given:

  • e2e-agnostic

Only the following contexts were expected:

  • ci/kata-jenkins
  • ci/openshift-jenkins/critest_fedora
  • ci/openshift-jenkins/critest_rhel
  • ci/openshift-jenkins/e2e_crun
  • ci/openshift-jenkins/e2e_crun_cgroupv2
  • ci/openshift-jenkins/e2e_features_fedora
  • ci/openshift-jenkins/e2e_features_rhel
  • ci/openshift-jenkins/e2e_fedora
  • ci/openshift-jenkins/e2e_rhel
  • ci/openshift-jenkins/integration_crun
  • ci/openshift-jenkins/integration_crun_cgroupv2
  • ci/openshift-jenkins/integration_fedora
  • ci/openshift-jenkins/integration_rhel
  • ci/prow/e2e-agnostic
  • ci/prow/e2e-gcp
  • ci/prow/images
  • dco
  • kata-containers-2-crio-PR
  • lift
  • pull-ci-cri-o-cri-o-main-e2e-agnostic
  • pull-ci-cri-o-cri-o-main-e2e-gcp
  • pull-ci-cri-o-cri-o-main-images
  • test_pull_request_crio_critest_fedora
  • test_pull_request_crio_critest_rhel
  • test_pull_request_crio_e2e_crun_fedora
  • test_pull_request_crio_e2e_crun_fedora_cgroupv2
  • test_pull_request_crio_e2e_features_fedora
  • test_pull_request_crio_e2e_features_rhel
  • test_pull_request_crio_e2e_fedora
  • test_pull_request_crio_e2e_rhel
  • test_pull_request_crio_integration_crun_fedora
  • test_pull_request_crio_integration_crun_fedora_cgroupv2
  • test_pull_request_crio_integration_fedora
  • test_pull_request_crio_integration_rhel
  • tide
Details

In response to this:

/override e2e-agnostic

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.

@haircommander
Copy link
Member Author

/override ci/prow/e2e-agnostic

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Dec 16, 2021

@haircommander: Overrode contexts on behalf of haircommander: ci/prow/e2e-agnostic

Details

In response to this:

/override ci/prow/e2e-agnostic

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.

@openshift-merge-robot openshift-merge-robot merged commit cbcc270 into cri-o:main Dec 16, 2021
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. dco-signoff: yes Indicates the PR's author has DCO signed all their commits. kind/ci Categorizes issue or PR as related to CI kind/documentation Categorizes issue or PR as related to documentation. lgtm Indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants