Skip to content

Commit 5ba29b5

Browse files
committed
KEP-127: Address more review comments
Signed-off-by: Rodrigo Campos <[email protected]>
1 parent fc5ea6e commit 5ba29b5

File tree

1 file changed

+51
-15
lines changed

1 file changed

+51
-15
lines changed

keps/sig-node/127-user-namespaces/README.md

+51-15
Original file line numberDiff line numberDiff line change
@@ -630,6 +630,8 @@ use container runtime versions that have the needed changes.
630630

631631
- Gather and address feedback from the community
632632
- Be able to configure UID/GID ranges to use for pods
633+
- Add unit tests that exercise the feature gate switch (see section "Are there
634+
any tests for feature enablement/disablement?")
633635
- This feature is not supported on Windows.
634636
- Get review from VM container runtimes maintainers (not blocker, as VM runtimes should just ignore
635637
the field, but nice to have)
@@ -670,6 +672,26 @@ enhancement:
670672
CRI or CNI may require updating that component before the kubelet.
671673
-->
672674

675+
#### Kubelet and Kube-apiserver skew
676+
677+
The apiserver and kubelet feature gate enablement work fine in any combination:
678+
679+
1. If the apiserver has the feature gate enabled and the kubelet doesn't, then the pod will show
680+
that field and the kubelet will ignore it. Then, the pod is created without user namespaces.
681+
1. If the apiserver has the feature gate disabled and the kubelet enabled, the pod won't show this
682+
field and therefore the kubelet won't act on a field that isn't shown. The pod is created with
683+
the feature gate disabled.
684+
685+
The kubelet can still create pods with user namespaces if static-pods are configured with
686+
pod.spec.hostUsers and has the feature gate enabled.
687+
688+
If the kube-apiserver doesn't support the feature at all (< 1.25), a pod with userns will be
689+
rejected.
690+
691+
If the kubelet doesn't support the feature (< 1.25), it will ignore the pod.spec.hostUsers field.
692+
693+
#### Kubelet and container runtime skews
694+
673695
Some definitions first:
674696
- New kubelet: kubelet with CRI proto files that includes the changes proposed in
675697
this KEP.
@@ -794,6 +816,9 @@ We will also unit test that, if pods were created with the new field
794816
pod.specHostUsers, then if the featuregate is disabled all works as expected (no
795817
user namespace is used).
796818

819+
We will add tests exercising the `switch` of feature gate itself (what happens
820+
if I disable a feature gate after having objects written with the new field)
821+
797822
<!--
798823
The e2e framework does not currently support enabling or disabling feature
799824
gates. However, unit tests in each component dealing with managing data, created
@@ -815,16 +840,18 @@ This section must be completed when targeting beta to a release.
815840

816841
###### How can a rollout or rollback fail? Can it impact already running workloads?
817842

818-
The rollout is just a feature flag on the kubelet and the kube-apiserver.
843+
If one APIserver is upgraded while other's aren't and you are talking to a not
844+
upgraded one, the pod will be accepted (if the apiserver is >= 1.25, rejected if
845+
< 1.25).
819846

820-
If one APIserver is upgraded while other's aren't and you are talking to a not upgraded the pod
821-
will be accepted (if the apiserver is >= 1.25). If it is scheduled to a node that the kubelet has
822-
the feature flag activated and the node meets the requirements to use user namespaces, then the
823-
pod will be created with the namespace. If it is scheduled to a node that has the feature disabled,
824-
it will be created without the user namespace.
847+
If it is scheduled to a node where the kubelet has the feature flag activated
848+
and the node meets the requirements to use user namespaces, then the pod will be
849+
created with the namespace. If it is scheduled to a node that has the feature
850+
disabled, it will be created without the user namespace.
825851

826-
On a rollback, pods created while the feature was active (created with user namespaces) will have to
827-
be re-created without user namespaces.
852+
On a rollback, pods created while the feature was active (created with user
853+
namespaces) will have to be re-created to run without user namespaces. If those
854+
weren't recreated, they will continue to run in a user namespace.
828855

829856
<!--
830857
Try to be as paranoid as possible - e.g., what if some components will restart
@@ -841,8 +868,15 @@ will rollout across nodes.
841868
On Kubernetes side, the kubelet should start correctly.
842869

843870
On the node runtime side, a pod created with pod.spec.hostUsers=false should be on RUNNING state if
844-
all node requirements are met. If the CRI runtime or the handler do not support the feature, the kubelet
845-
returns an error.
871+
all node requirements are met. If the CRI runtime or the handler do not support the feature, the
872+
kubelet returns an error.
873+
874+
When a pod hits this error returned by the kubelet, the status in `kubectl` is shown as
875+
`ContainerCreating` and the pod events shows:
876+
877+
```
878+
Warning FailedCreatePodSandBox 12s (x23 over 5m6s) kubelet Failed to create pod sandbox: user namespaces is not supported by the runtime
879+
```
846880

847881
<!--
848882
What signals should users be paying attention to when the feature is young
@@ -1201,7 +1235,8 @@ No changes to current kubelet behaviors. The feature only uses kubelet-local inf
12011235
levels that could help debug the issue?
12021236
Not required until feature graduated to beta.
12031237

1204-
The error is returned on pod-creation, no need to search for logs.
1238+
The Kubelet will get an error from the runtime and will propagate it to the pod (visible on
1239+
the pod events).
12051240

12061241
The idmap mount is created by the OCI runtime, not at the kubelet layer. At the kubelet layer, this
12071242
is just another OCI runtime error.
@@ -1231,7 +1266,8 @@ No changes to current kubelet behaviors. The feature only uses kubelet-local inf
12311266
- Detection: How can it be detected via metrics? Stated another way:
12321267
how can an operator troubleshoot without logging into a master or worker node?
12331268

1234-
Errors are returned on pod creation, directly to the user. No need to use metrics.
1269+
Errors are returned on pod creation, directly to the user (visible on the pod events). No
1270+
need to use metrics.
12351271

12361272
See the pod events, it should contain something like:
12371273

@@ -1249,7 +1285,7 @@ No changes to current kubelet behaviors. The feature only uses kubelet-local inf
12491285
levels that could help debug the issue?
12501286
Not required until feature graduated to beta.
12511287

1252-
No extra logs, the error is returned to the user.
1288+
No extra logs, the error is returned to the user (visible in the pod events).
12531289

12541290
- Testing: Are there any tests for failure mode? If not, describe why.
12551291

@@ -1262,8 +1298,8 @@ writing to this file.
12621298
- Detection: How can it be detected via metrics? Stated another way:
12631299
how can an operator troubleshoot without logging into a master or worker node?
12641300

1265-
Errors are returned to the operation failed (like pod creation), no need to see metrics nor
1266-
logs.
1301+
Errors are returned to the operation failed (like pod creation, visible on the pod events),
1302+
no need to see metrics nor logs.
12671303

12681304
Errors are returned to the either on:
12691305
* Kubelet initialization: the initialization fails if the feature gate is active and there is a

0 commit comments

Comments
 (0)