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
289 stars 173 forks source link

Allow volume snapshot creation from supervisor directly. #2852

Closed akankshapanse closed 2 months ago

akankshapanse commented 3 months ago

NOTE: This is temporary change and will be reverted after storage quota support for snapshots FSS enabled.

What this PR does / why we need it: This PR allows snapshot creation from supervisor by removing webhook check temporarily for ease of testing. NOTE: This is temporary change and will be reverted after storage quota support for snapshots FSS enabled.

Which issue this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close that issue when PR gets merged): fixes #

Testing done: Before fix:

root@420bc997e27955b098ab2b5241b87781 [ ~ ]# kubectl create -f snap.yaml -n svc-velero-domain-c52
Error from server (Snapshot creation initiated directly from the Supervisor cluster is not supported. Please initiate snapshot creation from the Guest cluster.): error when creating "snap.yaml": admission webhook "validation.csi.vsphere.vmware.com" denied the request: Snapshot creation initiated directly from the Supervisor cluster is not supported. Please initiate snapshot creation from the Guest cluster.
root@420bc997e27955b098ab2b5241b87781 [ ~ ]#

After fix with manually enabling StorageQuotaM2 FSS and restarting webhook pods:

root@420bc997e27955b098ab2b5241b87781 [ ~ ]# kubectl get configmaps -n vmware-system-csi csi-feature-states -o yaml
apiVersion: v1
data:
  async-query-volume: "true"
  block-volume-snapshot: "true"
  cnsmgr-suspend-create-volume: "true"
  csi-sv-feature-states-replication: "true"
  fake-attach: "true"
  file-volume: "true"
  improved-csi-idempotency: "true"
  list-volumes: "true"
  listview-tasks: "true"
  online-volume-extend: "true"
  sibling-replica-bound-pvc-check: "true"
  storage-quota-m2: "true"                         <<< changed manually
  tkgs-ha: "true"
  trigger-csi-fullsync: "false"
  volume-extend: "true"
  volume-health: "true"
kind: ConfigMap
metadata:
  annotations:
    kubectl.kubernetes.io/last-applied-configuration: |
      {"apiVersion":"v1","data":{"async-query-volume":"true","block-volume-snapshot":"true","cnsmgr-suspend-create-volume":"true","csi-sv-feature-states-replication":"true","fake-attach":"true","file-volume":"true","improved-csi-idempotency":"true","list-volumes":"true","listview-tasks":"true","online-volume-extend":"true","sibling-replica-bound-pvc-check":"true","tkgs-ha":"true","trigger-csi-fullsync":"false","volume-extend":"true","volume-health":"true"},"kind":"ConfigMap","metadata":{"annotations":{},"name":"csi-feature-states","namespace":"vmware-system-csi"}}
  creationTimestamp: "2024-04-11T08:44:52Z"
  name: csi-feature-states
  namespace: vmware-system-csi
  resourceVersion: "12389353"
  uid: 3bc08c5b-c04e-49ae-abe5-b4042f7d9ea2
root@420bc997e27955b098ab2b5241b87781 [ ~ ]#

root@420bc997e27955b098ab2b5241b87781 [ ~ ]# kubectl get pods -n vmware-system-csi
NAME                                    READY   STATUS             RESTARTS     AGE
vsphere-csi-controller-79bf77c5-qdpxx   7/7     Running            0            3m8s
vsphere-csi-controller-79bf77c5-qqnmp   7/7     Running            0            3m17s
vsphere-csi-webhook-5d4c4b9c8b-8rjpz    0/1     CrashLoopBackOff   1 (3s ago)   5s
vsphere-csi-webhook-5d4c4b9c8b-wj9mb    1/1     Running            0            5s          <<< restarted to fetch latest FSS value
root@420bc997e27955b098ab2b5241b87781 [ ~ ]#

root@420bc997e27955b098ab2b5241b87781 [ ~ ]# kubectl create -f snap.yaml -n svc-velero-domain-c52
volumesnapshot.snapshot.storage.k8s.io/example-raw-block-snapshot created
root@420bc997e27955b098ab2b5241b87781 [ ~ ]#

Special notes for your reviewer:

Release note:

Allow volume snapshot creation from supervisor directly.
svcbot-qecnsdp commented 3 months ago

Started WCP block pre-checkin pipeline... Build Number: 1393

svcbot-qecnsdp commented 3 months ago
Build ID: 1393
WCP build status: FAILURE 
Stage before exit: null 
svcbot-qecnsdp commented 3 months ago

Started WCP block pre-checkin pipeline... Build Number: 1396

svcbot-qecnsdp commented 3 months ago
Build ID: 1396
WCP build status: FAILURE 
Stage before exit: null 
akankshapanse commented 2 months ago

WCP precheck-in pipeline result with StorageQuotaM2 FSS disabled:

PR 2852
Ran 13 of 848 Specs in 2676.707 seconds 
SUCCESS! -- 13 Passed | 0 Failed | 0 Pending | 835 Skipped 
PASS 
Ginkgo ran 1 suite in 45m41.962041288s 
Test Suite Passed 
make: Leaving directory `/home/worker/workspace/csi-wcp-precheckin/Results/1398/vsphere-csi-driver'
deepakkinni commented 2 months ago

/approve

xing-yang commented 2 months ago

/approve /lgtm

k8s-ci-robot commented 2 months ago

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: akankshapanse, deepakkinni, xing-yang

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)~~ [deepakkinni,xing-yang] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment