-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Master IAMRolePolicy too long with long cluster names. #12606
Comments
Note: while this gives the same result as #12558 - it's not the same problem, we are not using additional inline permissions for our own policy additions, we use managed policies for this - our configuration is failing based purely on addons being turned on with a long cluster name |
I agree we should put addons in their own policy(s). There is a limit of 10 (increasable to 20) attached IAM policies per IAM role so we'll need to be cognizant of that. We could start with all addons being in one separate policy which should be sufficient for now given that the control plane policy itself is fairly large. IRSA is another valid workaround and IMO the solution we should be encouraging here, given that each (addon) service account has its own IAM role and policy. |
This bug was filed against kops 1.21. Can you try 1.22.1? |
@olemarkus - same with 1.22.1 |
1.22 have a test that specifically captures this. The cluster name is not that long in that test, but the margin is fairly large. Using 1.22.1, it would be interesting how your policy differs from the one above. The one above is just shy of 8k, and the max policy size is 10k. So with regards to cluster name, there should be a decent margin indeed. |
@olemarkus - is there a way for me to get the resultant policy ? the dry run is showing me the diff of changes it's trying to make, but not the complete document |
Your best bet might be to run |
Or run with terraform output, which would leave a policy locally with similar location and name |
I am also getting hit by this issue, the worst part is anytime i edit the cluster configuration. It doesn't change the error message. It always seems to be 11224 bytes. The issue happens regardless of whether i have an inline policy or not. |
Hey. Same as above, we'd need the generated policy to be able to investigate this further. |
Not sure if this is the correct policy, it doesn't seem to be 11224 bytes. i changed all the details in the policy so they don't reflect my actual setup. However i made sure to keep the same character count. Seems like the most appropriate based on the error message:
This was exported using aws_iam_role_policy_masters.kubernetes.example1234.dev_policy
|
Hi, apologies for the slow response here, my https://gist.github.com/BenWolstencroft/bb15bc888c92893facd97006fad49c53 I've redacted as much sensitive information as I could find in the log. |
@olemarkus @rifelpet @mattoz0 - I've had some success here - looking through the logs it appears as though the issue is not when trying to write a new IAMRolePolicy, but when trying to read back the current one to establish the current state / generate a change! I modified the contents of the current inline policy via the aws console to just have a single Action *, Resources * (dangerous i know, but i needed a policy that would work, and was short), then reran the |
Yes that lines up with the originally reported error message |
/kind bug
1. What
kops
version are you running?1.21.2
2. What Kubernetes version are you running?
1.21.4
3. What cloud provider are you using?
AWS
4. What commands did you run? What is the simplest way to reproduce this issue?
kops update cluster --yes
5. What happened after the commands executed?
IAMRolePolicy/. Example error: error reading actual policy document: policy size was 11655. Policy cannot exceed 10240 bytes.
6. What did you expect to happen?
Update to succeed
7. Please provide your cluster manifest.
9. Anything else do we need to know?
I believe that this is due to a combination of the number of addons we have enabled, and the length of the cluster name, the cluster name is included in many of the policies to limit the resources that the permissions are granted against.
We have an identical cluster with a shorter name (40 characters long) which works (vs 43 characters, which fails)
Maybe to prevent addons growing the base policy would be to separate policies for addons out onto their own policy?
The text was updated successfully, but these errors were encountered: