aws-load-balancer-controller: Failing to create target group with default policy
Describe the bug The controller is failing to create a target group based on the provided policy.
User: arn:aws:sts::123:assumed-role/AWSALBIngressController_3f2bb898eae5ea79ebdb9cb3514f5ec6/1655374570081000102 is not authorized to perform: elasticloadbalancing:AddTags on resource: arn:aws:elasticloadbalancing:us-west-2:123:targetgroup/foo/*
This error occurs after trying to create the target group and before reconciliation.
Based on my understanding of the policy, AddTags requires a null cluster tag in the request but also requires a non-null resource tag. I’m not sure how that can be possible during target group creation. Especially since the request has the cluster tag and presumably the target group has no tags on creation.
Steps to reproduce
Expected outcome The target group should be created with expected tags
Environment
- AWS Load Balancer controller version 2.2.3
- Kubernetes version v1.17.12-eks-7684af
- Using EKS (yes/no), if so version? yes, v1.17.12-eks-7684af
Additional Context:
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 21
- Comments: 37
Commits related to this issue
- Fix aws loadbalancer iam policy use fix suggested here: https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/2692#issuecomment-1160444064 — committed to pluralsh/plural-artifacts by michaeljguarino a year ago
- Fix aws loadbalancer iam policy (#522) use fix suggested here: https://github.com/kubernetes-sigs/aws-load-balancer-controller/issues/2692#issuecomment-1160444064 — committed to pluralsh/plural-artifacts by michaeljguarino a year ago
- update recommended IAM policy template (#3068) — committed to kubernetes-sigs/aws-load-balancer-controller by jdn5126 a year ago
For anyone who got this issue and suddently see it works, you might be able to check if there is any message is detected in your AWS Health Dashboard to allow you still can use deprecating policy to create target groups.
To make sure you won’t be impacted by this API change, please make sure you are applying the latest IAM Policy [1] for your controller. Your policy generally needs to include:
If you still have any issue, feel free to open a technical support case in account basis.
Hope this helps!
[1] https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/install/iam_policy.json
This is due to recent behavior change on the requirement of explicit
elasticloadbalancing:AddTagspermission for create resources, and potentially affect new AWS accounts. Please add the following additional IAM policies if you encounter this error:We will update our recommended policies and documentation.
ELB team have temporarily rolled back their change regards IAM permissions
We also just started seeing this issue today. Using v2.4.4 (via helm chart v1.4.5) on EKS 1.23 We installed 1 cluster and it worked as expected. Then we installed a second and third cluster and it was failing with the AccessDenied error.
Removing the
Conditionblock allowed the ALB Controller to function again. This is so strange because this has been working for us for literally months and this is the first time we’ve run into it.We’ve also run into that issue Today. Surprisingly that happened to only one of our clusters that was running fine for over 4 months. We are currently using EKS 1.22 and aws-lb-controller v2.4.2 (we tried also to update to v2.4.6, it didn’t help though). Only a cluster in ap-northeast-1 is affected.
Event record
For now we have set up
elasticloadbalancing:AddTagswithout restrictions.The same problems occurs on
Cluster 1.24eks.4alb 2.4.6.It works if only
aws:RequestTag/elbv2.k8s.aws/clusterline is removed, but this seems like a temporary solution.Hopefully there will be a quick update. 🥲
The above policy change does not work for me unless I also add
CreateListenerto theelasticloadbalancing:CreateActionlist.Versions: aws-load-balancer-controller v2.4.1, EKS 1.22
Same for me here:
EKS 1.24andaws-load-balancer-controller 2.4.2I’ll remove the
Conditionblock temporary.We’re having the same issue with a new cluster running kubernetes 1.24 and aws-load-balancer-controller 2.4.6 with the policy from https://raw.githubusercontent.com/kubernetes-sigs/aws-load-balancer-controller/main/docs/install/iam_policy.json.
Following for advice.
My EKS version is 1.20 (not fresh, but upgraded from 1.15 -> 1.16 -> 1.17 -> 1.18 -> 1.19 -> 1.20) with ALB Ingress Controller v 1.1.5.
When upgrading it to:
AWS Load Balancer Controller v2.3.1 No error with the default IAM policy of the alb controller. So, I will keep this version for my environment.
AWS Load Balancer Controller v2.4.2 I had to apply @croachrose’s workaround to get rid of the error.
Below didn’t work either.
@berry2012 It’s almost like AWS changed the implementation of
CreateTargetGroupto invokeAddTagsif tags are part of the request. In that case,aws:ResourceTag/elbv2.k8s.aws/clusteris null andaws:RequestTag/elbv2.k8s.aws/clusteris not null.The same problem is stil exists, eks 1.27 & AWS lb controller 2.6.2 Removing “conditions” works.
Same issue as described above, only one of ap-southeast-1 clusters affected, happed for the first time today.
aws-load-balancer-controller v2.4.4 EKS 1.24, Platform version eks.3
Policy attached to the role
event with error
@berry2012 Any idea what is different about our environment? Is it the controller version? For what it’s worth, this was working just fine and we changed nothing. It just stopped working suddenly.