Skip to content

Commit 41d2ad6

Browse files
committed
KEP-3857: Recursive Read-only (RRO) mounts: promote to Beta
Signed-off-by: Akihiro Suda <[email protected]>
1 parent c00c35d commit 41d2ad6

File tree

3 files changed

+50
-24
lines changed

3 files changed

+50
-24
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
kep-number: 3857
22
alpha:
33
approver: "@johnbelamaric"
4+
beta:
5+
approver: "@soltysh"

keps/sig-node/3857-rro-mounts/README.md

Lines changed: 45 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -140,20 +140,21 @@ checklist items _must_ be updated for the enhancement to be released.
140140

141141
Items marked with (R) are required *prior to targeting to a milestone / release*.
142142

143-
- [ ] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
144-
- [ ] (R) KEP approvers have approved the KEP status as `implementable`
145-
- [ ] (R) Design details are appropriately documented
146-
- [ ] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
147-
- [ ] e2e Tests for all Beta API Operations (endpoints)
143+
- [X] (R) Enhancement issue in release milestone, which links to KEP dir in [kubernetes/enhancements] (not the initial KEP PR)
144+
- [X] (R) KEP approvers have approved the KEP status as `implementable`
145+
- [X] (R) Design details are appropriately documented
146+
- [X] (R) Test plan is in place, giving consideration to SIG Architecture and SIG Testing input (including test refactors)
147+
- [X] e2e Tests for all Beta API Operations (endpoints)
148+
- https://github.com/kubernetes/kubernetes/blob/v1.30.0/test/e2e_node/mount_rro_linux_test.go
148149
- [ ] (R) Ensure GA e2e tests meet requirements for [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
149150
- [ ] (R) Minimum Two Week Window for GA e2e tests to prove flake free
150151
- [ ] (R) Graduation criteria is in place
151152
- [ ] (R) [all GA Endpoints](https://github.com/kubernetes/community/pull/1806) must be hit by [Conformance Tests](https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/conformance-tests.md)
152153
- [ ] (R) Production readiness review completed
153154
- [ ] (R) Production readiness review approved
154-
- [ ] "Implementation History" section is up-to-date for milestone
155-
- [ ] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
156-
- [ ] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
155+
- [X] "Implementation History" section is up-to-date for milestone
156+
- [X] User-facing documentation has been created in [kubernetes/website], for publication to [kubernetes.io]
157+
- [X] Supporting documentation—e.g., additional design documents, links to mailing list discussions/SIG meetings, relevant PRs/issues, release notes
157158

158159
<!--
159160
**Note:** This checklist is iterative and should be reviewed and updated every time this enhancement is being considered for a milestone.
@@ -185,15 +186,8 @@ updates.
185186
[documentation style guide]: https://github.com/kubernetes/community/blob/master/contributors/guide/style-guide.md
186187
-->
187188

188-
Utilize runc's "rro" bind mount option (https://github.com/opencontainers/runc/pull/3272)
189-
to make read-only bind mounts literally read-only.
190-
191-
The "rro" bind mount options is implemented by calling [`mount_setattr(2)`](https://man7.org/linux/man-pages/man2/mount_setattr.2.html)
192-
with `MOUNT_ATTR_RDONLY` and `AT_RECURSIVE`.
193-
194-
Requires kernel >= 5.12, with one of the following OCI runtimes:
195-
- runc >= 1.1
196-
- crun >= 1.4
189+
Make read-only volumes recursively read-only.
190+
e.g., if `/mnt` is mounted as read-only, its submounts such as `/mnt/usbstorage` should be read-only too.
197191

198192
## Motivation
199193

@@ -209,6 +203,16 @@ demonstrate the interest in a KEP within the wider Kubernetes community.
209203
The current `readOnly` volumes are not recursively read-only, and may result in compromise of data;
210204
e.g., even if `/mnt` is mounted as read-only, its submounts such as `/mnt/usbstorage` are not read-only.
211205

206+
This issue can be fixed by utilizing OCI Runtime's "rro" bind mount option (https://github.com/opencontainers/runtime-spec/blob/v1.2.0/config.md#linux-mount-options)
207+
to make read-only bind mounts recursively read-only.
208+
209+
The "rro" bind mount options is implemented by calling [`mount_setattr(2)`](https://man7.org/linux/man-pages/man2/mount_setattr.2.html)
210+
with `MOUNT_ATTR_RDONLY` and `AT_RECURSIVE`.
211+
212+
Requires kernel >= 5.12, with one of the following OCI runtimes:
213+
- runc >= 1.1
214+
- crun >= 1.4
215+
212216
### Goals
213217

214218
<!--
@@ -575,9 +579,13 @@ This can inform certain test coverage improvements that we want to do before
575579
extending the production code to implement this enhancement.
576580
-->
577581

578-
- kubelet unit tests: will take a CRI status and populate the `VolumeMountStatus`.
582+
- kubelet unit tests: takes a CRI status and populate the `RecursiveReadOnly` field in the `VolumeMountStatus` struct.
583+
Implemented in <https://github.com/kubernetes/kubernetes/blob/v1.30.0/pkg/kubelet/kubelet_pods_test.go#L6080-L6201>.
584+
The unit test set covers 16 conditions as of Kubernetes v1.30.0.
585+
There is no branch coverage data (`go test -cover`), as the feature is not implemented as a dedicated Go package.
579586
- [CRI test](https://github.com/kubernetes-sigs/cri-tools):
580-
will be similar to [e2e tests](#e2e-tests) below but without using Kubernetes Core API.
587+
similar to [e2e tests](#e2e-tests) below but without using Kubernetes Core API.
588+
Implemented in <https://github.com/kubernetes-sigs/cri-tools/blob/v1.30.0/pkg/validate/container_linux.go#L311-L413>.
581589

582590
##### Integration tests
583591

@@ -623,6 +631,10 @@ We expect no non-infra related flakes in the last month as a GA graduation crite
623631
- run RecursiveReadOnly="Enabled", and verify that the mount is actually recursively read-only
624632
- run RecursiveReadOnly="Disabled", and verify that the mount is actually not recursively read-only
625633

634+
Tests are implemented in <https://github.com/kubernetes/kubernetes/blob/v1.30.0/test/e2e_node/mount_rro_linux_test.go>,
635+
and will be executed on the CI when the CI is upgraded to use containerd v2.0.
636+
So, there is no link to the testgrid yet.
637+
626638
### Graduation Criteria
627639

628640
<!--
@@ -693,9 +705,13 @@ in back-to-back releases.
693705

694706
#### Beta
695707
- e2e tests pass with containerd, CRI-O, and cri-dockerd
708+
- https://github.com/containerd/containerd/pull/9787
709+
- https://github.com/cri-o/cri-o/pull/7962
710+
- https://github.com/Mirantis/cri-dockerd/pull/370
696711

697712
#### GA
698-
- (Will be revisited during beta)
713+
- Two beta releases of Kubernetes at least
714+
- containerd, CRI-O, and cri-dockerd supports the feature with their GA releases
699715

700716
### Upgrade / Downgrade Strategy
701717

@@ -928,7 +944,13 @@ Describe manual testing that was done and the outcomes.
928944
Longer term, we may want to require automated upgrade/rollback tests, but we
929945
are missing a bunch of machinery and tooling and can't do that now.
930946
-->
931-
(Will be revisited during beta)
947+
948+
During the beta phase, the following test will be manually performed:
949+
* Enable the `RecursiveReadOnly` feature gate for kube-apiserver and kubelet.
950+
* Create a pod with `recursiveReadOnly` specified.
951+
* Disable the `RecursiveReadOnly` feature gate for kube-apiserver, and confirm that the pod gets rejected.
952+
* Enable the `RecursiveReadOnly` feature gate again, and confirm that the pod gets scheduled again.
953+
* Do the same for kubelet too.
932954

933955
###### Is the rollout accompanied by any deprecations and/or removals of features, APIs, fields of API types, flags, etc.?
934956

@@ -1240,6 +1262,8 @@ Major milestones might include:
12401262
- the version of Kubernetes where the KEP graduated to general availability
12411263
- when the KEP was retired or superseded
12421264
-->
1265+
- v1.30: alpha
1266+
- v1.31: beta
12431267

12441268
## Drawbacks
12451269

keps/sig-node/3857-rro-mounts/kep.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@ approvers:
2121
# - "/keps/sig-ccc/3456-replaced-kep"
2222
#
2323
# The target maturity stage in the current dev cycle for this KEP.
24-
stage: alpha
24+
stage: beta
2525

2626
# The most recent milestone for which work toward delivery of this KEP has been
2727
# done. This can be the current (upcoming) milestone, if it is being actively
2828
# worked on.
29-
latest-milestone: "v1.30"
29+
latest-milestone: "v1.31"
3030

3131
# The milestone at which this feature was, or is targeted to be, at each stage.
3232
milestone:
3333
alpha: "v1.30"
34-
# beta: "v1.XX"
34+
beta: "v1.31"
3535
# stable: "v1.XX"
3636

3737
# The following PRR answers are required at alpha release

0 commit comments

Comments
 (0)