Skip to content

Commit e5eb8dc

Browse files
committed
Updates the FSGroupPolicy KEP to match implementation
1 parent 73323c7 commit e5eb8dc

File tree

1 file changed

+24
-25
lines changed
  • keps/sig-storage/1682-csi-driver-skip-permission

1 file changed

+24
-25
lines changed

keps/sig-storage/1682-csi-driver-skip-permission/README.md

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ such as presence of fsType on the PVC to determine if the volume supports fsGrou
5151
permission change. These heuristics are known to be fragile, and cause problems with different
5252
storage types.
5353

54-
To solve this issue we will add a new field called `CSIDriver.Spec.SupportsFSGroup`
54+
To solve this issue we will add a new field called `CSIDriver.Spec.FSGroupPolicy`
5555
that allows the driver to define if it supports volume ownership modifications via
5656
fsGroup.
5757

@@ -75,12 +75,12 @@ support these operations.
7575

7676
We propose that the `CSIDriver` type include a field that defines if the volume
7777
provided by the driver supports changing volume ownership. This will be enabled
78-
with a new feature gate, `CSIVolumeSupportFSGroup`.
78+
with a new feature gate, `CSIVolumeFSGroupPolicy`.
7979

8080
### Risks and Mitigations
8181

8282
- The CSIDriver objects will need to be redeployed after this field is introduced if the desired behavior is modified.
83-
- If a cluster enables the `CSIVolumeSupportFSGroup` feature gate and then this feature gate is disabled,
83+
- If a cluster enables the `CSIVolumeFSGroupPolicy` feature gate and then this feature gate is disabled,
8484
such as due to an upgrade or downgrade, then the cluster will revert to the current behavior of examining
8585
volumes and attempting to apply volume ownerships and permissions based on the defined `fsGroup`.
8686

@@ -92,65 +92,64 @@ attempt to modify the volume ownership and permissions.
9292

9393
As part of this proposal we will change the algorithm that modifies volume ownership and permissions
9494
for CSIDrivers to check the new field, and skip volume ownership modifications if it is found to be
95-
`Never`.
95+
`None`.
9696

9797
When defining a `CSIDriver`, we propose that `CSIDriver.Spec` be expanded to include a new field entitled
98-
`SupportsFSGroup` which can have following possible values:
98+
`CSIVolumeFSGroupPolicy` which can have following possible values:
9999

100-
- `OnlyRWO` --> Current behavior. Attempt to modify the volume ownership and permissions to the defined `fsGroup` when the volume is
101-
mounted if accessModes is RWO.
102-
- `Never` --> New behavior. Attach the volume without attempting to modify volume ownership or permissions.
103-
- `Always` --> New behavior. Always attempt to apply the defined fsGroup to modify volume ownership and permissions.
100+
- `ReadWriteOnceWithFSType` --> Current behavior. Attempt to modify the volume ownership and permissions to the defined `fsGroup` when the volume is mounted if accessModes is RWO.
101+
- `None` --> New behavior. Attach the volume without attempting to modify volume ownership or permissions.
102+
- `File` --> New behavior. Always attempt to apply the defined fsGroup to modify volume ownership and permissions regardless of fstype or access mode.
104103

105104
```go
106-
type SupportsFsGroup string
105+
type FSGroupPolicy string
107106

108107
const(
109-
OnlyRWO SupportsFsGroup = "OnlyRWO"
110-
Always SupportsFsGroup = "Always"
111-
Never SupportsFsGroup = "Never"
108+
ReadWriteOnceWithFSTypeFSGroupPolicy FSGroupPolicy = "ReadWriteOnceWithFSType"
109+
FileFSGroupPolicy FSGroupPolicy = "File"
110+
NoneFSGroupPolicy FSGroupPolicy = "None"
112111
)
113112

114113
type CSIDriverSpec struct {
115-
// SupportsFSGroup ← new field
114+
// FSGroupPolicy ← new field
116115
// Defines if the underlying volume supports changing ownership and
117116
// permission of the volume before being mounted.
118-
// If set to Always, SupportsFSGroup indicates that
117+
// If set to File, FSGroupPolicy indicates that
119118
// the volumes provisioned by this CSIDriver support volume ownership and
120119
// permission changes, and the filesystem will be modified to match the
121120
// defined fsGroup every time the volume is mounted.
122-
// If set to Never, then the volume will be mounted without modifying
121+
// If set to None, then the volume will be mounted without modifying
123122
// the volume's ownership or permissions.
124-
// Defaults to OnlyRWO, which results in the volume being examined
123+
// Defaults to ReadWriteOnceWithFSType, which results in the volume being examined
125124
// and the volume ownership and permissions attempting to be updated
126125
// only when the PodSecurityPolicy's fsGroup is explicitly defined, the
127126
// fsType is defined, and the PersistentVolumes's accessModes is RWO.
128127
// + optional
129-
SupportsFSGroup *SupportsFsGroup
128+
FSGroupPolicy *FSGroupPolicy
130129
}
131130
```
132131
### Test Plan
133132

134133
A test plan will include the following tests:
135134

136135
* Basic tests including a permutation of the following values:
137-
- CSIDriver.Spec.SupportsFSGroup (`Always`/`Never`/`OnlyRWO`)
136+
- CSIDriver.Spec.FSGroupPolicy (`File`/`None`/`ReadWriteOnceWithFSType`)
138137
- PersistentVolumeClaim.Status.AccessModes (`ReadWriteOnly`, `ReadOnlyMany`,`ReadWriteMany`)
139138
* E2E tests
140139

141140
### Graduation Criteria
142141

143142
* Alpha in 1.19 provided all tests are passing.
144-
* All functionality is guarded by a new alpha `CSIVolumeSupportFSGroup` feature gate.
143+
* All functionality is guarded by a new alpha `CSIVolumeFSGroupPolicy` feature gate.
145144

146145
* Beta in 1.20 with design validated by at least two customer deployments
147146
(non-production), with discussions in SIG-Storage regarding success of
148147
deployments.
149-
* The `CSIVolumeSupportFSGroup` feature gate will graduate to beta.
148+
* The `CSIVolumeFSGroupPolicy` feature gate will graduate to beta.
150149

151150

152151
* GA in 1.21, with E2E tests in place tagged with feature Storage.
153-
* The `CSIVolumeSupportFSGroup` feature gate will graduate to GA.
152+
* The `CSIVolumeFSGroupPolicy` feature gate will graduate to GA.
154153

155154
[issues]: https://github.com/kubernetes/enhancements/issues/1682
156155

@@ -159,12 +158,12 @@ A test plan will include the following tests:
159158
### Feature enablement and rollback
160159
* **How can this feature be enabled / disabled in a live cluster?**
161160
- [x] Feature gate (also fill in values in `kep.yaml`)
162-
- Feature gate name: CSIVolumeSupportFSGroup
161+
- Feature gate name: CSIVolumeFSGroupPolicy
163162
- Components depending on the feature gate: kubelet
164163

165164
* **Does enabling the feature change any default behavior?**
166165
Enabling the feature gate will **not** change the default behavior.
167-
Users must also define the `SupportsFsGroup` type for behavior to
166+
Users must also define the `FSGroupPolicy` type for behavior to
168167
be modified.
169168

170169
* **Can the feature be disabled once it has been enabled (i.e. can we rollback
@@ -173,7 +172,7 @@ A test plan will include the following tests:
173172

174173
* **What happens if we reenable the feature if it was previously rolled back?**
175174
If reenabled, any subsequent CSIDriver volumes that are mounted
176-
will respect the user-defined values for `SupportsFSGroup`. Existing mounted
175+
will respect the user-defined values for `FSGroupPolicy`. Existing mounted
177176
volumes will not be modified.
178177

179178

0 commit comments

Comments
 (0)