Skip to content
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

CLD-8753: Add cluster-autoscaler #803

Merged
merged 1 commit into from
Jan 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions aws/eks-customer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
| [aws_eks_addon.kube_proxy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
| [aws_eks_addon.snapshot-controller](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/eks_addon) | resource |
| [aws_iam_policy.bifrost](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.cluster-autoscaler](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.external-secrets](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.node](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
| [aws_iam_policy.velero](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_policy) | resource |
Expand Down
2 changes: 1 addition & 1 deletion aws/eks-customer/irsa.tf
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
locals {
policies_by_name = {
for policy in concat(values(aws_iam_policy.bifrost), values(aws_iam_policy.velero), values(aws_iam_policy.external-secrets)) :
for policy in concat(values(aws_iam_policy.bifrost), values(aws_iam_policy.velero), values(aws_iam_policy.external-secrets), values(aws_iam_policy.cluster-autoscaler)) :
policy.name => policy
}
}
Expand Down
30 changes: 30 additions & 0 deletions aws/eks-customer/utility_policies.tf
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,33 @@ resource "aws_iam_policy" "external-secrets" {
}
EOF
}

resource "aws_iam_policy" "cluster-autoscaler" {
for_each = { for k, v in var.utilities : k => v if v.name == "cluster-autoscaler" }

name = "cluster-autoscaler-${module.eks.cluster_name}"
path = "/"
description = "Policy for cluster-autoscaler utility."

policy = <<EOF
{
"Statement": [
{
"Action": [
"autoscaling:DescribeAutoScalingGroups",
"autoscaling:DescribeAutoScalingInstances",
"autoscaling:DescribeLaunchConfigurations",
"autoscaling:DescribeTags",
"autoscaling:SetDesiredCapacity",
"autoscaling:TerminateInstanceInAutoScalingGroup",
"ec2:DescribeLaunchTemplateVersions",
"eks:DescribeNodegroup"
],
"Effect": "Allow",
"Resource": "*"
}
],
"Version": "2012-10-17"
}
EOF
}