Skip to content

Commit ceb3295

Browse files
anish-squareopsankush-sqopsvinayakgautamops
authored
Removed default nodegroup and addons codebase (#48) (#49)
* Removed default nodegroup and addons codebase (#48) * Removed default nodegroup and addons codebase * Updated readme.md files * updated Public and private endpoint of cluster * Updated main.tf file for example module --------- Co-authored-by: ankush-sqops <[email protected]> Co-authored-by: vinayakgautamops <[email protected]>
1 parent ed9d5a3 commit ceb3295

File tree

6 files changed

+54
-474
lines changed

6 files changed

+54
-474
lines changed

README.md

Lines changed: 15 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +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.28.
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.
1111
<br>
12-
we've introduced a new functionality that enhances the ease of cluster setup. Users can now choose to create a default nodegroup based on the value of default_addon_enabled.the module now seamlessly integrates default addons, including CoreDNS, Kube-proxy, VPC CNI, and EBS CSI Driver. This ensures that your EKS clusters are equipped with essential components for optimal performance and functionality right from the start.
13-
<br>
14-
With this module, users can take advantage of the latest features and improvements offered by EKS 1.28 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.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.
1513

1614

1715
## Usage Example
@@ -22,20 +20,13 @@ module "eks" {
2220
name = "skaf"
2321
vpc_id = "vpc-xyz425342176"
2422
vpc_subnet_ids = [module.vpc.private_subnets[0]]
25-
eks_ng_min_size = 1
26-
eks_ng_max_size = 5
27-
eks_ng_desired_size = 1
28-
ebs_volume_size = 50
29-
eks_ng_capacity_type = "SPOT"
30-
eks_ng_instance_types = ["t3a.large", "t2.large", "t2.xlarge", "t3.large", "m5.large"]
3123
environment = "prod"
3224
eks_kms_key_arn = "arn:aws:kms:us-east-2:222222222222:key/kms_key_arn"
33-
eks_cluster_version = "1.29"
25+
eks_cluster_version = "1.30"
3426
eks_cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
3527
eks_cluster_log_retention_in_days = 30
3628
eks_cluster_endpoint_public_access = true
3729
eks_cluster_endpoint_public_access_cidrs = ["0.0.0.0/0"]
38-
eks_default_addon_enabled = true
3930
eks_nodes_keypair_name = module.key_pair_eks.key_pair_name
4031
access_entry_enabled = false
4132
access_entries = {
@@ -81,13 +72,12 @@ module "managed_node_group_addons" {
8172
managed_ng_ebs_volume_size = 50
8273
managed_ng_instance_types = ["t3a.large", "t2.large", "t2.xlarge", "t3.large", "m5.large"]
8374
managed_ng_kms_policy_arn = module.eks.kms_policy_arn
84-
eks_cluster_name = module.eks.eks_cluster_name
85-
worker_iam_role_name = module.eks.worker_iam_role_name
86-
worker_iam_role_arn = module.eks.worker_iam_role_arn
87-
default_addon_enabled = true
88-
managed_ng_pod_capacity= 90
75+
eks_cluster_name = module.eks.eks_cluster_name
76+
worker_iam_role_name = module.eks.worker_iam_role_name
77+
worker_iam_role_arn = module.eks.worker_iam_role_arn
78+
managed_ng_pod_capacity = 90
8979
managed_ng_monitoring_enabled = true
90-
eks_nodes_keypair_name = "key-pair-name"
80+
eks_nodes_keypair_name = "key-pair-name"
9181
k8s_labels = {
9282
"Addons-Services" = "true"
9383
}
@@ -97,13 +87,13 @@ module "managed_node_group_addons" {
9787
}
9888
9989
module "fargate_profle" {
100-
source = "squareops/eks/aws//modules/fargate-profile"
101-
depends_on = [module.eks]
102-
fargate_profile_name = "app"
103-
fargate_subnet_ids = ["subnet-abc123"]
104-
environment = "prod"
105-
eks_cluster_name = module.eks.cluster_name
106-
fargate_namespace = "default"
90+
source = "squareops/eks/aws//modules/fargate-profile"
91+
depends_on = [module.eks]
92+
fargate_profile_name = "app"
93+
fargate_subnet_ids = ["subnet-abc123"]
94+
environment = "prod"
95+
eks_cluster_name = module.eks.cluster_name
96+
fargate_namespace = "default"
10797
k8s_labels = {
10898
"App-Services" = "fargate"
10999
}
@@ -182,8 +172,6 @@ In this module, we have implemented the following CIS Compliance checks for EKS:
182172
| Name | Description | Type | Default | Required |
183173
|------|-------------|------|---------|:--------:|
184174
| <a name="input_additional_aws_tags"></a> [additional\_aws\_tags](#input\_additional\_aws\_tags) | Additional tags to be applied to AWS resources | `map(string)` | `{}` | no |
185-
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | Name of the AWS region where S3 bucket is to be created. | `string` | `"us-east-1"` | no |
186-
| <a name="input_aws_account_id"></a> [aws\_account\_id](#input\_aws\_account\_id) | Account ID of the AWS Account. | `string` | `""` | no |
187175
| <a name="input_environment"></a> [environment](#input\_environment) | Environment identifier for the EKS cluster, such as dev, qa, prod, etc. | `string` | `""` | no |
188176
| <a name="input_name"></a> [name](#input\_name) | Specify the name of the EKS cluster. | `string` | `""` | no |
189177
| <a name="input_cluster_version"></a> [cluster\_version](#input\_cluster\_version) | Specifies the Kubernetes version (major.minor) to use for the EKS cluster. | `string` | `""` | no |

examples/complete/main.tf

Lines changed: 38 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
locals {
2-
region = "us-west-1"
3-
kms_deletion_window_in_days = 7
4-
kms_key_rotation_enabled = true
5-
is_enabled = true
6-
multi_region = false
7-
environment = "stage"
8-
name = "sqops"
9-
auto_assign_public_ip = true
10-
vpc_availability_zones = ["us-west-1a", "us-west-1b"]
11-
vpc_public_subnet_enabled = true
12-
vpc_private_subnet_enabled = true
13-
vpc_database_subnet_enabled = true
14-
vpc_intra_subnet_enabled = true
15-
vpc_one_nat_gateway_per_az = true
16-
vpn_server_instance_type = "t3a.small"
17-
vpc_flow_log_enabled = false
18-
kms_user = null
19-
vpc_cidr = "10.10.0.0/16"
20-
vpn_server_enabled = true
21-
# default_addon_enabled = false # If true, a node group will be created along with enabling vpc-cni, ebs-csi addons.
22-
cluster_version = "1.30"
23-
cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
24-
cluster_log_retention_in_days = 30
25-
# ng_capacity_type = "SPOT" # Can use "On_DEMAND" also
2+
region = "us-west-1"
3+
kms_deletion_window_in_days = 7
4+
kms_key_rotation_enabled = true
5+
is_enabled = true
6+
multi_region = false
7+
environment = "stage"
8+
name = "sqops"
9+
auto_assign_public_ip = true
10+
vpc_availability_zones = ["us-west-1a", "us-west-1b"]
11+
vpc_public_subnet_enabled = true
12+
vpc_private_subnet_enabled = true
13+
vpc_database_subnet_enabled = true
14+
vpc_intra_subnet_enabled = true
15+
vpc_one_nat_gateway_per_az = true
16+
vpn_server_instance_type = "t3a.small"
17+
vpc_flow_log_enabled = false
18+
kms_user = null
19+
vpc_cidr = "10.10.0.0/16"
20+
vpn_server_enabled = true
21+
cluster_version = "1.30"
22+
cluster_log_types = ["api", "audit", "authenticator", "controllerManager", "scheduler"]
23+
cluster_log_retention_in_days = 30
2624
managed_ng_capacity_type = "SPOT" # Can use "On_DEMAND" also
2725
cluster_endpoint_private_access = false
2826
cluster_endpoint_public_access = true
@@ -31,11 +29,10 @@ locals {
3129
fargate_profile_name = "app"
3230
vpc_s3_endpoint_enabled = true
3331
vpc_ecr_endpoint_enabled = false
34-
# vpc_flow_log_cloudwatch_log_group_skip_destroy = false
35-
vpc_public_subnets_counts = 2
36-
vpc_private_subnets_counts = 2
37-
vpc_database_subnets_counts = 2
38-
vpc_intra_subnets_counts = 2
32+
vpc_public_subnets_counts = 2
33+
vpc_private_subnets_counts = 2
34+
vpc_database_subnets_counts = 2
35+
vpc_intra_subnets_counts = 2
3936
additional_aws_tags = {
4037
Owner = "Organization_name"
4138
Expires = "Never"
@@ -137,9 +134,8 @@ module "vpc" {
137134
}
138135

139136
module "eks" {
140-
source = "squareops/eks/aws"
141-
version = "4.0.9"
142-
# aws_region = local.region
137+
source = "squareops/eks/aws"
138+
version = "4.0.9"
143139
access_entry_enabled = true
144140
access_entries = {
145141
"example" = {
@@ -161,25 +157,16 @@ module "eks" {
161157
depends_on = [module.vpc]
162158
name = local.name
163159
vpc_id = module.vpc.vpc_id
164-
vpc_subnet_ids = [module.vpc.private_subnets[0]]
165-
# ng_min_size = 1
166-
# ng_max_size = 3
167-
# ng_desired_size = 2
168-
# ebs_volume_size = local.ebs_volume_size
169-
# ng_capacity_type = local.ng_capacity_type
170-
# ng_instance_types = ["t3a.large", "t2.large", "t2.xlarge", "t3.large", "m5.large"]
171-
environment = local.environment
172-
kms_key_arn = module.kms.key_arn
173-
cluster_version = local.cluster_version
174-
cluster_log_types = local.cluster_log_types
175-
vpc_private_subnet_ids = module.vpc.private_subnets
176-
cluster_log_retention_in_days = local.cluster_log_retention_in_days
177-
cluster_endpoint_public_access = local.cluster_endpoint_public_access
178-
cluster_endpoint_public_access_cidrs = local.cluster_endpoint_public_access_cidrs
179-
cluster_endpoint_private_access = local.cluster_endpoint_private_access
180-
# managed_ng_pod_capacity = 90
181-
# default_addon_enabled = local.default_addon_enabled
182-
nodes_keypair_name = module.key_pair_eks.key_pair_name
160+
environment = local.environment
161+
kms_key_arn = module.kms.key_arn
162+
cluster_version = local.cluster_version
163+
cluster_log_types = local.cluster_log_types
164+
vpc_private_subnet_ids = module.vpc.private_subnets
165+
cluster_log_retention_in_days = local.cluster_log_retention_in_days
166+
cluster_endpoint_public_access = local.cluster_endpoint_public_access
167+
cluster_endpoint_public_access_cidrs = local.cluster_endpoint_public_access_cidrs
168+
cluster_endpoint_private_access = local.cluster_endpoint_private_access
169+
nodes_keypair_name = module.key_pair_eks.key_pair_name
183170
cluster_security_group_additional_rules = {
184171
ingress_port_mgmt_tcp = {
185172
description = "mgmt vpc cidr"

examples/complete/outputs.tf

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -118,33 +118,3 @@ output "managed_ng_disk_size" {
118118
description = "Disk size of node in managed node group"
119119
value = module.managed_node_group_addons.managed_ng_ebs_volume_size
120120
}
121-
122-
# default Nodegroup
123-
# output "default_ng_node_group_arn" {
124-
# description = "ARN for the nodegroup"
125-
# value = local.default_addon_enabled ? module.eks.default_ng_node_group_arn : null
126-
# }
127-
128-
# output "default_ng_min_node" {
129-
# value = local.default_addon_enabled ? module.eks.default_ng_min_node : null
130-
# }
131-
132-
# output "default_ng_max_node" {
133-
# value = local.default_addon_enabled ? module.eks.default_ng_max_node : null
134-
# }
135-
136-
# output "default_ng_desired_node" {
137-
# value = local.default_addon_enabled ? module.eks.default_ng_desired_node : null
138-
# }
139-
140-
# output "default_ng_capacity_type" {
141-
# value = local.default_addon_enabled ? module.eks.default_ng_capacity_type : null
142-
# }
143-
144-
# output "default_ng_instance_types" {
145-
# value = local.default_addon_enabled ? module.eks.default_ng_instance_types : null
146-
# }
147-
148-
# output "default_ng_ebs_volume_size" {
149-
# value = local.default_addon_enabled ? module.eks.default_ng_ebs_volume_size : null
150-
# }

0 commit comments

Comments
 (0)