Skip to content

Commit b0526dc

Browse files
ratagiuseppe
andcommitted
KEP-127: Add CRI changes for userns support
We have a PoC for containerd and CRIO working with these changes just fine. Signed-off-by: Rodrigo Campos <[email protected]> Co-authored-by: Giuseppe Scrivano <[email protected]> Signed-off-by: Giuseppe Scrivano <[email protected]>
1 parent edb6849 commit b0526dc

File tree

1 file changed

+60
-0
lines changed

1 file changed

+60
-0
lines changed

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

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
- [Risks and Mitigations](#risks-and-mitigations)
2020
- [Design Details](#design-details)
2121
- [Pod.spec changes](#podspec-changes)
22+
- [CRI changes](#cri-changes)
2223
- [Phases](#phases)
2324
- [Phase 1: pods &quot;without&quot; volumes](#phase-1-pods-without-volumes)
2425
- [Phase 2: pods with volumes](#phase-2-pods-with-volumes)
@@ -200,6 +201,65 @@ If true or not present, uses the host user namespace (as today)
200201
If false, a new userns is created for the pod.
201202
By default it is set to `true`.
202203

204+
### CRI changes
205+
206+
The following messages will be added:
207+
208+
```
209+
// A IDMapping describes a ID mapping for the user namespace used for the
210+
// pod.
211+
message IDMapping {
212+
// host_id is the id on the host.
213+
uint32 host_id = 1;
214+
// container_id is the id in the container.
215+
uint32 container_id = 2;
216+
// length is the size of the range to map.
217+
uint32 length = 3;
218+
}
219+
220+
// A UserNamespace describes the intended user namespace configuration.
221+
message UserNamespace {
222+
// User namespace for this sandbox.
223+
// Note: It currently supports only POD and NODE.
224+
NamespaceMode mode = 1;
225+
226+
// uids specifies the UID mappings for the user namespace.
227+
repeated IDMapping uids = 2;
228+
229+
// gids specifies the GID mappings for the user namespace.
230+
repeated IDMapping gids = 3;
231+
}
232+
```
233+
234+
The existing message `NamespaceOption` will have a `user` field added.
235+
The complete `NamespaceOption` message with the new field is shown here:
236+
237+
```
238+
// NamespaceOption provides options for Linux namespaces.
239+
message NamespaceOption {
240+
// Network namespace for this container/sandbox.
241+
// Note: There is currently no way to set CONTAINER scoped network in the Kubernetes API.
242+
// Namespaces currently set by the kubelet: POD, NODE
243+
NamespaceMode network = 1;
244+
// PID namespace for this container/sandbox.
245+
// Note: The CRI default is POD, but the v1.PodSpec default is CONTAINER.
246+
// The kubelet's runtime manager will set this to CONTAINER explicitly for v1 pods.
247+
// Namespaces currently set by the kubelet: POD, CONTAINER, NODE, TARGET
248+
NamespaceMode pid = 2;
249+
// IPC namespace for this container/sandbox.
250+
// Note: There is currently no way to set CONTAINER scoped IPC in the Kubernetes API.
251+
// Namespaces currently set by the kubelet: POD, NODE
252+
NamespaceMode ipc = 3;
253+
// Target Container ID for NamespaceMode of TARGET. This container must have been
254+
// previously created in the same pod. It is not possible to specify different targets
255+
// for each namespace.
256+
string target_id = 4;
257+
// User namespace for this sandbox.
258+
UserNamespace user = 5;
259+
}
260+
261+
```
262+
203263
### Phases
204264

205265
We propose to divide the work in 3 phases. Each phase makes this work with

0 commit comments

Comments
 (0)