-
-
Notifications
You must be signed in to change notification settings - Fork 355
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
Proper management of aws auth config map #157
Proper management of aws auth config map #157
Conversation
Pulling in @Nuru since he's got strong opinions in this area of the code (and rightfully so 👍) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebastianmacarescu Thank you very much for this PR.
My apologies if I said something misleading, but I really want to avoid using remote state in this module. My hope was that the kubernetes_config_map_v1_data
resource would remove the need for referencing remote state by merging the EKS created roles with the customer roles.
Let's discuss this in Slack.
auth.tf
Outdated
force = true | ||
|
||
# This fails because the eks managed node group changes the ownership of the mapRoles in configMap if deployed separately | ||
# vpcLambda is the sole owner of it so apply again resets it | ||
# Force true will overwrite the node group role | ||
//force = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain this further.
This pull request is now in conflict. Could you fix it @sebastianmacarescu? 🙏 |
69ad4a0
to
084ffbb
Compare
@Nuru I have refactored this:
This seems to work a lot better and is a lot cleaner. As for this issue: hashicorp/terraform-provider-kubernetes#1671 (comment) |
Are there plans to merge this? |
@stevec-aztech This was completely on hold pending resolution of hashicorp/terraform-provider-aws#25335 @sebastianmacarescu I really do appreciate the effort you have put into this. How much and what kind of testing have you done on it? Just looking at it makes me scared, particularly with the regular expressions, as those have a way of causing hard-to-find bugs and security vulnerabilities. What size are the strings you have been storing in parameter store? I would like to know where the breaking point is, as some people have added a lot of roles to their auth map. Plus I'm always worried about the I really am looking forward to AWS giving us a proper API for the auth map and we could end all these workarounds. |
So I have spent some time to realistically generate some big map_aditional_iam_roles for the config map as this is the only stuff I store in AWS Paramter Store. The maximum size of the parameter value for Advanced Tier in AWS SSM Parameter Store is 8KB as can be seen HERE. The current implementation allows for around 30 roles. But we can use base64gzip on the json data and we will get to around 60 roles. Plus we can get rid of those regexes and be a lot safer. For who wants to play the python code to generate a random dataset (really long values for the iam role name, group names and usernames that most won't have) is:
Some output:
Also I'm running the current code in production EKS cluster and works just fine as it is, with around 8 aditional iam roles in the config map. If you think this can be merged I can simplify the code and use base64gzip to eliminate those hard to understand regexes, plus increasing the number of extra iam roles. Also I can add a note in the doumentation and possibly terraform parameter validation. |
@sebastianmacarescu Thank you for this extra effort.
We have other issues with using remote state triggering Terraform bugs, so yes, if you can use Also, we want to change the version pinning to be |
Hi @Nuru , |
9e6e5e1
to
cf8a404
Compare
Hi @Nuru. Can you review the new changes?
This new implementation will allow us to store around 180 IAM roles specified in the terraform configuration. I have tested with both terraform create, update, add and remove iam roles from the config map and it works great. Also there is no gunzip in terraform so storing the json string as gzip compressed base64 would not work: hashicorp/terraform#22568 |
…tianmacarescu/terraform-aws-eks-cluster into feature/manage-aws-auth-config-map
Guys, any progress on this one? |
This pull request now has conflicts. Could you fix it @sebastianmacarescu? 🙏 |
This PR has been closed due to inactivity and merge conflicts. |
Thanks @sebastianmacarescu for creating this pull request! A maintainer will review your changes shortly. Please don't be discouraged if it takes a while. While you wait, make sure to review our contributor guidelines. Tip Need help or want to ask for a PR review to be expedited?Join us on Slack in the |
what
why
Mainly the reasons from #155.
references
*closes #155