@@ -437,29 +437,48 @@ These access modes are modeled after the existing `MULTI_NODE_SINGLE_WRITER` and
437
437
is because the ` SINGLE_NODE_WRITER ` volume capability has conflicting
438
438
definitions (see the [ motivation] ( #motivation ) section for context).
439
439
440
- For CSI clients, the new ReadWriteOncePod Kubernetes access mode will map to the
441
- ` SINGLE_NODE_SINGLE_WRITER ` volume capability access mode in the CSI spec.
440
+ In order to preserve backwards compatibility, we must be careful about how to
441
+ map between Kubernetes access modes and the new CSI access modes. The way we
442
+ control this is by maintaining different mappings based on the CSI driver's
443
+ capabilities.
442
444
443
- For the ReadWriteOnce access mode, the value it maps to depends on the CSI
444
- driver. If the CSI driver supports the ` SINGLE_NODE_MULTI_WRITER ` access mode,
445
- then ReadWriteOnce will map to that value. If the CSI driver does not support
446
- the ` SINGLE_NODE_MULTI_WRITER ` access mode, then ReadWriteOnce will map to
447
- ` SINGLE_NODE_WRITER ` to preserve backwards compatibility. In order to determine
448
- which mapping to use, both the controller and node services should have
449
- capability bits for this access mode.
445
+ Both the controller and node services should have capability bits that
446
+ represent that they support the new access modes:
450
447
451
448
``` protobuf
452
- // Indicates the SP supports the SINGLE_NODE_MULTI_WRITER access
453
- // mode.
449
+ // Indicates the SP supports the SINGLE_NODE_SINGLE_WRITER and/or
450
+ // SINGLE_NODE_MULTI_WRITER access modes.
451
+ // These access modes are intended to replace the
452
+ // SINGLE_NODE_WRITER access mode to clarify the number of writers
453
+ // for a volume on a single node. Plugins MUST accept and allow
454
+ // use of the SINGLE_NODE_WRITER access mode when either
455
+ // SINGLE_NODE_SINGLE_WRITER and/or SINGLE_NODE_MULTI_WRITER are
456
+ // supported, in order to permit older COs to continue working.
454
457
SINGLE_NODE_MULTI_WRITER = 13;
455
458
```
456
459
460
+ Although it controls support for two access modes, ` SINGLE_NODE_MULTI_WRTIER `
461
+ is chosen as the capability name because it represents the access mode that is
462
+ unsupported.
463
+
464
+ For ReadWriteOncePod, if the CSI driver supports the ` SINGLE_NODE_MULTI_WRTER `
465
+ capability, then ReadWriteOncePod will map to ` SINGLE_NODE_SINGLE_WRITER ` . If
466
+ it does not, then ReadWriteOncePod will map to ` SINGLE_NODE_WRITER ` . This
467
+ mapping is chosen because we can safely rely on Kubernetes to enforce the
468
+ access mode outside of the CSI driver. It also has the advantage of enabling
469
+ existing CSI drivers to start using ReadWriteOncePod.
470
+
471
+ For ReadWriteOnce, if the CSI driver supports the ` SINGLE_NODE_MULTI_WRITER `
472
+ capability, then ReadWriteOnce will map to ` SINGLE_NODE_MULTI_WRITER ` . If it
473
+ does not, then ReadWriteOnce will map to ` SINGLE_NODE_WRITER ` , which is the
474
+ existing behavior.
475
+
457
476
Put more succinctly:
458
477
459
- | | Driver Supports ` SINGLE_NODE_*_WRITER ` | Driver Does Not Support ` SINGLE_NODE_*_WRITER ` |
460
- | ------------------| ----------------------------------------| ---------------------------------------------------|
461
- | ReadWriteOncePod | SINGLE_NODE_SINGLE_WRITER | Don't use ReadWriteOncePod if driver is incapable |
462
- | ReadWriteOnce | SINGLE_NODE_MULTI_WRITER | SINGLE_NODE_WRITER (Existing behavior) |
478
+ | | Driver Supports ` SINGLE_NODE_MULTI_WRITER ` Capability | Driver Does Not Support ` SINGLE_NODE_MULTI_WRITER ` Capability |
479
+ | ------------------| ------------------------------------------------------- | ------------ ---------------------------------------------------|
480
+ | ReadWriteOncePod | SINGLE_NODE_SINGLE_WRITER | SINGLE_NODE_WRITER |
481
+ | ReadWriteOnce | SINGLE_NODE_MULTI_WRITER | SINGLE_NODE_WRITER (Existing behavior) |
463
482
464
483
CSI clients that will need updating are kubelet, external-provisioner,
465
484
external-attacher, and external-resizer.
0 commit comments