Skip to content

Commit 9948b6e

Browse files
committed
Runtime Assisted Mount and Manamgent enhancements
Signed-off-by: Deep Debroy <[email protected]>
1 parent 9644dc9 commit 9948b6e

File tree

2 files changed

+140
-0
lines changed

2 files changed

+140
-0
lines changed

csi.proto

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,13 +387,19 @@ message VolumeCapability {
387387
message MountVolume {
388388
// The filesystem type. This field is OPTIONAL.
389389
// An empty string is equal to an unspecified field value.
390+
// If SP has DEFER_FS_OPS node capability and CO specifies
391+
// fs_defer_ops = true then SP MUST pass this field
392+
// to the container runtime that will mount the file system.
390393
string fs_type = 1;
391394

392395
// The mount options that can be used for the volume. This field is
393396
// OPTIONAL. `mount_flags` MAY contain sensitive information.
394397
// Therefore, the CO and the Plugin MUST NOT leak this information
395398
// to untrusted entities. The total size of this repeated field
396399
// SHALL NOT exceed 4 KiB.
400+
// If SP has DEFER_FS_OPS node capability and CO specifies
401+
// fs_defer_ops = true then SP MUST pass this field
402+
// to the container runtime that will mount the file system.
397403
repeated string mount_flags = 2;
398404

399405
// If SP has VOLUME_MOUNT_GROUP node capability and CO provides
@@ -408,6 +414,25 @@ message VolumeCapability {
408414
// both readable and writable by said mount group identifier.
409415
// This is an OPTIONAL field.
410416
string volume_mount_group = 3 [(alpha_field) = true];
417+
418+
// If SP has DEFER_FS_OPS_WITH_SUPPLEMENTAL_GROUP node capability
419+
// and CO provides this field then SP MUST ensure that the
420+
// volume_supplemental_group parameter is passed as a supplemental
421+
// Group ID that owns the file system after it has been mounted by the
422+
// container runtime handler.
423+
// A CO MUST NOT populate this field if defer_fs_ops is empty
424+
// This is an OPTIONAL field.
425+
string volume_supplemental_group = 4 [(alpha_field) = true];
426+
427+
// If SP has DEFER_FS_OPS_WITH_SUPPLEMENTAL_GROUP_CHANGE_POLICY node
428+
// capability and CO provides this field then SP MUST ensure that the
429+
// volume_supplemental_group_change_policy parameter is passed as the
430+
// policy through which ownership by a supplemental Group ID is set
431+
// after it has been mounted by the container runtime handler.
432+
// A CO MUST NOT populate this field if defer_fs_ops or
433+
// volume_supplemental_group is empty
434+
// This is an OPTIONAL field.
435+
string volume_supplemental_group_change_policy = 5 [(alpha_field) = true];
411436
}
412437

413438
// Specify how a volume can be accessed.
@@ -1383,6 +1408,13 @@ message NodePublishVolumeRequest {
13831408
// This field is OPTIONAL and MUST match the volume_context of the
13841409
// volume identified by `volume_id`.
13851410
map<string, string> volume_context = 8;
1411+
1412+
// Indicates SP MUST defer file system mount and any post-mount
1413+
// configuration operations (such as application of file system
1414+
// ownership by a supplemental group, if supported) to
1415+
// a container runtime handler.
1416+
// This field is OPTIONAL.
1417+
bool defer_fs_ops = 9;
13861418
}
13871419

13881420
message NodePublishVolumeResponse {
@@ -1401,6 +1433,11 @@ message NodeUnpublishVolumeRequest {
14011433
// system/filesystem, but, at a minimum, SP MUST accept a max path
14021434
// length of at least 128 bytes.
14031435
string target_path = 2;
1436+
1437+
// Indicates SP MUST defer file system dismount and cleanup
1438+
// to a container runtime handler.
1439+
// This field is OPTIONAL.
1440+
bool defer_fs_ops = 3;
14041441
}
14051442

14061443
message NodeUnpublishVolumeResponse {
@@ -1431,6 +1468,11 @@ message NodeGetVolumeStatsRequest {
14311468
// system/filesystem, but, at a minimum, SP MUST accept a max path
14321469
// length of at least 128 bytes.
14331470
string staging_target_path = 3;
1471+
1472+
// Indicates SP MUST obtain file system stats from a
1473+
// container runtime handler (that has mounted the file system).
1474+
// This field is OPTIONAL.
1475+
bool defer_fs_ops = 4;
14341476
}
14351477

14361478
message NodeGetVolumeStatsResponse {
@@ -1441,6 +1483,17 @@ message NodeGetVolumeStatsResponse {
14411483
// This field MUST be specified if the VOLUME_CONDITION node
14421484
// capability is supported.
14431485
VolumeCondition volume_condition = 2 [(alpha_field) = true];
1486+
// Indicates that Node service supports deferring file system
1487+
// mount and management operations to a container runtime handler.
1488+
DEFER_FS_OPS = 7 [(alpha_enum_value) = true];
1489+
// Indicates that Node service supports passing a supplemental
1490+
// Group ID as a post mount configuration when deferring
1491+
// file system mount to a container runtime handler.
1492+
DEFER_FS_OPS_WITH_SUPPLEMENTAL_GROUP = 8 [(alpha_enum_value) = true];
1493+
// Indicates that Node service supports passing a supplemental
1494+
// Group ID change policy as a post mount configuration when
1495+
// deferring file system mount to a container runtime handler.
1496+
DEFER_FS_OPS_WITH_SUPPLEMENTAL_GROUP_CHANGE_POLICY = 9 [(alpha_enum_value) = true];
14441497
}
14451498

14461499
message VolumeUsage {
@@ -1581,6 +1634,13 @@ message NodeGetInfoResponse {
15811634
// Indicates the node exists within the "region" "R1" and the "zone"
15821635
// "Z2".
15831636
Topology accessible_topology = 3;
1637+
1638+
// If SP has DEFER_FS_OPS node capability, a plugin MUST populate
1639+
// this field with the list of file systems that it supports. A CO
1640+
// SHOULD use this to match the deferral capabilities of a plugin
1641+
// with a container runtime handler for a workload.
1642+
// This field is OPTIONAL.
1643+
repeated string supported_file_systems = 4;
15841644
}
15851645
message NodeExpandVolumeRequest {
15861646
// The ID of the volume. This field is REQUIRED.
@@ -1628,6 +1688,11 @@ message NodeExpandVolumeRequest {
16281688
// section on how to use this field.
16291689
map<string, string> secrets = 6
16301690
[(csi_secret) = true, (alpha_field) = true];
1691+
1692+
// Indicates SP MUST defer file system expansion to a
1693+
// container runtime handler (that has mounted the file system).
1694+
// This field is OPTIONAL.
1695+
bool defer_fs_ops = 7 [(alpha_enum_value) = true];
16311696
}
16321697

16331698
message NodeExpandVolumeResponse {

spec.md

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,13 +854,19 @@ message VolumeCapability {
854854
message MountVolume {
855855
// The filesystem type. This field is OPTIONAL.
856856
// An empty string is equal to an unspecified field value.
857+
// If SP has DEFER_FS_OPS node capability and CO specifies
858+
// fs_defer_ops = true then SP MUST pass this field
859+
// to the container runtime that will mount the file system.
857860
string fs_type = 1;
858861
859862
// The mount options that can be used for the volume. This field is
860863
// OPTIONAL. `mount_flags` MAY contain sensitive information.
861864
// Therefore, the CO and the Plugin MUST NOT leak this information
862865
// to untrusted entities. The total size of this repeated field
863866
// SHALL NOT exceed 4 KiB.
867+
// If SP has DEFER_FS_OPS node capability and CO specifies
868+
// fs_defer_ops = true then SP MUST pass this field
869+
// to the container runtime that will mount the file system.
864870
repeated string mount_flags = 2;
865871
866872
// If SP has VOLUME_MOUNT_GROUP node capability and CO provides
@@ -875,6 +881,25 @@ message VolumeCapability {
875881
// both readable and writable by said mount group identifier.
876882
// This is an OPTIONAL field.
877883
string volume_mount_group = 3 [(alpha_field) = true];
884+
885+
// If SP has DEFER_FS_OPS_WITH_SUPPLEMENTAL_GROUP node capability
886+
// and CO provides this field then SP MUST ensure that the
887+
// volume_supplemental_group parameter is passed as a supplemental
888+
// Group ID that owns the file system after it has been mounted by the
889+
// container runtime handler.
890+
// A CO MUST NOT populate this field if defer_fs_ops is empty
891+
// This is an OPTIONAL field.
892+
string volume_supplemental_group = 4 [(alpha_field) = true];
893+
894+
// If SP has DEFER_FS_OPS_WITH_SUPPLEMENTAL_GROUP_CHANGE_POLICY node
895+
// capability and CO provides this field then SP MUST ensure that the
896+
// volume_supplemental_group_change_policy parameter is passed as the
897+
// policy through which ownership by a supplemental Group ID is set
898+
// after it has been mounted by the container runtime handler.
899+
// A CO MUST NOT populate this field if defer_fs_ops or
900+
// volume_supplemental_group is empty
901+
// This is an OPTIONAL field.
902+
string volume_supplemental_group_change_policy = 5 [(alpha_field) = true];
878903
}
879904
880905
// Specify how a volume can be accessed.
@@ -2349,6 +2374,13 @@ message NodePublishVolumeRequest {
23492374
// This field is OPTIONAL and MUST match the volume_context of the
23502375
// volume identified by `volume_id`.
23512376
map<string, string> volume_context = 8;
2377+
2378+
// Indicates SP MUST defer file system mount and any post-mount
2379+
// configuration operations (such as application of file system
2380+
// ownership by a supplemental group, if supported) to
2381+
// a container runtime handler.
2382+
// This field is OPTIONAL.
2383+
bool defer_fs_ops = 9;
23522384
}
23532385
23542386
message NodePublishVolumeResponse {
@@ -2399,6 +2431,11 @@ message NodeUnpublishVolumeRequest {
23992431
// system/filesystem, but, at a minimum, SP MUST accept a max path
24002432
// length of at least 128 bytes.
24012433
string target_path = 2;
2434+
2435+
// Indicates SP MUST defer file system dismount and cleanup
2436+
// to a container runtime handler.
2437+
// This field is OPTIONAL.
2438+
bool defer_fs_ops = 3;
24022439
}
24032440
24042441
message NodeUnpublishVolumeResponse {
@@ -2455,6 +2492,11 @@ message NodeGetVolumeStatsRequest {
24552492
// system/filesystem, but, at a minimum, SP MUST accept a max path
24562493
// length of at least 128 bytes.
24572494
string staging_target_path = 3;
2495+
2496+
// Indicates SP MUST obtain file system stats from a
2497+
// container runtime handler (that has mounted the file system).
2498+
// This field is OPTIONAL.
2499+
bool defer_fs_ops = 4;
24582500
}
24592501
24602502
message NodeGetVolumeStatsResponse {
@@ -2571,6 +2613,20 @@ message NodeServiceCapability {
25712613
// with provided volume group identifier during node stage
25722614
// or node publish RPC calls.
25732615
VOLUME_MOUNT_GROUP = 6 [(alpha_enum_value) = true];
2616+
2617+
// Indicates that Node service supports deferring file system
2618+
// mount and management operations to a container runtime handler.
2619+
DEFER_FS_OPS = 7 [(alpha_enum_value) = true];
2620+
2621+
// Indicates that Node service supports passing a supplemental
2622+
// Group ID as a post mount configuration when deferring
2623+
// file system mount to a container runtime handler.
2624+
DEFER_FS_OPS_WITH_SUPPLEMENTAL_GROUP = 8 [(alpha_enum_value) = true];
2625+
2626+
// Indicates that Node service supports passing a supplemental
2627+
// Group ID change policy as a post mount configuration when
2628+
// deferring file system mount to a container runtime handler.
2629+
DEFER_FS_OPS_WITH_SUPPLEMENTAL_GROUP_CHANGE_POLICY = 9 [(alpha_enum_value) = true];
25742630
}
25752631
25762632
Type type = 1;
@@ -2640,6 +2696,13 @@ message NodeGetInfoResponse {
26402696
// Indicates the node exists within the "region" "R1" and the "zone"
26412697
// "Z2".
26422698
Topology accessible_topology = 3;
2699+
2700+
// If SP has DEFER_FS_OPS node capability, a plugin MUST populate
2701+
// this field with the list of file systems that it supports. A CO
2702+
// SHOULD use this to match the deferral capabilities of a plugin
2703+
// with a container runtime handler for a workload.
2704+
// This field is OPTIONAL.
2705+
repeated string supported_file_systems = 4;
26432706
}
26442707
```
26452708

@@ -2717,6 +2780,11 @@ message NodeExpandVolumeRequest {
27172780
// section on how to use this field.
27182781
map<string, string> secrets = 6
27192782
[(csi_secret) = true, (alpha_field) = true];
2783+
2784+
// Indicates SP MUST defer file system expansion to a
2785+
// container runtime handler (that has mounted the file system).
2786+
// This field is OPTIONAL.
2787+
bool defer_fs_ops = 7 [(alpha_enum_value) = true];
27202788
}
27212789
27222790
message NodeExpandVolumeResponse {
@@ -2785,6 +2853,13 @@ message NodeExpandVolumeResponse {
27852853
* Plugins SHALL NOT create additional files or directories adjacent to the UNIX socket specified by `CSI_ENDPOINT`; violations of this requirement constitute "abuse".
27862854
* The Plugin Supervisor is the ultimate authority of the directory in which the UNIX socket endpoint is created and MAY enforce policies to prevent and/or mitigate abuse of the directory by Plugins.
27872855

2856+
#### Deferring Filesystem Mount and Management to a Container Runtime Handler
2857+
A Plugin may have the capability to defer file system mount and management operations to a container runtime handler.
2858+
The CO SHOULD populate `defer_fs_ops` as `True` in CSI Node APIs when the following conditions are fulfilled:
2859+
- The container runtime handler (associated with a workload) supports deferral of file system mount and management operations from a CSI plugin.
2860+
- The CSI plugin is able to support deferral of file system mount and management operations to a container runtime handler.
2861+
- Both container runtime handler and CSI plugin is compatible around support for mounting specific file systems and applying post-mount configuration based on the workload spec (e.g. supplemental group ownership)
2862+
27882863
### Supervised Lifecycle Management
27892864

27902865
* For Plugins packaged in software form:

0 commit comments

Comments
 (0)