You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1. If the Bucket's driver matches the sidecar's driver, continue
390
390
2. If `objectstorage.k8.io/bucketclaim-being-deleted` annotation, continue
391
391
3. If reclaim policy is `Delete`
392
392
1. If Bucket has nil deletion timestamp, exit (do not deprovision without deletion timestamp)
393
393
2. Sidecar calls the COSI driver via gRPC to de-provision the OSP bucket
394
394
3. If OSP returns provision fail, Sidecar reports error to Bucket status and retries gRPC call
395
-
4. When OSP returns provision success, remove Bucket `objectstorage.k8s.io/cleanup` finalizer
395
+
4. When OSP returns provision success, remove Bucket `objectstorage.k8s.io/bucket-protection` finalizer
396
396
4. If deletion policy is `Retain`, nothing more to do
397
397
398
398
COSI Sidecar should not have Bucket delete permissions.
@@ -416,7 +416,7 @@ If a BucketClaim is in deleting state, no new BucketAccesses can be created for
416
416
4. COSI Controller detects the BucketAccess resource
417
417
1. Controller looks up corresponding BucketClaim
418
418
2. If BucketClaim is being deleted, error without retry
419
-
3. Controller sets `objectstorage.k8s.io/cleanup` finalizer on BucketAccess
419
+
3. Controller sets `objectstorage.k8s.io/bucketaccess-protection` finalizer on BucketAccess
420
420
4. Controller sets `objectstorage.k8s.io/has-bucketaccess-references` annotation on corresponding BucketClaim
421
421
(block claim from being deleted until access is deleted)
422
422
5. If BucketClaim not ready, exit with retry
@@ -427,15 +427,15 @@ If a BucketClaim is in deleting state, no new BucketAccesses can be created for
427
427
5. COSI Sidecar detects the BucketAccess resource
428
428
1. BucketAccess status now shows corresponding Bucket name and BucketAccess info, so sidecar can provision
429
429
2. If the BucketAccess's driver matches the sidecar's driver, continue
430
-
3. Sidecar applies `objectstorage.k8s.io/cleanup` finalizer to the BucketAccess if needed
430
+
3. Sidecar applies `objectstorage.k8s.io/bucketaccess-protection` finalizer to the BucketAccess if needed
431
431
4. Sidecar looks up the Bucket to get necessary info
432
432
5. If Bucket has `objectstorage.k8.io/bucketclaim-being-deleted` annotation or deletion timestamp, error without retry
433
433
(this indicates the claim is being deleted, possibly race condition missed in Controller)
434
434
6. Sidecar calls the COSI driver via gRPC to generate unique access credentials for the Bucket
435
435
1. For `IAM` auth, driver is responsible for setting up the ServiceAccount at this step
436
436
7. If OSP returns provision fail, Sidecar reports error to BucketAccess status and retries gRPC call
437
437
8. When OSP returns provision success, COSI sidecar:
438
-
1. Applies `objectstorage.k8s.io/cleanup` finalizer to the Secret
438
+
1. Applies `objectstorage.k8s.io/bucketaccess-protection` finalizer to the Secret
439
439
2. Updates the BucketAccess Secret with all info needed to access the OSP bucket
440
440
3. Updates BucketAccess status `ReadyToUse` to true
441
441
@@ -449,7 +449,7 @@ COSI does not set up or manage mounting BucketAccess information to Pods consumi
449
449
2. COSI Controller detects BucketAccess resource's deletion timestamp
450
450
1. Initially, Controller does nothing, waiting for Sidecar to set `objectstorage.k8s.io/sidecar-cleanup-finished` annotation
451
451
3. COSI Sidecar detects BucketAccess resource's deletion timestamp
452
-
1. Sidecar removes `objectstorage.k8s.io/cleanup` finalizer from the BucketAccess Secret
452
+
1. Sidecar removes `objectstorage.k8s.io/bucketaccess-protection` finalizer from the BucketAccess Secret
453
453
2. Sidecar deletes the BucketAccess Secret (should happen before OSP access is removed via gRPC)
454
454
3. Sidecar calls the COSI driver via gRPC to revoke the associated access credentials
455
455
4. If OSP returns de-provision fail, COSI sidecar reports error to BucketAccess status and retries gRPC call
@@ -458,7 +458,7 @@ COSI does not set up or manage mounting BucketAccess information to Pods consumi
458
458
1. Sets `objectstorage.k8s.io/sidecar-cleanup-finished` annotation on BucketAccess
459
459
4. Controller detects BucketAccess resource update, with deletion timestamp
460
460
1. Controller removes `objectstorage.k8s.io/has-bucketaccess-references` from BucketClaim if this is the last BucketAccess against the BucketClaim (this allows BucketClaim to start deletion, if applicable)
461
-
2. Controller removes `objectstorage.k8s.io/cleanup` from BucketAccess
461
+
2. Controller removes `objectstorage.k8s.io/bucketaccess-protection` from BucketAccess
462
462
463
463
#### Attaching Bucket Information to Pods
464
464
@@ -484,10 +484,12 @@ This section describes the current design for sharing buckets with other namespa
484
484
Annotations:
485
485
-`objectstorage.k8s.io/bucketclaim-being-deleted`: applied to a Bucket when the Controller detects that the Bucket's bound BucketClaim is being deleted
486
486
-`objectstorage.k8s.io/has-bucketaccess-references`: applied to a BucketClaim when the Controller detects that one or more BucketAccesses reference the claim
487
-
-`objectstorage.k8s.io/sidecar-cleanup-finished`: applied to a BucketAccess when the Sidecar has finished cleaning up, allowing the Controller to begin its cleanup operations
487
+
-`objectstorage.k8s.io/sidecar-cleanup-finished`: applied to a BucketAccess when the Sidecar has finished cleaning up, allowing the Controller to begin its final cleanup operations
488
488
489
489
Finalizers:
490
-
-`objectstorage.k8s.io/cleanup`: prevents a COSI-managed resource from being deleted until COSI has cleaned up underlying resources and/or OSP data
490
+
-`objectstorage.k8s.io/bucketclaim-protection`: applied to BucketClaims to prevent them from being deleted until COSI has cleaned up intermediate and underlying resources
491
+
-`objectstorage.k8s.io/bucket-protection`: applied to Buckets to prevent them from being deleted until COSI has cleaned up underlying resources
492
+
-`objectstorage.k8s.io/bucketaccess-protection`: applied to BucketAccesses and BucketAccess Secrets to prevent them from being deleted until COSI has cleaned up underlying resources
491
493
492
494
#### Bucket
493
495
@@ -511,7 +513,7 @@ Bucket {
511
513
// +required
512
514
DeletionPolicy DeletionPolicy
513
515
514
-
//Name of the BucketClaim that resulted in the creation of this Bucket.
516
+
//References the BucketClaim that resulted in the creation of this Bucket.
515
517
// For statically-provisioned buckets, set the namespace and name of the BucketClaim that is
0 commit comments