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

🌱 Tag S3 bucket as owned by cluster #4518

Merged
merged 1 commit into from
Oct 10, 2023

Conversation

AndiDog
Copy link
Contributor

@AndiDog AndiDog commented Sep 26, 2023

What type of PR is this?

/kind feature

What this PR does / why we need it:

I noticed that the S3 bucket isn't tagged. Some companies use AWS tags for grouping resources, calculating costs, or to clean up accidental remainders of clusters that CAPI/CAPA couldn't delete after a misconfiguration. With this change, the bucket is tagged as belonging to the cluster.

I'm not entirely sure if there's a use case where people provide a shared S3 bucket. In the S3 service code, there's such a hint in a TODO. For that case, we would need to introduce AWSCluster.spec.s3Bucket.additionalTags where users can set sigs.k8s.io/cluster-api-provider-aws/cluster/...=shared. And the implementation should be changed to only upsert tags instead of overwriting them, given that multiple AWSCluster objects could reconcile the same bucket. Let me know if that's a supported use case.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):

n/a

Checklist:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Release note:

Tag S3 bucket as owned by the cluster

@k8s-ci-robot k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-priority size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 26, 2023
Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

One question, rest LGTM

ClusterName: s.scope.Name(),
Lifecycle: infrav1.ResourceLifecycleOwned,
Name: nil,
Role: aws.String("node"),
Copy link
Member

Choose a reason for hiding this comment

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

Is this a common role?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe I misunderstand the question. Do you mean to rather use "common" (CommonRoleTagValue) as we do for VPC, gateways and such? I used "node" because the bucket seems only used for bootstrapping purposes and therefore relates to nodes, similar to how ASGs are tagged, for example.

@vincepri
Copy link
Member

vincepri commented Oct 9, 2023

/retitle 🌱 Tag S3 bucket as owned by cluster

@k8s-ci-robot k8s-ci-robot changed the title Tag S3 bucket as owned by cluster 🌱 Tag S3 bucket as owned by cluster Oct 9, 2023
@vincepri
Copy link
Member

/retest

Copy link
Member

@vincepri vincepri left a comment

Choose a reason for hiding this comment

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

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 10, 2023
@vincepri
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: vincepri

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 Oct 10, 2023
@k8s-ci-robot k8s-ci-robot merged commit 0abb2b0 into kubernetes-sigs:main Oct 10, 2023
12 checks passed
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/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. needs-priority release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants