Skip to content

Commit 5e3fef0

Browse files
committed
KEP-2485: Update access mode mappings between K8s and CSI
1 parent fbbd126 commit 5e3fef0

File tree

1 file changed

+34
-15
lines changed
  • keps/sig-storage/2485-read-write-once-pod-pv-access-mode

1 file changed

+34
-15
lines changed

keps/sig-storage/2485-read-write-once-pod-pv-access-mode/README.md

Lines changed: 34 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -437,29 +437,48 @@ These access modes are modeled after the existing `MULTI_NODE_SINGLE_WRITER` and
437437
is because the `SINGLE_NODE_WRITER` volume capability has conflicting
438438
definitions (see the [motivation](#motivation) section for context).
439439

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.
442444

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:
450447

451448
```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.
454457
SINGLE_NODE_MULTI_WRITER = 13;
455458
```
456459

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+
457476
Put more succinctly:
458477

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) |
463482

464483
CSI clients that will need updating are kubelet, external-provisioner,
465484
external-attacher, and external-resizer.

0 commit comments

Comments
 (0)