Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cosi v1alpha2 changes #4599

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

BlaineEXE
Copy link

  • One-line PR description: modify doc to reflect v1alpha2 changes discussed in working COSI working group.
  • Other comments:

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 25, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: BlaineEXE
Once this PR has been reviewed and has the lgtm label, please assign saad-ali for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 25, 2024
@BlaineEXE BlaineEXE force-pushed the cosi-v1alpha2-changes branch 3 times, most recently from d22d1bd to 511d6cc Compare April 25, 2024 22:01
Comment on lines 221 to 222
<!-- TODO: make sure there is a mechanism to ensure that the user creating the BucketClaim has
access to the bucketclass -->
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xing-yang I am curious how other projects like VolumeSnapshotter handle situations like this.

How can the COSI controller check that the user (or namespace, or serviceaccount) has proper permissions to read/use the BucketClass?

Comment on lines -187 to -198
```
BucketClaim - bcl1 BucketClass - bc1
|------------------------------| |--------------------------------|
| metadata: | | deletionPolicy: delete |
| namespace: ns1 | | driverName: s3.amazonaws.com |
| spec: | | parameters: |
| bucketClassName: bc1 | | key: value |
| protocols: | |--------------------------------|
| - s3 |
|------------------------------|

```
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These block-style things seem like they must be created with a markdown tool that I don't know about. Since this is a non-standard tool, I am also going to replace all instances of these with simpler built-in markdown blocks like this:

    ```yaml
    apiVersion: objectstorage.k8s.io/v1alpha2
    kind: BucketClass
    metadata:
      name: silver
    spec:
      deletionPolicy: delete
      driverName: s3.amazonaws.com
      parameters:
        key: value
    ```

Comment on lines 464 to 487
###### Multi-protocol example with keys

<!-- TODO: what if one protocol supports IAM-style but not the other?
do we need auth type individually per-protocol?
do we advertize KEY if any don't support IAM? -->
<!-- TODO: is IAM an object-storage-wide term, or is it S3-specific?
Can we agree on a generic terminology, like type=ServiceAccount? -->
```yaml
apiVersion: v1
kind: Secret
metadata:
name: <BucketAccess.spec.credentialsSecretName>
namespace: <BucketAccess.metadata.namespace>
data:
COSI_BUCKET_NAME: bc-$uuid
COSI_AUTHENTICATION_TYPE: KEY
COSI_PROTOCOLS: Azure,S3
COSI_AZURE_ENDPOINT: https://blob.mysite.com
COSI_AZURE_ACCESS_TOKEN: AZURETOKENEXAMPLE
COSI_AZURE_EXPIRY_TIMESTAMP: 2006-01-02T15:04:05Z07:00
COSI_S3_ENDPOINT: https://s3.mysite.com
COSI_S3_ACCESS_KEY_ID: AKIAIOSFODNN7EXAMPLE
COSI_S3_ACCESS_SECRET_KEY: wJalrXUtnFEMI/K...
COSI_S3_REGION: us-west-1
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@shanduur here's the more complex version of what new secret might look like. Lmk if you have feedback.

Copy link
Member

@shanduur shanduur Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it! Little bit more data, and still has clear naming convention.

One more thing we should consider is Google Cloud Storage support. It is a valid value for the Protocols, yet there is no place for adding any credentials to secret for GCS.

  1. Do we want to continue to support GCS in the COSI spec?
  2. Do we need to consider additional fields for GCS, or do we leave it as?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm having some trouble with this as well. I have access to plenty of S3 experts via the Ceph project, and we have Akash involved from Azure, but we don't have any GCP experts. I wonder if we could somehow introduce a more plugin-like method that would allow different/new object storage interfaces to be defined but in a way that can't be abused. I'll try to think more about that.

Comment on lines 388 to 391
<!-- TODO: this example shows a problem that might arise from our current plan changes ...
what if a user mounts multiple buckets to the same pod?
they can refer to the secret fields individually, of course, and define unique names for each bucket's fields
but is that too much work? -->
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the PodSpec below, I am seeing what could be a complication for our plans to change the secret format.

If users have multiple sets of credentials, they will have to do manual work to make sure their config vars (mounted either as env vars, files, or whatever) don't overlap with each other.

At the end of the day, this is still something that k8s users have to be somewhat mindful of, so maybe it doesn't matter too much. But it's something to consider.

@shanduur I'm curious your thoughts

Copy link
Member

@shanduur shanduur Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion it is not different than the situation that happens now. If there are 2 secrets to be mounted, those will still have to be either renamed or mounted in different directories. I am in favour of the proposed design change with separate fields, as this collision can be easily avoided at the manifest level, without need for init containers or changes to application.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hello I'm trying to use a COSI s3 bucket within a tekton pipeline and this is what they have for awscli example https://github.com/tektoncd/catalog/tree/main/task/aws-cli/0.2

I could totally work with this enhancement as well because awscli takes ENV_VARS I can set in my containers from the ones exposed by the new design, old design is troublesome as it's json in a secret property

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Apr 25, 2024
@BlaineEXE BlaineEXE marked this pull request as draft April 25, 2024 23:27
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 25, 2024
@k8s-ci-robot
Copy link
Contributor

@BlaineEXE: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
pull-enhancements-verify 5aa494b link true /test pull-enhancements-verify

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

COSI has a few design changes to make which may involve some API
breakages. Update the current KEP with new design details, and update
the design spec to v1alpha2.

Signed-off-by: Blaine Gardner <blaine.gardner@ibm.com>
Comment on lines 843 to 844
// BucketClaimName is the name of the BucketClaim.
BucketClaimName string
Copy link
Member

@shanduur shanduur Apr 26, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some future thinking, reg. the single BucketAccess for multiple BucketClaims:

Suggested change
// BucketClaimName is the name of the BucketClaim.
BucketClaimName string
// BucketClaimReferences holds references to multiple BucketClaims,
// indicating which claims share this BucketAccess. This relationship allows
// for efficient management of access permissions across related BucketClaims.
BucketClaimReferences []*corev1.ObjectReference

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. This is a good idea. Before we started on v1alpha2, I was trying to see how we could accomplish this without API changes. But if we can modify the API, maybe it would be best. I'll think about this also, and probably include this suggestion. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/kep Categorizes KEP tracking issues and PRs modifying the KEP directory sig/storage Categorizes an issue or PR as relevant to SIG Storage. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants