containerized-data-importer
containerized-data-importer copied to clipboard
Support ReadWriteOncePod for DataVolumes
There's a new pvc accessMode called ReadWriteOncePod which means that a PVC can only be accessed by one pod at a time. The ReadWriteOnce accessMode only guaranteed that a single hosted accessed the PVC at a time, but multiple pods could.
It's possible this is as simple as letting the new AccessMode pass validation as outlined in the patch below.
diff --git a/pkg/apiserver/webhooks/datavolume-validate.go b/pkg/apiserver/webhooks/datavolume-validate.go
index 690dbb112..4e28fe5e8 100644
--- a/pkg/apiserver/webhooks/datavolume-validate.go
+++ b/pkg/apiserver/webhooks/datavolume-validate.go
@@ -131,10 +131,10 @@ func (wh *dataVolumeValidatingWebhook) validateDataVolumeSpec(request *admission
// here in storage spec we allow empty access mode and AccessModes with more than one entry
accessModes := spec.Storage.AccessModes
for _, mode := range accessModes {
- if mode != v1.ReadWriteOnce && mode != v1.ReadOnlyMany && mode != v1.ReadWriteMany {
+ if mode != v1.ReadWriteOnce && mode != v1.ReadOnlyMany && mode != v1.ReadWriteMany && mode != v1.ReadWriteOncePod {
causes = append(causes, metav1.StatusCause{
Type: metav1.CauseTypeFieldValueInvalid,
- Message: fmt.Sprintf("Unsupported value: \"%s\": supported values: \"ReadOnlyMany\", \"ReadWriteMany\", \"ReadWriteOnce\"", string(accessModes[0])),
+ Message: fmt.Sprintf("Unsupported value: \"%s\": supported values: \"ReadOnlyMany\", \"ReadWriteMany\", \"ReadWriteOnce\", \"ReadWriteOncePod\" ", string(accessModes[0])),
Field: field.Child("PVC", "accessModes").String(),
})
return causes
Nice, we had just discussed this yesterday with @mhenriks and created an investigation task. Expansion pod after smart/CSI clones with WFFC might be a problem.
Worth to note its alpha at this point: https://github.com/kubernetes/kubernetes/blob/4885f4d75020621e8d77c367fc073fe01a538ec4/pkg/features/kube_features.go#L991
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
/remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
.
/lifecycle rotten
/remove-lifecycle rotten
Has ReadWriteOncePod moved to beta yet or is it still alpha?
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
/remove-lifecycle stale
/assign @akalenyu
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
.
/lifecycle stale
/remove-lifecycle stale
FYI this feature went beta some months ago https://github.com/kubernetes/kubernetes/pull/114494, @akalenyu do we know if the expansion pod issue you mentioned would be a problem?
FYI this feature went beta some months ago kubernetes/kubernetes#114494, @akalenyu do we know if the expansion pod issue you mentioned would be a problem?
Yeah, should still be there, although with populators things may be slightly different. With WFFC you'd have the user consuming the target ReadWriteOncePod PVC, so the expansion pod will fail at webhook/scheduling (already occupied by the user's consumer pod)
Yeah, should still be there, although with populators things may be slightly different. With WFFC you'd have the user consuming the target ReadWriteOncePod PVC, so the expansion pod will fail at webhook/scheduling (already occupied by the user's consumer pod)
With populators, the expansion pod is technically consuming a different PVC so there shouldn't be an issue
We discussed this issue again in the January 29 SIG-Storage meeting. It seems the next step would be for someone to create an exploratory PR that allows RWOP access mode and changes the tests to use it. This would help us to learn if CDI has any issues with this access mode. We can add some smoke tests for it but to repeat all of the RWO tests for RWOP seems like overkill.