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

Issue# 306: Added tagging controller #308

Merged
merged 42 commits into from
Mar 30, 2022

Conversation

nguyenkndinh
Copy link
Contributor

@nguyenkndinh nguyenkndinh commented Feb 24, 2022

What type of PR is this?
/kind feature

What this PR does / why we need it: This is the first in the series for creating a tagging controller to tag resources that join or leave a cluster for better cost estimation. This PR creates a skeleton for the upcoming tagging controller so that more details can be added in subsequent PRs.

Which issue(s) this PR fixes:
#306

Special notes for your reviewer:
Tested in an EC2 instance using local-up-cluster.sh, and checking /tmp/cloud-controller-manager.log to see if the controller was initialized.

Does this PR introduce a user-facing change?:
NONE

NONE

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 24, 2022
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Feb 24, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. label Feb 24, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @nguyenkndinh!

It looks like this is your first PR to kubernetes/cloud-provider-aws 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/cloud-provider-aws has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Feb 24, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @nguyenkndinh. Thanks for your PR.

I'm waiting for a kubernetes 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 Feb 24, 2022
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Feb 24, 2022
Copy link
Contributor

@nckturner nckturner left a comment

Choose a reason for hiding this comment

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

Good start. Let's also add a separate docs/controllers.md which gives some background information.

* Remove route controller again

* Print out clusterName for new nodes

* tag new nodes when it comes online

* only process a node once

* check taggNodes size

* add debugging

* use node name as key

* delete k,v from taggedNodes if node no longer exists

* log if delete is done

* Get a list of nodes and tag them if havent

* get instance IDs of the nodes that need tagging

* use MapToAWSInstanceID instead

* restored v1 aws

* restored from master

* tag instance with a random tag

* add klog

* tag and untag node resources

* Prepare for pr

* Initialize nodeMap
@k8s-ci-robot k8s-ci-robot removed the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Mar 29, 2022
@nckturner
Copy link
Contributor

Last thing that would be extremely beneficial is an E2E job which just creates a single tag and checks for its existence.

@nguyenkndinh
Copy link
Contributor Author

@nckturner regarding #308 (comment), could you pls advise how I can do that?

@nckturner
Copy link
Contributor

nckturner commented Mar 29, 2022

@nckturner regarding #308 (comment), could you pls advise how I can do that?

Yeah just create file similar to the loadbalancer test: https://github.com/kubernetes/cloud-provider-aws/blob/master/tests/e2e/loadbalancer.go

@nckturner
Copy link
Contributor

We will add an e2e test after we figure out how to pass the tagging controller's flags to kops (currently arbitrary tags are not supported, so only a subset of recognized ccm flags can be passed). We are also taking a todo on handling non-retry-able errors correctly, i.e. avoiding a situation where a tag is improperly formatted and the controller spams the createTag API forever. Can you create an issue in this repository @nguyenkndinh?

/lgtm

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nckturner, nguyenkndinh, saurav-agarwalla

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 Mar 30, 2022
@k8s-ci-robot k8s-ci-robot merged commit 8d2f0fd into kubernetes:master Mar 30, 2022
@nguyenkndinh
Copy link
Contributor Author

nguyenkndinh commented Mar 30, 2022

@nckturner Thanks for your feedbacks. I've created the following issue to track the remaining TODOs: #325

nckturner added a commit that referenced this pull request May 12, 2022
…34: Stop retrying failed workitem after a certain amount of (#357)

* Add tagging controller
* Stop retrying failed workitem after a certain amount of retries Added metrics
* Changes to make tagging controller compatible with K8s 1.22

Co-authored-by: Nguyen Dinh <[email protected]>
Co-authored-by: Nicholas Turner <[email protected]>
nckturner added a commit that referenced this pull request May 12, 2022
…34: Stop retrying failed workitem after a certain amount of (#358)

* Add tagging controller
* Stop retrying failed workitem after a certain amount of retries Added metrics
* Changes to make tagging controller compatible with K8s 1.21

Co-authored-by: Nguyen Dinh <[email protected]>
Co-authored-by: Nicholas Turner <[email protected]>
k8s-ci-robot added a commit that referenced this pull request May 31, 2022
…f-#308-#334-#387-upstream-release-1.23

Automated cherry pick of #308: Add tagging controller configuration
#334: Stop retrying failed workitem after a certain amount of
#387: Fix issues in tagging controller
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note-none Denotes a PR that doesn't merit a release note. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants