Skip to content

Commit 9098c29

Browse files
committed
wip
1 parent c86768b commit 9098c29

File tree

1 file changed

+17
-15
lines changed
  • keps/sig-storage/1979-object-storage-support

1 file changed

+17
-15
lines changed

keps/sig-storage/1979-object-storage-support/README.md

+17-15
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ The fundamental key to this design is the bi-directional "pointer" between Bucke
303303
1. Admin allows User to use BucketClass
304304
2. User creates BucketClaim that uses BucketClass
305305
3. COSI controller observes BucketClaim
306-
1. Controller applies `objectstorage.k8s.io/cleanup` finalizer to the BucketClaim
306+
1. Controller applies `objectstorage.k8s.io/bucketclaim-protection` finalizer to the BucketClaim
307307
2. Controller looks up corresponding Bucket
308308
3. If Bucket does not exist, Controller creates intermediate Bucket resource with these details:
309309
1. Bucket.name is `bc-`+`<BucketClaim.UID>` (safe if multiple controllers active)
@@ -313,7 +313,7 @@ The fundamental key to this design is the bi-directional "pointer" between Bucke
313313
5. Controller waits for the intermediate Bucket to be reconciled by COSI sidecar
314314
4. COSI Sidecar detects intermediate Bucket resource
315315
1. If the Bucket's driver matches the sidecar's driver, continue
316-
2. Sidecar applies `objectstorage.k8s.io/cleanup` finalizer to intermediate Bucket
316+
2. Sidecar applies `objectstorage.k8s.io/bucket-protection` finalizer to intermediate Bucket
317317
3. Sidecar calls the COSI driver via gRPC to provision the OSP bucket
318318
4. If OSP returns provision fail, COSI sidecar reports error to Bucket status and retries w/ backoff
319319
5. When OSP returns provision success, COSI sidecar updates Bucket status `ReadyToUse` to true
@@ -339,7 +339,7 @@ In early COSI feedback and in other object storage self-service frameworks, user
339339
3. Admin must ensure that the Bucket binds only to a specific BucketClaim by specifying the BucketClaim parent reference by namespace and name
340340
2. COSI sidecar detects the Bucket resource
341341
1. If the Bucket's driver matches the sidecar's driver, continue
342-
2. Sidecar applies `objectstorage.k8s.io/cleanup` finalizer to Bucket
342+
2. Sidecar applies `objectstorage.k8s.io/bucket-protection` finalizer to Bucket
343343
3. Sidecar calls the COSI driver via gRPC call to check that the existing OSP bucket exists
344344
4. Sidecar exits with retry backoff if existing bucket is nonexistent
345345
5. When Bucket prep is successful, COSI sidecar updates Bucket status `ReadyToUse` to true
@@ -348,7 +348,7 @@ In early COSI feedback and in other object storage self-service frameworks, user
348348
4. COSI controller observes BucketClaim
349349
1. Controller validates BucketClaim fields
350350
2. Controller looks up corresponding Bucket - if DNE, retry with backoff (or when Bucket is created)
351-
3. Controller applies `objectstorage.k8s.io/cleanup` finalizer to BucketClaim
351+
3. Controller applies `objectstorage.k8s.io/bucketclaim-protection` finalizer to BucketClaim
352352
4. If BucketClaim reference set by admin on Bucket doesn't match, error out
353353
5. Apply Full BucketClaim reference info (with UID) to Bucket spec (Bucket is now bound to claim)
354354
6. Set BucketClaim status to point to Bucket (claim is now bound to Bucket)
@@ -381,18 +381,18 @@ When a BucketClaim with Bucket reclaim policy `Reclaim` that is deleted, the Buc
381381
1. If Bucket doesn't exist, go to **CLEANUP** (Bucket was deleted or never existed)
382382
2. If Bucket-BucketClaim binding is not valid, error out
383383
3. Apply `objectstorage.k8.io/bucketclaim-being-deleted` annotation to Bucket
384-
(tells controller that it's safe to proceed with Bucket deprovisioning)
384+
(tells Sidecar that it's safe to proceed with Bucket deprovisioning)
385385
4. If Bucket deletion policy is `Delete`, add deletion timestamp to Bucket
386386
5. If `Retain`, nothing more for Controller to do
387-
6. **CLEANUP**: Controller removes BucketClaim `objectstorage.k8s.io/cleanup` finalizer
387+
6. **CLEANUP**: Controller removes BucketClaim `objectstorage.k8s.io/bucketclaim-protection` finalizer
388388
3. COSI Sidecar detects Bucket update
389389
1. If the Bucket's driver matches the sidecar's driver, continue
390390
2. If `objectstorage.k8.io/bucketclaim-being-deleted` annotation, continue
391391
3. If reclaim policy is `Delete`
392392
1. If Bucket has nil deletion timestamp, exit (do not deprovision without deletion timestamp)
393393
2. Sidecar calls the COSI driver via gRPC to de-provision the OSP bucket
394394
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
396396
4. If deletion policy is `Retain`, nothing more to do
397397

398398
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
416416
4. COSI Controller detects the BucketAccess resource
417417
1. Controller looks up corresponding BucketClaim
418418
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
420420
4. Controller sets `objectstorage.k8s.io/has-bucketaccess-references` annotation on corresponding BucketClaim
421421
(block claim from being deleted until access is deleted)
422422
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
427427
5. COSI Sidecar detects the BucketAccess resource
428428
1. BucketAccess status now shows corresponding Bucket name and BucketAccess info, so sidecar can provision
429429
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
431431
4. Sidecar looks up the Bucket to get necessary info
432432
5. If Bucket has `objectstorage.k8.io/bucketclaim-being-deleted` annotation or deletion timestamp, error without retry
433433
(this indicates the claim is being deleted, possibly race condition missed in Controller)
434434
6. Sidecar calls the COSI driver via gRPC to generate unique access credentials for the Bucket
435435
1. For `IAM` auth, driver is responsible for setting up the ServiceAccount at this step
436436
7. If OSP returns provision fail, Sidecar reports error to BucketAccess status and retries gRPC call
437437
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
439439
2. Updates the BucketAccess Secret with all info needed to access the OSP bucket
440440
3. Updates BucketAccess status `ReadyToUse` to true
441441

@@ -449,7 +449,7 @@ COSI does not set up or manage mounting BucketAccess information to Pods consumi
449449
2. COSI Controller detects BucketAccess resource's deletion timestamp
450450
1. Initially, Controller does nothing, waiting for Sidecar to set `objectstorage.k8s.io/sidecar-cleanup-finished` annotation
451451
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
453453
2. Sidecar deletes the BucketAccess Secret (should happen before OSP access is removed via gRPC)
454454
3. Sidecar calls the COSI driver via gRPC to revoke the associated access credentials
455455
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
458458
1. Sets `objectstorage.k8s.io/sidecar-cleanup-finished` annotation on BucketAccess
459459
4. Controller detects BucketAccess resource update, with deletion timestamp
460460
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
462462

463463
#### Attaching Bucket Information to Pods
464464

@@ -484,10 +484,12 @@ This section describes the current design for sharing buckets with other namespa
484484
Annotations:
485485
- `objectstorage.k8s.io/bucketclaim-being-deleted`: applied to a Bucket when the Controller detects that the Bucket's bound BucketClaim is being deleted
486486
- `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
488488

489489
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
491493

492494
#### Bucket
493495

@@ -511,7 +513,7 @@ Bucket {
511513
// +required
512514
DeletionPolicy DeletionPolicy
513515

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.
515517
// For statically-provisioned buckets, set the namespace and name of the BucketClaim that is
516518
// allowed to bind to this Bucket.
517519
BucketClaim corev1.ObjectReference

0 commit comments

Comments
 (0)