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
Copy file name to clipboardExpand all lines: keps/sig-storage/1979-object-storage-support/README.md
+20-8Lines changed: 20 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -163,9 +163,9 @@ status:
163
163
1. `finalizers`: added by COSI to defer `BucketRequest` deletion until backend deletion succeeds.
164
164
1. `protocol.name`: (required) specifies the desired protocol. One of {“s3”, “gs”, or “azureBlob”}.
165
165
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.
169
169
1. `bucketAvailable`: if true the bucket has been provisioned. If false then the bucket has not been provisioned and is unable to be accessed.
170
170
171
171
#### Bucket
@@ -228,8 +228,9 @@ A `Bucket` is not deleted if it is bound to a `BucketRequest`.
228
228
- "publicReadOnly": Read only, uncredentialed users can call ListBucket and GetObject.
229
229
- "publicWriteOnly": Write only, uncredentialed users can only call PutObject.
230
230
- "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`.
233
234
1. `allowedNamespaces`: a list of namespaces that are permitted to either create new buckets or to access existing buckets.
234
235
1. `protocol`: protocol-specific field the application will use to access the backend storage.
235
236
- `name`: supported protocols are: "s3", "gs", and "azureBlob".
@@ -244,6 +245,8 @@ A `Bucket` is not deleted if it is bound to a `BucketRequest`.
244
245
245
246
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.
246
247
248
+
NOTE: the `BucketClass` object is immutable except for the field `isDefaultBucketClass`
249
+
247
250
```yaml
248
251
apiVersion: cosi.io/v1alpha1
249
252
kind: BucketClass
@@ -344,14 +347,17 @@ metadata:
344
347
1. `bucketInstanceName`: name of the `Bucket` instance bound to this BA.
345
348
1. `bucketAccessRequest`: an `objectReference` containing the name, namespace and UID of the associated `BucketAccessRequest`.
346
349
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.
348
351
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:
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
355
361
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`.
356
362
1. `accessGranted`: if true access has been granted to the bucket. If false then access to the bucket has not been granted.
357
363
@@ -408,6 +414,12 @@ spec:
408
414
1. the name of the cosi-node-adapter.
409
415
1. information needed by the cosi-node-adapter to verify that the bucket has been provisioned.
410
416
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
+
411
423
### Topology
412
424
413
425

@@ -423,7 +435,7 @@ Here we describe the workflows used to automate provisioning of new and existing
423
435
424
436
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.
425
437
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.
427
439
428
440
General prep:
429
441
+ admin creates the needed bucket classes and bucket access classes.
0 commit comments