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

Editing annotations on an existing PVC #66

Open
fradeve opened this issue Apr 6, 2021 · 4 comments
Open

Editing annotations on an existing PVC #66

fradeve opened this issue Apr 6, 2021 · 4 comments

Comments

@fradeve
Copy link

fradeve commented Apr 6, 2021

Hi all -- thanks for bringing us this project, it's just great!

I am using v0.6.1 I have updated an existing PVC with the following annotation (+ shows the addition):

  apiVersion: v1
  kind: PersistentVolumeClaim
  metadata:
    name: foobar
    annotations:
      gcs.csi.ofek.dev/project-id: {{ .Values.gcloud.project }}
      gcs.csi.ofek.dev/location: {{ .Values.gcloud.region }}
      gcs.csi.ofek.dev/bucket: {{ .Values.code }}-foobar
      gcs.csi.ofek.dev/uid: "0"
      gcs.csi.ofek.dev/gid: "0"
+     gcs.csi.ofek.dev/limit-ops-per-sec: "-1"

The PVC has been correctly updated, and I killed the Pod mounting this PVC so that it has been re-mounted.
Looking at the logs in the csi-gcs Pod I see the following when the volume is mounted:

"Mounting cmd (mount) with arguments ([-t gcsfuse -o key_file=/tmp/keys/122073239,allow_other,dir_mode=0775,file_mode=0664,uid=0,gid=0 us-foobar /var/lib/kubelet/pods/63d32ac5-1aac-4338-8d0d-0f7ac3d09cc9/volumes/kubernetes.io~csi/pvc-edb69964-0e18-4716-a8b4-92edf8bdee19/mount])"

I can see how some of the annotations that were originally in the PVC are showing up in the gcsfuse command (e.g. uid or gid) but I can't see the limit-ops-per-sec option anywhere.

So I wonder: are these kind of updates to the PVC actually picked up when re-mounting the volume, or do they apply only when the PVC is created the first time?

Thanks

Update

I have created a fresh new PVC and mounted it on a deployment and this csi-gcs is logging the following:

Mounting cmd (mount) with arguments ([-t gcsfuse -o 
key_file=/tmp/keys/030309528,allow_other,dir_mode=0775,file_mode=0664,
uid=0,gid=0,limit_ops_per_sec=-1 foobar /var/lib/kubelet/pods/0130f46a-7ae9-4dd2-acab-d3a697f1f5ec/volumes/kubernetes.io~csi/pvc-d7a805a1-abd1-43a8-b473-cf1e06e005dc/mount])

it seems that creating a new PVC will use the right gcsfuse flags, but updating an existing PVC doesn't guarantee that gcsfuse flags are updated.

@maennchen
Copy link
Collaborator

@fradeve The CSI spec (at least at the time when I was implementing this) had no notion of changing PVC params.

The CSI Node Plugin mounts as specified by the PV and not the PVC. If you change the annotation on the PVC, this sadly has no effect on the PV and we don't get a call to the Controller Plugin to update/remount the PV.

So if the spec hasn't improved in that area, I do not think that you'll get around re-creating the PVC.

@fradeve
Copy link
Author

fradeve commented Apr 8, 2021

Thanks for clarifying this 👍 Eventually I figured out that I had to re-create the PVC altogether, and that worked 👍

@ofek
Copy link
Owner

ofek commented Apr 9, 2021

Can this be closed?

@maennchen
Copy link
Collaborator

@ofek I'd like to keep it open to see if there's a way to achieve that before I close.

@fradeve fradeve changed the title Adding "limit-ops-per-sec" to an existing PVC Editing annotations on an existing PVC May 31, 2023
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