Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Workflow for moving a writer workload into a node with an existing reader workload #497

Open
sumukhs opened this issue Nov 9, 2021 · 3 comments

Comments

@sumukhs
Copy link

sumukhs commented Nov 9, 2021

In the following scenario, could you please clarify the right behavior w.r.t ControllerPublishVolume call semantics:

Setup:
0. Volume v1 is created with multi node reader/writer capability.

  1. ControllerPublishVolume for node N1, volume v1 is invoked with capability as Read only = true. CO invokes NodeStageVolume on N1, followed by NodePublishVolume.
  2. ControllerPublishVolume for node N2, volume v1 is invoked with capability as a Writer. CO invokes NodeStageVolume on N2, followed by NodePublishVolume.

Scenario:
The CO intends to move workload on N2 to N1.

Behavior 1:

  1. CO invokes ControllerPublishVolume for node N1, volume v1 with capability as Writer.
  2. CO then invokes NodePublishVolume on node N1, volume v1 with capability as Writer with the same target staging path as earlier and a new target path.

Behavior 2:

  1. CO directly invokes NodePublishVolume on node N1, volume v1 with capability as Writer with the same target staging path as earlier and a new target path.

What is the expected contract per CSI?
I would expect 2, but wanted to double check with the community.

@sumukhs
Copy link
Author

sumukhs commented Nov 9, 2021

I read this in the kubernetes docs
Important! A volume can only be mounted using one access mode at a time, even if it supports many. For example, a GCEPersistentDisk can be mounted as ReadWriteOnce by a single node or ReadOnlyMany by many nodes, but not at the same time.

In my scenario above, a volume's node capability is being modified from being read-only to read-write - based on the text above it is unsupported from Kubernetes?

@jdef
Copy link
Member

jdef commented Dec 5, 2021 via email

@bswartz
Copy link
Contributor

bswartz commented Apr 19, 2022

@sumukhs The limitation is worse than that for K8s. In K8s you can only have one access mode per PVC, if you use CSI. The existing sidecars prohibit mixing access modes.

You can use the RWX access mode, and make individual pods read only, and ControllerPublish will be called with readOnly=false and NodePublish will be called with readOnly=true. This gives you the desired behavior, I think.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants