Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
efb10c2
adding cas code
hemasenthil13 Jan 21, 2026
8633020
adding permission
hemasenthil13 Jan 21, 2026
b8d9ba0
feat: updating as new module
hemasenthilkumar Jan 21, 2026
e32a785
Update variable.tf
hemasenthil13 Jan 21, 2026
0ffde60
Update main.tf
hemasenthil13 Jan 21, 2026
d0e3dd3
feat: Update main.tf
hemasenthil13 Jan 21, 2026
26a6e90
Update main.tf
hemasenthil13 Jan 21, 2026
ec486ce
Merge branch 'main' into cas
hemasenthil13 Jan 27, 2026
a1f0151
added for testing purposes
hemasenthil13 Jan 27, 2026
c3325ae
featUpdate main.tf
hemasenthil13 Jan 27, 2026
a7124ab
Update main.tf
hemasenthil13 Jan 27, 2026
e50df68
feat: Update main.tf
hemasenthil13 Feb 3, 2026
66393ec
Merge branch 'main' into cas
hemasenthil13 Feb 3, 2026
a76ad19
Update 10-upgrade-to-2026.0.sh
hemasenthil13 Feb 4, 2026
7a73dc8
feat: Update fix-external-secrets.sh
hemasenthil13 Feb 4, 2026
fa6db30
Update Dockerfile
hemasenthil13 Feb 4, 2026
c95ea27
feat: Update Makefile
hemasenthil13 Feb 4, 2026
20b7de0
Revert "feat: Update main.tf"
hemasenthilkumar Feb 4, 2026
70366a5
Merge branch 'main' into cas
hemasenthil13 Feb 4, 2026
3ea8ab4
reverting upgrade changes
hemasenthilkumar Feb 4, 2026
eb667a4
feat: Update Dockerfile
hemasenthil13 Feb 4, 2026
a9865f6
feat: Update fix-external-secrets.sh
hemasenthil13 Feb 4, 2026
e7bbce4
feat: Update Makefile
hemasenthil13 Feb 4, 2026
9c3ae5f
feat: Update fix-external-secrets.sh
hemasenthil13 Feb 4, 2026
3f0e4b6
feat: Update main.tf
hemasenthil13 Feb 4, 2026
4a853e7
feat: Update 10-upgrade-to-2025.2.0.sh
hemasenthil13 Feb 4, 2026
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
56 changes: 56 additions & 0 deletions pod-configs/module/eks-cas/main.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# creating service account for cas controller

resource "kubernetes_service_account" "cluster_autoscaler" {
metadata {
name = var.cas_service_account
namespace = var.cas_namespace

annotations = {
"eks.amazonaws.com/role-arn" = var.cas_controller_arn
}
}
}


resource "helm_release" "cluster_autoscaler" {
name = "cluster-autoscaler"
repository = "https://kubernetes.github.io/autoscaler"
chart = "cluster-autoscaler"
namespace = var.cas_namespace

depends_on = [
kubernetes_service_account.cluster_autoscaler
]

set = [
{
name = "priorityClassName"
value = "system-cluster-critical"
},
{
name = "autoDiscovery.clusterName"
value = var.cluster_name
},
{
name = "awsRegion"
value = var.aws_region
},
{
name = "rbac.serviceAccount.create"
value = "false"
},
{
name = "rbac.serviceAccount.name"
value = var.cas_service_account
},
{
name = "extraArgs.balance-similar-node-groups"
value = "true"
},
{
name = "extraArgs.expander"
value = "least-waste"
}
]

}
Empty file.
21 changes: 21 additions & 0 deletions pod-configs/module/eks-cas/variable.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
variable "cluster_name" {
type = string
}

variable "cas_namespace" {
description = "The Kubernetes namespace for cluster autoscaler"
default = "kube-system"
}

variable "cas_service_account" {
description = "The Kubernetes service account name of cluster autoscaler"
default = "cluster-autoscaler"
}

variable "cas_controller_arn" {
type = string
}

variable "aws_region" {
type = string
}
17 changes: 16 additions & 1 deletion pod-configs/module/eks/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,12 @@ resource "aws_eks_node_group" "nodegroup" {
aws_iam_role_policy_attachment.AmazonEBSCSIDriverPolicy,
aws_launch_template.eks_launch_template
]

tags = {
"k8s.io/cluster-autoscaler/enabled" = "true"
"k8s.io/cluster-autoscaler/${var.cluster_name}" = "owned"
}

}

resource "aws_eks_node_group" "additional_node_group" {
Expand Down Expand Up @@ -344,6 +350,14 @@ resource "aws_eks_node_group" "additional_node_group" {
}
}

tags = merge(
{
"k8s.io/cluster-autoscaler/enabled" = "true"
"k8s.io/cluster-autoscaler/${var.cluster_name}" = "owned"
},
lookup(each.value, "tags", {})
)

depends_on = [
aws_iam_role_policy_attachment.AmazonEKSWorkerNodePolicy,
aws_iam_role_policy_attachment.AmazonEKS_CNI_Policy,
Expand Down Expand Up @@ -425,7 +439,8 @@ resource "aws_iam_policy" "cas_controller" {
"ec2:DescribeInstanceTypes",
"ec2:DescribeLaunchTemplateVersions",
"ec2:GetInstanceTypesFromInstanceRequirements",
"eks:DescribeNodegroup"
"eks:DescribeNodegroup",
"eks:DescribeCluster"
],
"Resource": ["*"]
},
Expand Down
5 changes: 5 additions & 0 deletions pod-configs/module/eks/output.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ output "eks_security_group_id" {
value = aws_security_group.eks_cluster.id
description = "The major security group ID for the EKS cluster"
}

output "cas_controller_role_arn" {
description = "IAM role ARN used by Cluster Autoscaler (IRSA)"
value = aws_iam_role.cas_controller.arn
}
8 changes: 8 additions & 0 deletions pod-configs/orchestrator/cluster/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -228,3 +228,11 @@ module "gitea" {
# gitea_database_password = module.aurora_database.user_password["gitea-gitea_user"].result
# gitea_database = "gitea-gitea" # See aurora_database module
}

module "eks-cas" {
depends_on = [module.eks, module.aws_lb_controller]
source = "../../module/eks-cas"
aws_region = var.aws_region
cluster_name = var.eks_cluster_name
cas_controller_arn = module.eks.cas_controller_role_arn
}
Loading