-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
kube2iam issues ...cannot assume role correctly in AWS SQS scaler in EKS #706
Comments
@ncrothe suggestions in Add AWS pod identity support
|
To clarify: This would be how to make it work in the current solution, due to needing two roles (or a self-referential). |
What would you suggest to have then @ncrothe? |
We've touched a bit on that in the discussion in #499 while I was trying to figure out what was going on. While there is some merit to splitting the permissions into multiple roles, which could be tuned according to individual "things to be scaled", I reckon the majority of users would prefer to simply set up a single pod role and be done with it. As far as I understand the current auth flow, there is some logic that always programatically assumes an explicitly configured IAM role (either via hard-coded credentials or the awsRoleArn), despite this not strictly being necessary in a kube2iam environment. Here, the AWS SDK could simply pick up and assume the role configured via kube2iam without any explicit logic needed. This is made possible with the default provider chain of the AWS SDK which looks for env vars, credentials file or instance profile (see https://docs.aws.amazon.com/sdk-for-go/v1/developer-guide/configuring-sdk.html#specifying-credentials) - with kube2iam hooking into the instance profile case. Thus my suggestion for kiam/kube2iam mode would be:
I was under the initial assumption that this was what aws-kiam was meant to do, which Zack corrected me on. In a perfect world we would also keep the current behaviour as optional for those edge cases (my assessment) where a more fine-grained, ScaledObject-specific permissions control is needed. |
Thanks for the input - We should make this easier indeed, thanks! |
Other observations... The annotations for using kube2iam are in the wrong location in helm chart package...
should be at the spec level in the deployment |
Sorry about that, missed that when reviewing kedacore/charts#27 Seems you're right. @tomkerkhove - can you fix that? |
Created kedacore/charts#35 for that and we are open for PRs. |
@tomkerkhove beat me by a few minutes :-) Check out kedacore/charts#36 |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 7 days if no further activity occurs. Thank you for your contributions. |
This issue has been automatically closed due to inactivity. |
Specifications
Having problems setting the SQS scaler up on a kubernetes cluster using kube2iam. We are using v 1.3.0.
Followed @ncrothe approach in Add AWS pod identity support
Get the following error in the keda-operator...
{"level":"debug","ts":1585482843.978178,"logger":"scalehandler","msg":"Error getting scale decision","ScaledObject.Namespace":"hydra-sbx1-mobilelogins", "ScaledObject.Name":"hydra-ingest-outbound-etl","ScaledObject.ScaleType":"deployment", "Error":"AccessDenied: User: arn:aws:sts::123456789123:assumed-role/k8s-keda/e7450c49-k8s-keda is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789123:policy/k8s-keda\n\n\tstatus code: 403,
kube2iam provides the role for the pod(uses the annotation)...so session should be available inside pod?
Any thoughts?
Looking at the code...it seems to use a different technique to consume the kiam/kube2iam role compared to other tools eg externaldns
aws_sqs_queue_scaler.go.
aws_iam_authorization.go
externaldns. ...uses session.NewSessionWithOptions
external-dns/provider/aws.go
The text was updated successfully, but these errors were encountered: