Skip to content

Commit

Permalink
fix: Allow EKS addons version config (#303)
Browse files Browse the repository at this point in the history
* fix: Allow EKS addons version config

* Fix duplication of default values

* Add doc reference
  • Loading branch information
flamarion authored Oct 15, 2024
1 parent 0e7017b commit 6316472
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 22 deletions.
7 changes: 7 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,13 @@ module "app_eks" {
system_reserved_pid = var.system_reserved_pid

aws_loadbalancer_controller_tags = var.aws_loadbalancer_controller_tags

eks_addon_efs_csi_driver_version = var.eks_addon_efs_csi_driver_version
eks_addon_ebs_csi_driver_version = var.eks_addon_ebs_csi_driver_version
eks_addon_coredns_version = var.eks_addon_coredns_version
eks_addon_kube_proxy_version = var.eks_addon_kube_proxy_version
eks_addon_vpc_cni_version = var.eks_addon_vpc_cni_version

}


Expand Down
10 changes: 5 additions & 5 deletions modules/app_eks/add-ons.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ resource "aws_eks_addon" "aws_efs_csi_driver" {
]
cluster_name = var.namespace
addon_name = "aws-efs-csi-driver"
addon_version = "v2.0.7-eksbuild.1"
addon_version = var.eks_addon_efs_csi_driver_version
resolve_conflicts = "OVERWRITE"
}

Expand All @@ -44,7 +44,7 @@ resource "aws_eks_addon" "aws_ebs_csi_driver" {
]
cluster_name = var.namespace
addon_name = "aws-ebs-csi-driver"
addon_version = "v1.35.0-eksbuild.1"
addon_version = var.eks_addon_ebs_csi_driver_version
resolve_conflicts = "OVERWRITE"
}

Expand All @@ -54,7 +54,7 @@ resource "aws_eks_addon" "coredns" {
]
cluster_name = var.namespace
addon_name = "coredns"
addon_version = "v1.11.3-eksbuild.1"
addon_version = var.eks_addon_coredns_version
resolve_conflicts = "OVERWRITE"
}

Expand All @@ -64,7 +64,7 @@ resource "aws_eks_addon" "kube_proxy" {
]
cluster_name = var.namespace
addon_name = "kube-proxy"
addon_version = "v1.29.7-eksbuild.9"
addon_version = var.eks_addon_kube_proxy_version
resolve_conflicts = "OVERWRITE"
}

Expand All @@ -74,7 +74,7 @@ resource "aws_eks_addon" "vpc_cni" {
]
cluster_name = var.namespace
addon_name = "vpc-cni"
addon_version = "v1.18.3-eksbuild.3"
addon_version = var.eks_addon_vpc_cni_version
resolve_conflicts = "OVERWRITE"
service_account_role_arn = aws_iam_role.oidc.arn
}
8 changes: 4 additions & 4 deletions modules/app_eks/cluster_autoscaler/cluster_autoscaler.tf
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
data "aws_region" "current" {}

resource "helm_release" "cluster-autoscaler" {
chart = "cluster-autoscaler"
name = "cluster-autoscaler"
repository = "https://kubernetes.github.io/autoscaler"
namespace = "cluster-autoscaler"
chart = "cluster-autoscaler"
name = "cluster-autoscaler"
repository = "https://kubernetes.github.io/autoscaler"
namespace = "cluster-autoscaler"
create_namespace = true

set {
Expand Down
25 changes: 25 additions & 0 deletions modules/app_eks/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,28 @@ variable "aws_loadbalancer_controller_tags" {
type = map(string)
default = {}
}

variable "eks_addon_efs_csi_driver_version" {
description = "The version of the EFS CSI driver to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
}

variable "eks_addon_ebs_csi_driver_version" {
description = "The version of the EBS CSI driver to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
}

variable "eks_addon_coredns_version" {
description = "The version of the CoreDNS addon to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
}

variable "eks_addon_kube_proxy_version" {
description = "The version of the kube-proxy addon to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
}

variable "eks_addon_vpc_cni_version" {
description = "The version of the VPC CNI addon to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
}
10 changes: 5 additions & 5 deletions modules/endpoint/main.tf
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
resource "aws_vpc_endpoint" "default" {
vpc_id = var.network_id
service_name = var.service_name
vpc_endpoint_type = "Gateway"
auto_accept = true
route_table_ids = var.private_route_table_id
vpc_id = var.network_id
service_name = var.service_name
vpc_endpoint_type = "Gateway"
auto_accept = true
route_table_ids = var.private_route_table_id

policy = <<POLICY
{
Expand Down
10 changes: 5 additions & 5 deletions modules/endpoint/variables.tf
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
variable "network_id" {
type = string
description = "ID of the network (VPC) where infrastructure resources will be deployed."
}
type = string
description = "ID of the network (VPC) where infrastructure resources will be deployed."
}

variable "private_route_table_id" {
type = list(string)
type = list(string)
description = "Private route table ID within the specified network (VPC) where resources will be deployed"
}

variable "service_name" {
type = string
type = string
description = "Name of the service or vpc endpoint"
}
2 changes: 1 addition & 1 deletion modules/iam_role/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ variable "namespace" {
}

variable "aws_iam_openid_connect_provider_url" {
type = string
type = string
}

variable "yace_sa_name" {
Expand Down
4 changes: 2 additions & 2 deletions modules/private_link/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ variable "vpc_id" {
}

variable "enable_private_only_traffic" {
type = bool
type = bool
}
variable "nlb_security_group" {
type = string
type = string
}
31 changes: 31 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,37 @@ variable "aws_loadbalancer_controller_tags" {
default = {}
}

variable "eks_addon_efs_csi_driver_version" {
description = "The version of the EFS CSI driver to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
default = "v2.0.7-eksbuild.1"
}

variable "eks_addon_ebs_csi_driver_version" {
description = "The version of the EBS CSI driver to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
default = "v1.35.0-eksbuild.1"
}

variable "eks_addon_coredns_version" {
description = "The version of the CoreDNS addon to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
default = "v1.11.3-eksbuild.1"
}

variable "eks_addon_kube_proxy_version" {
description = "The version of the kube-proxy addon to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html."
type = string
default = "v1.29.7-eksbuild.9"
}

variable "eks_addon_vpc_cni_version" {
description = "The version of the VPC CNI addon to install. Check the docs for more information about the compatibility https://docs.aws.amazon.com/eks/latest/userguide/vpc-add-on-update.html.s"
type = string
default = "v1.18.3-eksbuild.3"
}


##########################################
# External Bucket #
##########################################
Expand Down

0 comments on commit 6316472

Please sign in to comment.