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

Add_missing_permissions for ClusterAutoScaler on AWS #4586

Closed

Conversation

raphaelIl
Copy link

@raphaelIl raphaelIl commented Jan 9, 2022

Which component this PR applies to?

cluster-autoscaler

What type of PR is this?

/kind documentation

What this PR does / why we need it:

I have found that at least some of the permissions are missing to deployed with ClusterAutoScaler

Special notes for your reviewer:

If you don't have permission, this error will occur

E0107 12:41:18.399807       1 aws_manager.go:265] Failed to regenerate ASG cache: cannot autodiscover ASGs: AccessDenied: User: arn:aws:sts::xxx:assumed-role/xxxdev-role/i-00e02057dcf6619ae is not authorized to perform: autoscaling:DescribeTags because no identity-based policy allows the autoscaling:DescribeTags action
	status code: 403, request id: afe418c9-099d-474c-a302-961b2247697d
F0107 12:41:18.399830       1 aws_cloud_provider.go:389] Failed to create AWS Manager: cannot autodiscover ASGs: AccessDenied: User: arn:aws:sts::xxx:assumed-role/xxxdev-role/i-00e02057dcf6619ae is not authorized to perform: autoscaling:DescribeTags because no identity-based policy allows the autoscaling:DescribeTags action
	status code: 403, request id: afe418c9-099d-474c-a302-961b2247697d

@k8s-ci-robot
Copy link
Contributor

Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA.

It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.


  • If you've already signed a CLA, it's possible we don't have your GitHub username or you're using a different email address. Check your existing CLA data and verify that your email is set on your git commits.
  • If you signed the CLA as a corporation, please sign in with your organization's credentials at https://identity.linuxfoundation.org/projects/cncf to be authorized.
  • If you have done the above and are still having issues with the CLA being reported as unsigned, please log a ticket with the Linux Foundation Helpdesk: https://support.linuxfoundation.org/
  • Should you encounter any issues with the Linux Foundation Helpdesk, send a message to the backup e-mail support address at: [email protected]

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.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jan 9, 2022

CLA Signed

The committers 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 Jan 9, 2022
@k8s-ci-robot
Copy link
Contributor

Welcome @raphael1021!

It looks like this is your first PR to kubernetes/autoscaler 🎉. 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/autoscaler 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 size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. label Jan 9, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: raphael1021
To complete the pull request process, please assign jeffwan after the PR has been reviewed.
You can assign the PR to them by writing /assign @jeffwan in a comment when ready.

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

@raphaelIl raphaelIl changed the title Add_missing_permissions Add_missing_permissions for ClusterAutoScaler on AWS Jan 9, 2022
@@ -31,6 +31,7 @@ The following policy provides the minimum privileges necessary for Cluster Autos
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
Copy link
Author

@raphaelIl raphaelIl Jan 9, 2022

Choose a reason for hiding this comment

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

If you don't have permission, this error will occur

E0107 12:41:18.399807       1 aws_manager.go:265] Failed to regenerate ASG cache: cannot autodiscover ASGs: AccessDenied: User: arn:aws:sts::xxx:assumed-role/xxxdev-role/i-00e02057dcf6619ae is not authorized to perform: autoscaling:DescribeTags because no identity-based policy allows the autoscaling:DescribeTags action
	status code: 403, request id: afe418c9-099d-474c-a302-961b2247697d
F0107 12:41:18.399830       1 aws_cloud_provider.go:389] Failed to create AWS Manager: cannot autodiscover ASGs: AccessDenied: User: arn:aws:sts::xxx:assumed-role/xxxdev-role/i-00e02057dcf6619ae is not authorized to perform: autoscaling:DescribeTags because no identity-based policy allows the autoscaling:DescribeTags action
	status code: 403, request id: afe418c9-099d-474c-a302-961b2247697d

@raphaelIl
Copy link
Author

/retest

@k8s-ci-robot
Copy link
Contributor

@raphael1021: Cannot trigger testing until a trusted user reviews the PR and leaves an /ok-to-test message.

In response to this:

/retest

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.

@raphaelIl
Copy link
Author

/check-cla

@gjtempleton
Copy link
Member

/area provider/aws
/assign @gjtempleton

Hey, thanks for the PR,
The use of autodiscovery by tags, and the requirement to add the permission for autoscaling:DescribeTags is already covered in the sentence immediately following the snippet you're modifying. If anything I'd rather be more explicit and provide two snippets:

  1. The minimum permissions required to run the CA in AWS with a hardcoded list of ASGs
  2. The minimum permissions required to run the CA in AWS with ASG autodiscovery

@k8s-ci-robot k8s-ci-robot added the area/provider/aws Issues or PRs related to aws provider label Jan 10, 2022
@raphaelIl
Copy link
Author

Thank you for your kind explanation.
I should have looked at the document more closely.
Should I close this PR?

@gjtempleton
Copy link
Member

I think you're surfacing a valid point that that portion of the docs as it is isn't the easiest to parse for users, as this is the second time someone's proposed something similar.

There's also the fact we should be more explicit about recommending users restrict the "Resource": ["*"] condition down, so I think that portion needs more significant reworking in general to both be clear to users as well as nudge them towards best practice.

Feel free to close this PR if you don't want to rework it, and I can have a look and ask for you to have a look, or if you want to rework this to try and address that, you're more than welcome to.

@raphaelIl raphaelIl closed this Jan 11, 2022
@raphaelIl raphaelIl deleted the Add_missing_permissions branch January 11, 2022 11:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/cluster-autoscaler area/provider/aws Issues or PRs related to aws provider cncf-cla: no Indicates the PR's author has not signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants