-
-
Notifications
You must be signed in to change notification settings - Fork 4.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
Add example for IRSA and cluster-autoscaler #710
Add example for IRSA and cluster-autoscaler #710
Conversation
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.
👏 ❤️
Comments suggesting things to delete to remove distractions 😄
examples/irsa/README.md
Outdated
kubectl -n kube-system create serviceaccount tiller | ||
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller | ||
helm init --service-account=tiller |
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 please can fresh examples use Helm 3? No more tiller!
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.
Maybe we can omit tiller installation. And add note that we must have a working helm installation. Because, it's not relevant here.
I personally use terraform with helm provider to perform cluster-autoscaler installation during my cluster setup. But it doen't matter how we install it. What we need for the serviceaccount is here https://github.com/terraform-aws-modules/terraform-aws-eks/pull/710/files#diff-5d3e96c50e09c013f8553243cb0be4d6R3-R6
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.
I agree 100%. I just haven't used Helm 3 yet 😢
I'll redo next week with Helm 3. I need to it this anyway!
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.
Maybe we can omit tiller installation.
OK good input. I'll remove that part. But I'll keep the helm install
command for the chart. Is it same for Helm 3?
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.
yep.
@barryib do you know why the |
Nope. But even the |
@max-rocket-internet
|
OK cool. Next week I'll have a look. I think we should also remove the |
cluster_name = local.cluster_name | ||
subnets = module.vpc.private_subnets | ||
vpc_id = module.vpc.vpc_id | ||
enable_irsa = true |
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.
If I'm not mistaken, using IRSA on cluster-autoscaler, it would be good to add these flags to the cluster variables:
# module no longer needs to manage autoscaling policy since this is moved to the service-account IAM role
manage_worker_autoscaling_policy = false
attach_worker_autoscaling_policy = 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.
You are not mistake but I think we just remove the autoscaling policy stuff completely and let users manage that themselves.
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.
May I suggest: Leave the policy stuff in but change default enabled to false
in next release (and ofc. mention in release notes). Then remove in subsequent release.
This would allow users to somewhat seamlessly transition to IRSA, without needing to temporary bolt on additional policies.
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.
@TBeijen actually we already have var.attach_worker_autoscaling_policy
/var.manage_worker_autoscaling_policy
. I'll just make a PR to set these to default of false
.
.pre-commit-config.yaml
Outdated
@@ -1,6 +1,6 @@ | |||
repos: | |||
- repo: git://github.com/antonbabenko/pre-commit-terraform | |||
rev: v1.22.0 | |||
rev: v1.24.0 |
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.
@max-rocket-internet please change args into args: ["--args=--with-aggregate-type-defaults", "--args=--no-escape"]
OK I have:
Please re-review @barryib @dpiddockcmp @TBeijen 🚀 |
Can you please update your branch and upgrade to terraform-docs 0.8.1 ? |
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.
This looks good to me
examples/irsa/main.tf
Outdated
|
||
data "aws_caller_identity" "current" {} | ||
|
||
resource "random_string" "suffix" { |
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.
Is this resource used anywhere?
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.
Thanks. I've removed it.
@barryib done rebase. Thanks for fixing the pre-commit stuff |
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.
Looks fine. As mentioned in the other PR: Makes sense also to not have 2 releases with breaking changes, so unlike what I suggested, ditching all references to manage autoscaling looks good.
@max-rocket-internet : Curious as to what is the reason to use |
worker_groups is the classic unmanaged way of doing things and allows you to use spot instances and provide kubelet args. I believe either will work with irsa. |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
PR o'clock
Description
Many people have requested an example using IRSA (IAM Roles for Service Accounts). So here I am adding an example for the cluster-autoscaler.
Checklist