Skip to content

Commit b3e39f0

Browse files
Merge branch 'updated-eks-bootstrap-module' into 'main'
Updated eks bootstrap module See merge request sq-ia/aws/eks-bootstrap!31
2 parents ce4b288 + c553ff4 commit b3e39f0

File tree

11 files changed

+189
-133
lines changed

11 files changed

+189
-133
lines changed

README.md

Lines changed: 32 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -7,52 +7,50 @@
77
<br>
88
Terraform module to create EKS cluster addons for workload deployment on AWS Cloud.
99

10-
## Uses Example
10+
## Usage Example
1111
```hcl
1212
module "eks_bootstrap" {
1313
source = "squareops/eks-bootstrap/aws"
1414
environment = "production"
1515
name = "skaf"
16-
eks_cluster_id = "Cluster-Name"
17-
enable_amazon_eks_aws_ebs_csi_driver = true
18-
kms_policy_arn = arn:aws:iam::222222222222:policy/kms_policy_arn
19-
enable_single_az_ebs_gp3_storage_class = true
16+
eks_cluster_name = "Cluster-Name"
2017
single_az_sc_config = [{ name = "infra-service-sc", zone = "us-east-2a" }]
21-
kms_key_id = arn:aws:kms:us-east-2:222222222222:key/kms_key_arn
18+
kms_key_arn = "arn:aws:kms:us-east-2:222222222222:key/kms_key_arn"
19+
kms_policy_arn = "arn:aws:iam::222222222222:policy/kms_policy_arn"
20+
cert_manager_letsencrypt_email = "[email protected]"
21+
vpc_id = "vpc-06e37f0786b7eskaf"
22+
private_subnet_ids = ["subnet-00exyzd5df967d21w","subnet-0c4abcd5aedxyzaea"]
23+
provider_url = "cluster_oidc_issuer_url"
24+
enable_single_az_ebs_gp3_storage_class = true
25+
enable_amazon_eks_aws_ebs_csi_driver = true
2226
enable_amazon_eks_vpc_cni = true
2327
create_service_monitor_crd = true
2428
enable_cluster_autoscaler = true
2529
enable_cluster_propotional_autoscaler = true
2630
enable_reloader = true
27-
enable_metrics_server = false
31+
enable_metrics_server = true
2832
enable_ingress_nginx = true
2933
cert_manager_enabled = true
3034
cert_manager_install_letsencrypt_http_issuers = true
31-
cert_manager_letsencrypt_email = "[email protected]"
3235
enable_external_secrets = true
33-
provider_url = module.eks.cluster_oidc_issuer_url
3436
enable_keda = true
3537
create_efs_storage_class = true
36-
vpc_id = "vpc-06e37f0786b7eskaf"
37-
private_subnet_ids = ["subnet-00exyzd5df967d21w","subnet-0c4abcd5aedxyzaea"]
38-
enable_istio = true
38+
enable_istio = false
3939
enable_karpenter = true
40-
karpenter_node_iam_role = "worker_iam_role_name"
4140
enable_aws_node_termination_handler = true
42-
subnet_selector_name= "skaf-private-subnet"
43-
sg_selector_name= "security_group_selector_name"
44-
karpenter_ec2_capacity_type= ["on_demand"]
45-
excluded_karpenter_ec2_instance_type= ["nano", "micro", "small"]
41+
worker_iam_role_name = "worker_iam_role_name"
42+
private_subnet_name = "private_subnet_name"
43+
karpenter_ec2_capacity_type = ["spot"]
44+
excluded_karpenter_ec2_instance_type = ["nano", "micro", "small"]
4645
velero_config = {
47-
enable_velero = true
48-
slack_token = "xoxb-slack-token-skaf"
49-
slack_channel_name = "skaf-backup-notifications"
46+
enable_velero = false
47+
slack_token = "xoxb-slack-token-skaf"
48+
slack_channel_name = "skaf-notifications"
5049
retention_period_in_days = 45
51-
namespaces = "my-application"
52-
schedule_cron_time = "* 6 * * *"
53-
velero_backup_name = "my-application-backup"
54-
backup_bucket_name = "velero-cluster-backup"
55-
50+
namespaces = "my-application"
51+
schedule_cron_time = "* 6 * * *"
52+
velero_backup_name = "my-application-backup"
53+
backup_bucket_name = "velero-cluster-backup"
5654
}
5755
}
5856
@@ -205,7 +203,7 @@ Velero is designed to work with cloud native environments, making it a popular c
205203
| <a name="input_cluster_autoscaler_chart_version"></a> [cluster\_autoscaler\_chart\_version](#input\_cluster\_autoscaler\_chart\_version) | Mention the version of the cluster autoscaler helm chart | `string` | `"9.19.1"` | no |
206204
| <a name="input_create_efs_storage_class"></a> [create\_efs\_storage\_class](#input\_create\_efs\_storage\_class) | Set to true if you want to enable the EFS | `bool` | `false` | no |
207205
| <a name="input_create_service_monitor_crd"></a> [create\_service\_monitor\_crd](#input\_create\_service\_monitor\_crd) | Set true to install CRDs for service monitor. | `bool` | `false` | no |
208-
| <a name="input_eks_cluster_id"></a> [eks\_cluster\_id](#input\_eks\_cluster\_id) | Fetch Cluster ID of the cluster | `string` | `"stg-msa-reff"` | no |
206+
| <a name="input_eks_cluster_name"></a> [eks\_cluster\_name](#input\_eks\_cluster\_name) | Fetch Cluster ID of the cluster | `string` | `""` | no |
209207
| <a name="input_enable_amazon_eks_aws_ebs_csi_driver"></a> [enable\_amazon\_eks\_aws\_ebs\_csi\_driver](#input\_enable\_amazon\_eks\_aws\_ebs\_csi\_driver) | Enable EKS Managed AWS EBS CSI Driver add-on | `bool` | `false` | no |
210208
| <a name="input_enable_amazon_eks_vpc_cni"></a> [enable\_amazon\_eks\_vpc\_cni](#input\_enable\_amazon\_eks\_vpc\_cni) | Set true to install VPC CNI addon. | `bool` | `false` | no |
211209
| <a name="input_enable_aws_load_balancer_controller"></a> [enable\_aws\_load\_balancer\_controller](#input\_enable\_aws\_load\_balancer\_controller) | Enable AWS Load Balancer Controller add-on | `bool` | `false` | no |
@@ -220,22 +218,21 @@ Velero is designed to work with cloud native environments, making it a popular c
220218
| <a name="input_enable_metrics_server"></a> [enable\_metrics\_server](#input\_enable\_metrics\_server) | Enable metrics server add-on | `bool` | `false` | no |
221219
| <a name="input_enable_reloader"></a> [enable\_reloader](#input\_enable\_reloader) | Set true to enable reloader | `bool` | `false` | no |
222220
| <a name="input_enable_single_az_ebs_gp3_storage_class"></a> [enable\_single\_az\_ebs\_gp3\_storage\_class](#input\_enable\_single\_az\_ebs\_gp3\_storage\_class) | Enable Single az storage class. | `bool` | `false` | no |
223-
| <a name="input_environment"></a> [environment](#input\_environment) | Environment identifier for the EKS cluster | `string` | `"stg"` | no |
221+
| <a name="input_environment"></a> [environment](#input\_environment) | Environment identifier for the EKS cluster | `string` | `""` | no |
222+
| <a name="input_excluded_karpenter_ec2_instance_type"></a> [excluded\_karpenter\_ec2\_instance\_type](#input\_excluded\_karpenter\_ec2\_instance\_type) | List of instance types that cannot be used by Karpenter | `list(string)` | <pre>[<br> ""<br>]</pre> | no |
224223
| <a name="input_ingress_nginx_version"></a> [ingress\_nginx\_version](#input\_ingress\_nginx\_version) | Specify the version of the nginx ingress | `string` | `"4.1.4"` | no |
225224
| <a name="input_karpenter_ec2_capacity_type"></a> [karpenter\_ec2\_capacity\_type](#input\_karpenter\_ec2\_capacity\_type) | EC2 provisioning capacity type | `list(string)` | <pre>[<br> ""<br>]</pre> | no |
226-
| <a name="input_karpenter_ec2_instance_type"></a> [karpenter\_ec2\_instance\_type](#input\_excluded\_karpenter\_ec2\_instance\_type) | List of instance types that can be used by Karpenter | `list(string)` | <pre>[<br> ""<br>]</pre> | no |
227-
| <a name="input_karpenter_node_iam_role"></a> [karpenter\_node\_iam\_role](#input\_karpenter\_node\_iam\_role) | Specify the IAM role for the nodes provision through karpenter. | `string` | n/a | yes |
228-
| <a name="input_kms_key_id"></a> [kms\_key\_id](#input\_kms\_key\_id) | KMS key to Encrypt AWS resources | `string` | `""` | no |
225+
| <a name="input_kms_key_arn"></a> [kms\_key\_arn](#input\_kms\_key\_arn) | KMS key to Encrypt AWS resources | `string` | `""` | no |
229226
| <a name="input_kms_policy_arn"></a> [kms\_policy\_arn](#input\_kms\_policy\_arn) | Specify the ARN of KMS policy, for service accounts. | `string` | `""` | no |
230227
| <a name="input_metrics_server_helm_version"></a> [metrics\_server\_helm\_version](#input\_metrics\_server\_helm\_version) | Mention the version of the metrics server helm chart | `string` | `"3.8.2"` | no |
231-
| <a name="input_name"></a> [name](#input\_name) | Specify the name prefix of the EKS cluster resources. | `string` | `"msa"` | no |
228+
| <a name="input_name"></a> [name](#input\_name) | Specify the name prefix of the EKS cluster resources. | `string` | `""` | no |
232229
| <a name="input_private_subnet_ids"></a> [private\_subnet\_ids](#input\_private\_subnet\_ids) | Private subnets of the VPC which can be used by EFS | `list(string)` | <pre>[<br> ""<br>]</pre> | no |
230+
| <a name="input_private_subnet_name"></a> [private\_subnet\_name](#input\_private\_subnet\_name) | Name of subnet selector for karpenter provisioner. | `string` | `""` | no |
233231
| <a name="input_provider_url"></a> [provider\_url](#input\_provider\_url) | Provider URL of OIDC | `string` | `""` | no |
234-
| <a name="input_sg_selector_name"></a> [sg\_selector\_name](#input\_sg\_selector\_name) | Name of security group selector for karpenter provisioner. | `string` | `""` | no |
235232
| <a name="input_single_az_sc_config"></a> [single\_az\_sc\_config](#input\_single\_az\_sc\_config) | Define the Name and regions for storage class in Key-Value pair. | `list(any)` | `[]` | no |
236-
| <a name="input_subnet_selector_name"></a> [subnet\_selector\_name](#input\_subnet\_selector\_name) | Name of subnet selector for karpenter provisioner. | `string` | `""` | no |
237233
| <a name="input_velero_config"></a> [velero\_config](#input\_velero\_config) | velero configurations | `any` | <pre>{<br> "backup_bucket_name": "",<br> "enable_velero": false,<br> "namespaces": "",<br> "retention_period_in_days": 45,<br> "schedule_cron_time": "",<br> "slack_channel_name": "",<br> "slack_token": "",<br> "velero_backup_name": ""<br>}</pre> | no |
238234
| <a name="input_vpc_id"></a> [vpc\_id](#input\_vpc\_id) | ID of the VPC where the cluster and its nodes will be provisioned | `string` | `""` | no |
235+
| <a name="input_worker_iam_role_name"></a> [worker\_iam\_role\_name](#input\_worker\_iam\_role\_name) | Specify the IAM role for the nodes provision through karpenter. | `string` | `""` | no |
239236

240237
## Outputs
241238

@@ -255,7 +252,7 @@ To report an issue with a project:
255252
2. Search to see if the issue has already been reported
256253
3. If you can't find an answer to your question in the documentation or issue tracker, you can ask a question by creating a new issue. Be sure to provide enough context and details so others can understand your problem.
257254
4. Contributing to the project can be a great way to get involved and get help. The maintainers and other contributors may be more likely to help you if you're already making contributions to the project.
258-
255+
259256

260257
## License
261258

@@ -277,7 +274,7 @@ Starring a repository on GitHub is a simple way to show your support and appreci
277274

278275
We believe that the key to success in the digital age is the ability to deliver value quickly and reliably. That’s why we offer a comprehensive range of DevOps & Cloud services designed to help your organization optimize its systems & Processes for speed and agility.
279276

280-
1. We are an AWS Advanced consulting partner which reflects our deep expertise in AWS Cloud and helping 100+ clients over the last 4 years.
277+
1. We are an AWS Advanced consulting partner which reflects our deep expertise in AWS Cloud and helping 100+ clients over the last 5 years.
281278
2. Expertise in Kubernetes and overall container solution helps companies expedite their journey by 10X.
282279
3. Infrastructure Automation is a key component to the success of our Clients and our Expertise helps deliver the same in the shortest time.
283280
4. DevSecOps as a service to implement security within the overall DevOps process and helping companies deploy securely and at speed.

addons/cert_manager/cert_manager.yaml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,9 @@ cainjector:
3636
operator: In
3737
values:
3838
- "true"
39-
<<<<<<< HEAD
39+
4040
podAnnotations:
4141
co.elastic.logs/enabled: "true"
42-
=======
43-
>>>>>>> db6a524689d4606ebf352dd390a236eff3d65c8b
4442
prometheus:
4543
enabled: ${enable_service_monitor}
4644
servicemonitor:

addons/karpenter_provisioner/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ No modules.
2525

2626
| Name | Description | Type | Default | Required |
2727
|------|-------------|------|---------|:--------:|
28+
| <a name="input_excluded_karpenter_ec2_instance_type"></a> [excluded\_karpenter\_ec2\_instance\_type](#input\_excluded\_karpenter\_ec2\_instance\_type) | List of instance types that can be used by Karpenter | `list(string)` | <pre>[<br> ""<br>]</pre> | no |
2829
| <a name="input_karpenter_ec2_capacity_type"></a> [karpenter\_ec2\_capacity\_type](#input\_karpenter\_ec2\_capacity\_type) | EC2 provisioning capacity type | `list(string)` | <pre>[<br> ""<br>]</pre> | no |
29-
| <a name="input_karpenter_ec2_instance_type"></a> [karpenter\_ec2\_instance\_type](#input\_karpenter\_ec2\_instance\_type) | List of instance types that can be used by Karpenter | `list(string)` | <pre>[<br> ""<br>]</pre> | no |
3030
| <a name="input_sg_selector_name"></a> [sg\_selector\_name](#input\_sg\_selector\_name) | Name of security group selector for karpenter provisioner. | `string` | `""` | no |
3131
| <a name="input_subnet_selector_name"></a> [subnet\_selector\_name](#input\_subnet\_selector\_name) | Name of subnet selector for karpenter provisioner. | `string` | `""` | no |
3232

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
subnet_selector_name: "${subnet_selector_name}"
22
sg_selector_name: "${sg_selector_name}"
33
karpenter_ec2_capacity_type: "${karpenter_ec2_capacity_type}"
4-
excluded_karpenter_ec2_instance_type: "${excluded_karpenter_ec2_instance_type}"
4+
excluded_karpenter_ec2_instance_type: "${excluded_karpenter_ec2_instance_type}"

addons/karpenter_provisioner/main.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ resource "helm_release" "karpenter_provisioner" {
44
timeout = 600
55
values = [
66
templatefile("${path.module}/karpenter-provisioner/values.yaml", {
7-
subnet_selector_name = var.subnet_selector_name,
8-
sg_selector_name = var.sg_selector_name,
9-
karpenter_ec2_capacity_type = "[${join(",", [for s in var.karpenter_ec2_capacity_type : format("%s", s)])}]",
10-
excluded_karpenter_ec2_instance_type = "[${join(",", var.karpenter_ec2_instance_type)}]"
7+
subnet_selector_name = var.subnet_selector_name,
8+
sg_selector_name = var.sg_selector_name,
9+
karpenter_ec2_capacity_type = "[${join(",", [for s in var.karpenter_ec2_capacity_type : format("%s", s)])}]",
10+
excluded_karpenter_ec2_instance_type = "[${join(",", var.excluded_karpenter_ec2_instance_type)}]"
1111
})
1212
]
1313
}

addons/karpenter_provisioner/variable.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ variable "karpenter_ec2_capacity_type" {
1616
default = [""]
1717
}
1818

19-
variable "karpenter_ec2_instance_type" {
19+
variable "excluded_karpenter_ec2_instance_type" {
2020
description = "List of instance types that can be used by Karpenter"
2121
type = list(string)
2222
default = [""]

examples/complete/README.md

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# complete
2+
3+
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
4+
## Requirements
5+
6+
| Name | Version |
7+
|------|---------|
8+
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 |
9+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 3.43.0 |
10+
| <a name="requirement_kubernetes"></a> [kubernetes](#requirement\_kubernetes) | >= 2.0.2 |
11+
12+
## Providers
13+
14+
| Name | Version |
15+
|------|---------|
16+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 3.43.0 |
17+
18+
## Modules
19+
20+
| Name | Source | Version |
21+
|------|--------|---------|
22+
| <a name="module_eks_bootstrap"></a> [eks\_bootstrap](#module\_eks\_bootstrap) | squareops/eks-bootstrap/aws | n/a |
23+
24+
## Resources
25+
26+
| Name | Type |
27+
|------|------|
28+
| [aws_eks_cluster.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster) | data source |
29+
| [aws_eks_cluster_auth.cluster](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/eks_cluster_auth) | data source |
30+
31+
## Inputs
32+
33+
No inputs.
34+
35+
## Outputs
36+
37+
| Name | Description |
38+
|------|-------------|
39+
| <a name="output_ebs_encryption"></a> [ebs\_encryption](#output\_ebs\_encryption) | Is AWS EBS encryption is enabled or not? |
40+
| <a name="output_efs_id"></a> [efs\_id](#output\_efs\_id) | EFS ID |
41+
| <a name="output_environment"></a> [environment](#output\_environment) | Environment Name for the EKS cluster |
42+
| <a name="output_nginx_ingress_controller_dns_hostname"></a> [nginx\_ingress\_controller\_dns\_hostname](#output\_nginx\_ingress\_controller\_dns\_hostname) | NGINX Ingress Controller DNS Hostname |
43+
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

examples/complete/main.tf

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -10,49 +10,46 @@ locals {
1010
}
1111

1212
module "eks_bootstrap" {
13-
source = "../../"
13+
source = "squareops/eks-bootstrap/aws"
1414
environment = local.environment
1515
name = local.name
16-
eks_cluster_id = ""
17-
enable_amazon_eks_aws_ebs_csi_driver = true
16+
eks_cluster_name = "prod-skaf"
17+
single_az_sc_config = [{ name = "infra-service-sc", zone = "us-east-2a" }]
18+
kms_key_arn = ""
1819
kms_policy_arn = ""
20+
cert_manager_letsencrypt_email = "[email protected]"
21+
vpc_id = ""
22+
private_subnet_ids = []
23+
provider_url = ""
1924
enable_single_az_ebs_gp3_storage_class = true
20-
single_az_sc_config = [{ name = "infra-service-sc", zone = "us-east-2a" }]
21-
kms_key_id = ""
25+
enable_amazon_eks_aws_ebs_csi_driver = true
2226
enable_amazon_eks_vpc_cni = true
2327
create_service_monitor_crd = true
2428
enable_cluster_autoscaler = true
2529
enable_cluster_propotional_autoscaler = true
2630
enable_reloader = true
27-
enable_metrics_server = false
31+
enable_metrics_server = true
2832
enable_ingress_nginx = true
2933
cert_manager_enabled = true
3034
cert_manager_install_letsencrypt_http_issuers = true
31-
cert_manager_letsencrypt_email = "[email protected]"
3235
enable_external_secrets = true
33-
provider_url = ""
3436
enable_keda = true
3537
create_efs_storage_class = true
36-
vpc_id = ""
37-
private_subnet_ids = []
3838
enable_istio = false
3939
enable_karpenter = true
40-
karpenter_node_iam_role = ""
4140
enable_aws_node_termination_handler = true
42-
subnet_selector_name= ""
43-
sg_selector_name= ""
44-
karpenter_ec2_capacity_type= ["spot"]
45-
excluded_karpenter_ec2_instance_type= ["nano", "micro", "small"]
41+
worker_iam_role_name = ""
42+
private_subnet_name = ""
43+
karpenter_ec2_capacity_type = ["spot"]
44+
excluded_karpenter_ec2_instance_type = ["nano", "micro", "small"]
4645
velero_config = {
47-
enable_velero = true
48-
slack_token = ""
49-
slack_channel_name = ""
46+
enable_velero = false
47+
slack_token = ""
48+
slack_channel_name = ""
5049
retention_period_in_days = 45
51-
namespaces = ""
52-
schedule_cron_time = ""
53-
velero_backup_name = ""
54-
backup_bucket_name = ""
55-
50+
namespaces = ""
51+
schedule_cron_time = ""
52+
velero_backup_name = ""
53+
backup_bucket_name = ""
5654
}
5755
}
58-

0 commit comments

Comments
 (0)