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

disk: add tags to ECS snapshot #905

Merged
merged 3 commits into from
Jan 31, 2024

Conversation

huww98
Copy link
Contributor

@huww98 huww98 commented Oct 26, 2023

What type of PR is this?

/kind feature
/kind design

What this PR does / why we need it:

Automatically add 3 more tags to every ECS snapshot:

  • ack.aliyun.com: current ACK cluster ID
  • csi.alibabacloud.com/snapshot/name
  • csi.alibabacloud.com/snapshot/namespace

Also allow users to add custom tags.
User should specify "snapshotTags/tagKey: tagValue" in VolumeSnapshotClass to add tag "tagKey: tagValue". This design allows arbitrary keys and values, compared with the design of disk tags, which does not allow "," in key or value, or ":" in key.

If this design works fine, we can also implement this on disk tags.

Which issue(s) this PR fixes:

Fixes #900

Special notes for your reviewer:

Does this PR introduce a user-facing change?

3 more tags are added to every new ECS snapshot:
- ack.aliyun.com: current ACK cluster ID
- csi.alibabacloud.com/snapshot/name
- csi.alibabacloud.com/snapshot/namespace
You can also add custom tag "tagKey: tagValue" by specifying "snapshotTags/tagKey: tagValue" in VolumeSnapshotClass.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. kind/design Categorizes issue or PR as related to design. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 26, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @huww98. Thanks for your PR.

I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Oct 26, 2023
@huww98 huww98 changed the title Disk snapshot tags disk: add tags to ECS snapshot Oct 26, 2023
@huww98
Copy link
Contributor Author

huww98 commented Oct 26, 2023

@shusaan How do you like this design?

@huww98 huww98 force-pushed the disk-snapshot-tags branch 2 times, most recently from 620ee91 to 13fadfc Compare October 26, 2023 07:32
@shusaan
Copy link

shusaan commented Oct 26, 2023

@shusaan How do you like this design?
Thank you for this.

it is good just for confirm it will support multiple custom tags, like

SnapshotTags: "team:dev,user:david"

@huww98
Copy link
Contributor Author

huww98 commented Oct 26, 2023

it is good just for confirm it will support multiple custom tags, like

SnapshotTags: "team:dev,user:david"

@shusaan with current design, this is written as:

snapshotTags/team: dev
snapshotTags/user: david

@shusaan
Copy link

shusaan commented Oct 26, 2023

it is good just for confirm it will support multiple custom tags, like
SnapshotTags: "team:dev,user:david"

@shusaan with current design, this is written as:

snapshotTags/team: dev
snapshotTags/user: david

This one is good but one suggestion, i think if you apply this pattern SnapshotTags: "team:dev,user:david" then it is same as disk tags and tags property will be same for disk and snapshot as well.
ref link,
https://github.com/kubernetes-sigs/alibaba-cloud-csi-driver/blob/master/examples/disk/diskTags/storageclass.yaml

@huww98
Copy link
Contributor Author

huww98 commented Oct 26, 2023

Yes, I'm aware of the diskTags. but that home-made syntax does not have proper escape mechanism. i.e., we have no way to specify tag user: "david,bob". To avoid such corner cases, I made this new design, leaving all the escaping to standard yaml parser. I think this is simpler for users and more future-proof.

If this look OK to @mowangdk , I will also implement this on StorageClass.

There are many paramters. Avoid modify every call site if we have even more.
Split it into paramter and annotation part. Better error reporting.
And prepare for custom tags feature.
Automatically add 3 more tags to every ECS snapshot:
- ack.aliyun.com: current ACK cluster ID
- csi.alibabacloud.com/snapshot/name
- csi.alibabacloud.com/snapshot/namespace

Also allow users to add custom tags.
User should specify "snapshotTags/tagKey: tagValue" in VolumeSnapshotClass to
add tag "tagKey: tagValue".  This design allows arbitrary keys and values.
Compared with the design of disk tags, which does not allow "," in key or
value, or ":" in key.

If this design works fine, we can also implement this on disk tags.
@shusaan
Copy link

shusaan commented Oct 30, 2023

@mowangdk any ETA for this please?

@shusaan
Copy link

shusaan commented Nov 16, 2023

@mowangdk any update please

@mowangdk
Copy link
Contributor

@mowangdk any update please

we have got a large pr ready to merge , this pr will merged after that. and it may have an impact on the existing logic, and we'll probably merge it around January of next year.

@shusaan
Copy link

shusaan commented Jan 31, 2024

@mowangdk any update please

@mowangdk
Copy link
Contributor

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 31, 2024
@mowangdk
Copy link
Contributor

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jan 31, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: huww98, mowangdk

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

The pull request process is described 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 the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 31, 2024
@k8s-ci-robot k8s-ci-robot merged commit 659f8b2 into kubernetes-sigs:master Jan 31, 2024
7 checks passed
@shusaan
Copy link

shusaan commented Jan 31, 2024

Thank you @mowangdk can you please share expected release of this.

@huww98 huww98 deleted the disk-snapshot-tags branch March 8, 2024 03:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/design Categorizes issue or PR as related to design. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

VolumeSnapshotClass tags
4 participants