Skip to content

Commit 9bf2ced

Browse files
authored
Added support for eks v1.32 (#73) (#74)
Co-authored-by: ankush-sqops <ankush.upadhyay@squareops.com> Added Support for EKS v1.32 Added option to enable or disbale vpc cni plugin
1 parent 85a7df3 commit 9bf2ced

File tree

4 files changed

+19
-14
lines changed

4 files changed

+19
-14
lines changed

README.md

+5-4
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@
77

88
### [SquareOps Technologies](https://squareops.com/) Your DevOps Partner for Accelerating cloud journey.
99
<br>
10-
This module simplifies the deployment of EKS clusters with dual stack mode for Cluster IP family like IPv6 and IPv4, allowing users to quickly create and manage a production-grade Kubernetes cluster on AWS. The module is highly configurable, allowing users to customize various aspects of the EKS cluster, such as the Kubernetes version, worker node instance type, number of worker nodes, and now with added support for EKS version 1.30.
10+
This module simplifies the deployment of EKS clusters with dual stack mode for Cluster IP family like IPv6 and IPv4, allowing users to quickly create and manage a production-grade Kubernetes cluster on AWS. The module is highly configurable, allowing users to customize various aspects of the EKS cluster, such as the Kubernetes version, worker node instance type, number of worker nodes, and now with added support for EKS version 1.32.
1111
<br>
12-
With this module, users can take advantage of the latest features and improvements offered by EKS 1.30 while maintaining the ease and convenience of automated deployment. The module provides a streamlined solution for setting up EKS clusters, reducing the manual effort required for setup and configuration.
12+
With this module, users can take advantage of the latest features and improvements offered by EKS 1.32 while maintaining the ease and convenience of automated deployment. The module provides a streamlined solution for setting up EKS clusters, reducing the manual effort required for setup and configuration.
1313

1414

1515
## Usage Example
@@ -22,7 +22,7 @@ module "eks" {
2222
vpc_subnet_ids = [module.vpc.private_subnets[0]]
2323
environment = "prod"
2424
eks_kms_key_arn = "arn:aws:kms:us-east-2:222222222222:key/kms_key_arn"
25-
eks_cluster_version = "1.30"
25+
eks_cluster_version = "1.32"
2626
eks_cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
2727
eks_cluster_log_retention_in_days = 30
2828
eks_cluster_endpoint_public_access = true
@@ -56,7 +56,8 @@ module "eks" {
5656
cidr_blocks = ["10.10.0.0/16"]
5757
}
5858
}
59-
vpc_cni_version = "v1.19.3-eksbuild.1"
59+
enable_vpc_cni_addon = true
60+
vpc_cni_version = "v1.19.3-eksbuild.1"
6061
}
6162
6263
module "managed_node_group_addons" {

examples/complete/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ This directory contains a complete example that demonstrates the usage of the Te
2626
| <a name="module_key_pair_vpn"></a> [key\_pair\_vpn](#module\_key\_pair\_vpn) | squareops/keypair/aws | 1.0.2 |
2727
| <a name="module_key_pair_eks"></a> [key\_pair\_eks](#module\_key\_pair\_eks) | squareops/keypair/aws | 1.0.2 |
2828
| <a name="module_vpc"></a> [vpc](#module\_vpc) | squareops/vpc/aws | 3.4.1 |
29-
| <a name="module_eks"></a> [eks](#module\_eks) | squareops/eks/aws | 5.4.1 |
30-
| <a name="module_managed_node_group_addons"></a> [managed\_node\_group\_addons](#module\_managed\_node\_group\_addons) | squareops/eks/aws//modules/managed-nodegroup | 5.4.1 |
29+
| <a name="module_eks"></a> [eks](#module\_eks) | squareops/eks/aws | 5.4.2 |
30+
| <a name="module_managed_node_group_addons"></a> [managed\_node\_group\_addons](#module\_managed\_node\_group\_addons) | squareops/eks/aws//modules/managed-nodegroup | 5.4.2 |
3131
| <a name="module_fargate_profle"></a> [fargate\_profle](#module\_fargate\_profle) | squareops/eks/aws//modules/fargate-profile | n/a |
3232

3333
## Resources

examples/complete/main.tf

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ locals {
1818
kms_user = null
1919
vpc_cidr = "10.10.0.0/16"
2020
vpn_server_enabled = false
21-
cluster_version = "1.31"
21+
cluster_version = "1.32"
2222
cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
2323
cluster_log_retention_in_days = 30
2424
managed_ng_capacity_type = "SPOT" # Choose the capacity type ("SPOT" or "ON_DEMAND")
@@ -139,7 +139,7 @@ module "vpc" {
139139

140140
module "eks" {
141141
source = "squareops/eks/aws"
142-
version = "5.4.1"
142+
version = "5.4.2"
143143
access_entry_enabled = true
144144
access_entries = {
145145
"example" = {
@@ -181,13 +181,14 @@ module "eks" {
181181
cidr_blocks = ["10.10.0.0/16"]
182182
}
183183
}
184-
vpc_cni_version = "v1.19.3-eksbuild.1"
185-
tags = local.additional_aws_tags
184+
enable_vpc_cni_addon = true
185+
vpc_cni_version = "v1.19.3-eksbuild.1"
186+
tags = local.additional_aws_tags
186187
}
187188

188189
module "managed_node_group_addons" {
189190
source = "squareops/eks/aws//modules/managed-nodegroup"
190-
version = "5.4.1"
191+
version = "5.4.2"
191192
depends_on = [module.vpc, module.eks]
192193
managed_ng_name = "Infra"
193194
managed_ng_min_size = 2

main.tf

+6-3
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ module "eks" {
3838
}
3939
enableNetworkPolicy = "true"
4040
})
41-
service_account_role_arn = module.vpc_cni_irsa_role.iam_role_arn
41+
service_account_role_arn = module.vpc_cni_irsa_role[0].iam_role_arn
4242
}
4343
} : {}
4444
}
4545

4646
module "vpc_cni_irsa_role" {
47+
count = var.enable_vpc_cni_addon ? 1 : 0
4748
source = "terraform-aws-modules/iam/aws//modules/iam-role-for-service-accounts-eks"
4849
version = "5.52.2"
4950
role_name = format("%s-%s-%s", var.environment, var.name, "aws-node-irsa")
@@ -214,11 +215,13 @@ resource "aws_iam_role_policy_attachment" "worker_ecr_policy" {
214215
}
215216

216217
resource "aws_iam_role_policy_attachment" "vpc_cni_addons_policy" {
217-
role = module.vpc_cni_irsa_role.iam_role_name
218+
count = var.enable_vpc_cni_addon ? 1 : 0
219+
role = module.vpc_cni_irsa_role[0].iam_role_name
218220
policy_arn = var.ipv6_enabled == false ? "arn:aws:iam::aws:policy/AmazonEKS_CNI_Policy" : aws_iam_policy.cni_ipv6_policy[0].arn
219221
}
220222

221223
resource "aws_iam_role_policy_attachment" "kms_vpc_cni_policy_attachment" {
222-
role = module.vpc_cni_irsa_role.iam_role_name
224+
count = var.enable_vpc_cni_addon ? 1 : 0
225+
role = module.vpc_cni_irsa_role[0].iam_role_name
223226
policy_arn = aws_iam_policy.kubernetes_pvc_kms_policy.arn
224227
}

0 commit comments

Comments
 (0)