Closed pcfens closed 4 years ago
LGTM, although IMO we should keep the default behavior (as in, if it isn't set in the helm values, the accessMode
should be ReadWriteOnce
if there's 1 replica or ReadWriteMany
if there's more than 1), just to keep it backwards compatible (since some PV provisioners do not support ReadWriteMany
). That's just my opinion, though, feel free to disagree.
Also, currently ngshare uses SQLite as the database, and we aren't sure if multiple instances of ngshare can use the same underlying SQLite database mounted ReadWriteMany without race conditions. Just a heads up.
I agree, but when I render the template locally I get ReadWriteMany
instead of the expected ReadWriteOnce
(that's what originally had me go to look at this). I think the conditional in the PVC template is backwards (ReadWriteOnce
is set only when the replica count is greater than 1).
The PR maintains the current behavior when replicas equals 1. If that's a bug I'm happy to submit a patch for that too.
Whoops, that's definitely a bug. I guess we can just add a note in the changelog and mention this bug, and the default behavior can just be ReadWriteMany
and users can override it if it's an issue for them.
How does this look?
LGTM - do you want to change the default value here or leave it as ReadWriteMany
?
I think leaving it as ReadWriteMany
is fine if no existing users has complained about the bug until now. Future new users can just change it if necessary.
Sounds good - I know changing defaults can cause weird problems for folks.
Rather than making the PV accessMode defined by the replica count this allows users to set it directly. Tieing the accessMode to replicaCounts make it difficult for users to make changes in the future without also forcing an accessMode change, which can be disruptive.
The previous logic set it so that a PVs were provisioned with ReadWriteMany when defaults are used, this retains that behavior.