You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: keps/sig-node/4639-oci-volume-source/README.md
+21-15Lines changed: 21 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -351,6 +351,7 @@ container image.
351
351
352
352
The CRI API is already capable of managing container images [via the `ImageService`](https://github.com/kubernetes/cri-api/blob/3a66d9d/pkg/apis/runtime/v1/api.proto#L146-L161).
353
353
Those RPCs will be re-used for managing OCI artifacts, while the [`ImageSpec`](https://github.com/kubernetes/cri-api/blob/3a66d9d/pkg/apis/runtime/v1/api.proto#L798-L813)
354
+
as well as [`PullImageResponse`](https://github.com/kubernetes/cri-api/blob/3a66d9d/pkg/apis/runtime/v1/api.proto#L1530-L1534)
354
355
will be extended to mount the OCI object to a local path:
355
356
356
357
```protobuf
@@ -359,29 +360,35 @@ will be extended to mount the OCI object to a local path:
359
360
message ImageSpec {
360
361
// …
361
362
362
-
// Absolute local path where the image/artifacts should be mounted to.
363
-
string mountpoint = 20;
363
+
// Indicate that the OCI object should be mounted.
364
+
bool mount = 20;
364
365
365
-
// List of additional mount options (`mount -o`).
366
-
repeated string mount_options = 21;
366
+
// SELinux label to be used.
367
+
string mount_label = 21;
368
+
}
369
+
370
+
message PullImageResponse {
371
+
// …
372
+
373
+
// Absolute local path where the OCI object got mounted.
374
+
string mountpoint = 2;
367
375
}
368
376
```
369
377
370
378
This allows to re-use the existing kubelet logic for managing the OCI objects,
371
379
with the caveat that the new `VolumeSource` won't be isolated in a dedicated
372
380
plugin as part of the existing [volume manager](https://github.com/kubernetes/kubernetes/tree/6d0aab2/pkg/kubelet/volumemanager).
373
381
374
-
The added `mount_options` allow the kubelet to handle features like SELinux
375
-
relabelling by passing additional mount arguments.
382
+
The added `mount_label` allow the kubelet to support SELinux contexts.
376
383
377
384
#### Container Runtimes
378
385
379
-
Container runtimes need to support the new `mountpoint` field, otherwise the
380
-
feature cannot be used. The kubelet will verify if the `mountpoint` actually
381
-
exists on disk to check the feature availability, because Protobuf will strip
382
-
the field in a backwards compatible way for older runtimes. Pods using the new
383
-
`VolumeSource` combined with a not supported container runtime version will fail
384
-
to run on the node.
386
+
Container runtimes need to support the new `mount` field, otherwise the
387
+
feature cannot be used. The kubelet will verify if the returned `mountpoint`
388
+
actually exists on disk to check the feature availability, because Protobuf will
389
+
strip the field in a backwards compatible way for older runtimes. Pods using the
390
+
new `VolumeSource` combined with a not supported container runtime version will
391
+
fail to run on the node.
385
392
386
393
For security reasons, volume mounts should set the [`noexec`] and `ro`
387
394
(read-only) options by default.
@@ -393,9 +400,8 @@ to volume mounts, which are inherited from the `securityContext` of the pod or
393
400
container. Relabeling volume mounts can be time-consuming, especially when there
394
401
are many files on the volume.
395
402
396
-
If the following criteria are met, then the kubelet will use the `mount_options`
397
-
field in the CRI to pass `context=<SELinux label>` (`mount -o`) to the container
398
-
runtime.
403
+
If the following criteria are met, then the kubelet will use the `mount_label`
404
+
field in the CRI to apply the right SELinux label to the mount.
399
405
400
406
- The operating system must support SELinux
401
407
- The Pod must have at least `seLinuxOptions.level` assigned in the
0 commit comments