kubernetes-sigs / vsphere-csi-driver

vSphere storage Container Storage Interface (CSI) plugin
https://docs.vmware.com/en/VMware-vSphere-Container-Storage-Plug-in/index.html
Apache License 2.0
293 stars 177 forks source link

Initialize volume locks in driver init #2834

Closed chethanv28 closed 5 months ago

chethanv28 commented 5 months ago

What this PR does / why we need it: Initialize volume locks in driver init

Testing:

Deployed CSI images with the PR changes and verified the volume & pod creation for a statefulset with 3 replicas:

# kubectl get pvc
NAME        STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   VOLUMEATTRIBUTESCLASS   AGE
www-web-0   Bound    pvc-52802aca-868d-490b-b0a8-50a2c67b4c1b   1Gi        RWO            nginx-sc       <unset>                 2m55s
www-web-1   Bound    pvc-4550816a-05f2-45b7-826e-c0b0470c4c30   1Gi        RWO            nginx-sc       <unset>                 2m33s
www-web-2   Bound    pvc-1eeb68e6-6c8d-4405-bb64-765392e84faf   1Gi        RWO            nginx-sc       <unset>                 2m12s

# kubectl get pods
NAME    READY   STATUS    RESTARTS   AGE
web-0   1/1     Running   0          2m56s
web-1   1/1     Running   0          2m34s
web-2   1/1     Running   0          2m13s
{"level":"info","time":"2024-03-20T22:10:58.947737609Z","caller":"osutils/linux_os_utils.go:458","msg":"NodePublishVolume for \"89424df6-8699-4832-a72f-bfa72a839b08\" successful to path \"/var/lib/kubelet/pods/87b68fae-d065-49a8-9be6-a337c1c8d1fb/volumes/kubernetes.io~csi/pvc-52802aca-868d-490b-b0a8-50a2c67b4c1b/mount\"","TraceId":"fb63f1e0-3907-4400-9106-7bc45d9d4535"}
{"level":"info","time":"2024-03-20T22:11:22.610899649Z","caller":"service/node.go:279","msg":"NodeGetVolumeStats: called with args {VolumeId:89424df6-8699-4832-a72f-bfa72a839b08 VolumePath:/var/lib/kubelet/pods/87b68fae-d065-49a8-9be6-a337c1c8d1fb/volumes/kubernetes.io~csi/pvc-52802aca-868d-490b-b0a8-50a2c67b4c1b/mount StagingTargetPath: XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}","TraceId":"4a7e8314-c875-430d-8268-0f98efb2fb19"}
{"level":"info","time":"2024-03-20T22:12:42.070888758Z","caller":"service/node.go:279","msg":"NodeGetVolumeStats: called with args {VolumeId:89424df6-8699-4832-a72f-bfa72a839b08 VolumePath:/var/lib/kubelet/pods/87b68fae-d065-49a8-9be6-a337c1c8d1fb/volumes/kubernetes.io~csi/pvc-52802aca-868d-490b-b0a8-50a2c67b4c1b/mount StagingTargetPath: XXX_NoUnkeyedLiteral:{} XXX_unrecognized:[] XXX_sizecache:0}","TraceId":"f52fee65-4157-4ff8-99f3-d982edf482ff"}

Release note:

Initialize volume locks in driver init
divyenpatel commented 5 months ago

/ok-to-test

svcbot-qecnsdp commented 5 months ago

Started Vanilla block pre-checkin pipeline... Build Number: 2701

svcbot-qecnsdp commented 5 months ago
Build ID: 2701
Block vanilla build status: SUCCESS 
Stage before exit: e2e-tests 
Jenkins E2E Test Results: 
------------------------------

Ran 1 of 816 Specs in 38.593 seconds
SUCCESS! -- 1 Passed | 0 Failed | 0 Pending | 815 Skipped
PASS

Ginkgo ran 1 suite in 1m29.449801196s
Test Suite Passed
k8s-ci-robot commented 5 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chethanv28, divyenpatel

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files: - ~~[OWNERS](https://github.com/kubernetes-sigs/vsphere-csi-driver/blob/master/OWNERS)~~ [chethanv28,divyenpatel] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment