Skip to content

Commit 099380b

Browse files
committed
[BUCKET API] clarify pod termination, and word-smith other bits based on PR comments
1 parent e2c34d4 commit 099380b

File tree

1 file changed

+20
-8
lines changed
  • keps/sig-storage/1979-object-storage-support

1 file changed

+20
-8
lines changed

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

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,9 @@ status:
163163
1. `finalizers`: added by COSI to defer `BucketRequest` deletion until backend deletion succeeds.
164164
1. `protocol.name`: (required) specifies the desired protocol. One of {“s3”, “gs”, or “azureBlob”}.
165165
1. `protocol.version`: (optional) specifies the desired version of the `protocol`. For "s3", a value of "v2" or "v4" could be used.
166-
1. `bucketPrefix`: (optional) prefix prepended to a generated new bucket name, eg. “yosemite-photos-". If `bucketInstanceName` is supplied then `bucketPrefix` is ignored because the request is for access to an existing bucket. If `bucketPrexix` is specified then it is added to the `Bucket` instance as a label.
167-
1. `bucketClassName`: (optional for greenfield, omitted for brownfield) name of the `BucketClass` used to provision this request. If omitted for a greenfield bucket request, a default bucket class matching the protocol, if available, is used. If the greenfield bucket class is missing or does not support the requested protocol, an error is logged and the request is retried (with exponential backoff). A `BucketClass` is necessary for greenfield requests since BCs support a list of allowed namespaces. A `BucketClass` is not needed for brownfield requests since the `Bucket` instance, created by the admin, also contains `allowedNamespaces`.
168-
1. `bucketInstanceName`: (optional) name of the cluster-wide `Bucket` instance. If blank, then COSI assumes this is a greenfield request and will fill in the name during the binding step. If set by the user, then this names the `Bucket` instance created by the admin.
166+
1. `bucketPrefix`: (optional for greenfield, ignored for brownfield) prefix prepended to a generated new bucket name, eg. “yosemite-photos-". If `bucketInstanceName` is supplied then `bucketPrefix` is ignored because the request is for access to an existing bucket.
167+
1. `bucketClassName`: (optional for greenfield, ignored for brownfield) name of the `BucketClass` used to provision this request. If omitted for a greenfield bucket request, a default bucket class matching the protocol, if available, is used. If the greenfield bucket class is missing or does not support the requested protocol, an error is logged and the request is retried (with exponential backoff). A `BucketClass` is necessary for greenfield requests since BCs support a list of allowed namespaces. A `BucketClass` is not needed for brownfield requests since the `Bucket` instance, created by the admin, also contains `allowedNamespaces`.
168+
1. `bucketInstanceName`: (required for brownfield, omitted for greenfield) name of the cluster-wide `Bucket` instance. If blank, then COSI assumes this is a greenfield request and will fill in the name during the binding step. If set by the user, then this names the `Bucket` instance created by the admin.
169169
1. `bucketAvailable`: if true the bucket has been provisioned. If false then the bucket has not been provisioned and is unable to be accessed.
170170

171171
#### Bucket
@@ -228,8 +228,9 @@ A `Bucket` is not deleted if it is bound to a `BucketRequest`.
228228
- "publicReadOnly": Read only, uncredentialed users can call ListBucket and GetObject.
229229
- "publicWriteOnly": Write only, uncredentialed users can only call PutObject.
230230
- "publicReadWrite": Read/Write, same as `ro` with the addition of PutObject being allowed.
231-
1. `bucketClassName`: Name of the associated bucket class.
232-
1. `bucketRequest`: an `objectReference` containing the name, namespace and UID of the associated `BucketRequest`.
231+
> Note: `anonymousAccessMode` is intended for workloads to consume the bucket out of band, i.e. COSI does not provide a automated mechanism for a k8s workload to consume the bucket anonymously
232+
1. `bucketClassName`: (set by COSI for greenfield, and ignored for brownfield) Name of the associated bucket class.
233+
1. `bucketRequest`: (set by COSI for greenfield, and ignored for brownfield) an `objectReference` containing the name, namespace and UID of the associated `BucketRequest`.
233234
1. `allowedNamespaces`: a list of namespaces that are permitted to either create new buckets or to access existing buckets.
234235
1. `protocol`: protocol-specific field the application will use to access the backend storage.
235236
- `name`: supported protocols are: "s3", "gs", and "azureBlob".
@@ -244,6 +245,8 @@ A `Bucket` is not deleted if it is bound to a `BucketRequest`.
244245

245246
An immutable, cluster-scoped, custom resource to provide admins control over the handling of bucket provisioning. The `BucketClass` (BC) defines a retention policy, driver specific parameters, and the provisioner name. A list of allowed namespaces can be specified to restrict new bucket creation and access to existing buckets. A default bucket class can be defined for each supported protocol. This allows the bucket class to be omitted from a `BucketRequest`. Relevant `BucketClass` fields are copied to the `Bucket` instance to handle the case of the BC being deleted or re-created. If an object store supports more than one protocol then the admin should create a `BucketClass` per protocol.
246247

248+
NOTE: the `BucketClass` object is immutable except for the field `isDefaultBucketClass`
249+
247250
```yaml
248251
apiVersion: cosi.io/v1alpha1
249252
kind: BucketClass
@@ -344,14 +347,17 @@ metadata:
344347
1. `bucketInstanceName`: name of the `Bucket` instance bound to this BA.
345348
1. `bucketAccessRequest`: an `objectReference` containing the name, namespace and UID of the associated `BucketAccessRequest`.
346349
1. `serviceAccount`: an `ObjectReference` containing the name, namespace and UID of the associated `BAR.serviceAccountName`. If empty then integrated Kubernetes -> cloud identity is not being used, in which case, `BucketAccess.principal` contains the user identity, which is minted by the provisioner.
347-
1. `mintedSecretName`: name of the provisioner-generated Secret containing access credentials. This Secret exists in the provisioner’s namespace, is read by the cosi-node-adapter, and written to the secret mount defined in the app pod's csi-driver spec.
350+
1. `mintedSecretName`: (omitted if serviceAccount is specified) name of the provisioner-generated Secret containing access credentials. This Secret exists in the provisioner’s namespace, is read by the cosi-node-adapter, and written to the secret mount defined in the app pod's csi-driver spec.
348351
1. `policyActionsConfigMapData`: encoded data, known to the driver, and defined by the admin when creating a `BucketAccessClass`. Contains a set of provisioner/platform defined policy actions to a given user identity. Contents of the ConfigMap that the *policyActionsConfigMap* field in the `BucketAccessClass` refers to. A sample value of this field could look like:
349352
```
350353
{“Effect”:“Allow”,“Action”:“s3:PutObject”,“Resource”:“arn:aws:s3:::profilepics/*“},
351354
{“Effect”:“Allow”,“Action”:“s3:GetObject”,“Resource”:“arn:aws:s3:::profilepics/*“},
352355
{“Effect”:“Deny”,“Action”:“s3:*“,”NotResource”:“arn:aws:s3:::profilepics/*“}
353356
```
354-
1. `principal`: username/access-key for the object storage provider to uniquely identify the user who has access to this bucket. This value is minted by the provisioner (and set in the BA) when the `BucketAccessRequest` omits a ServiceAccount. There several use cases involving `principal`: 1) static/driverless brownfield where the admin creates the BA and fills in principal, so here principal is minted by the admin. 2) brownfield where COSI creates the `BucketAccess` and fills in `principal` based on the driver's minted principal. 3) the `BucketAccessRequest` specifies a ServiceAccount which is linked by the backend to a user id, and `principal` is empty.
357+
1. `principal`: username/access-key for the object storage provider to uniquely identify the user who has access to this bucket. This value is minted by the provisioner (and set in the BA) when the `BucketAccessRequest` omits a ServiceAccount. There are several use cases involving `principal`:
358+
- Not relevant if serviceAccount is supplied.
359+
- For brownfield cases when there is already a storage-side principal that you want to use for access, the admin can supply this, the driver will (possibly) enable access for that principal to the bucket in question and will return credentials.
360+
- For greenfield cases, this could be populated by the driver. Maybe so that the driver can request deletion of this principal during deprovisioning
355361
1. `parameters`: A map of string:string key values. Allows admins to control user and access provisioning by setting provisioner key-values. Copied from `BucketAccessClass`.
356362
1. `accessGranted`: if true access has been granted to the bucket. If false then access to the bucket has not been granted.
357363

@@ -408,6 +414,12 @@ spec:
408414
1. the name of the cosi-node-adapter.
409415
1. information needed by the cosi-node-adapter to verify that the bucket has been provisioned.
410416

417+
The contents of the secret generated by the provisioner is expected to have the following fields in the provider specific format:
418+
419+
- Endpoint for the bucket. The Endpoint should encode the URL for the provider
420+
- Access Key: Only set when serviceAccount is empty
421+
- Secret Key: Only set when serviceAccount is empty
422+
411423
### Topology
412424

413425
![Architecture Diagram](images/arch.png)
@@ -423,7 +435,7 @@ Here we describe the workflows used to automate provisioning of new and existing
423435

424436
When the app pod is started, the kubelet will gRPC call _NodeStageVolume_ and _NodePublishVolume_, which are received by the cosi-node-adapter. The pod waits until the adapter responds to the gRPC requests. The adapter ensures that the target bucket has been provisioned and is ready to be accessed.
425437

426-
When the app pod terminates, the kubelet gRPC calls _NodeUnstageVolume_ and _NodeUnpublishVolume_, which the cosi-node-adapter also receives. The adapter orchestrates tear-down of bucket access resources, but does not delete the `BucketRequest` nor `Bucket` instances.
438+
When the app pod terminates, the kubelet gRPC calls _NodeUnstageVolume_ and _NodeUnpublishVolume_, which the cosi-node-adapter also receives. The adapter orchestrates tear-down of the ephemeral volume provisioned for this bucket.
427439

428440
General prep:
429441
+ admin creates the needed bucket classes and bucket access classes.

0 commit comments

Comments
 (0)