From 8230497d7df341fc25a54382093291461c005f1c Mon Sep 17 00:00:00 2001 From: Poornima Krishnasamy Date: Tue, 5 Mar 2024 12:42:24 +0000 Subject: [PATCH 1/2] Configure memory requests and limits as variables --- main.tf | 2 ++ templates/values.yaml.tpl | 4 ++-- variables.tf | 12 ++++++++++++ 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/main.tf b/main.tf index 6039752..7aae800 100644 --- a/main.tf +++ b/main.tf @@ -60,6 +60,8 @@ resource "helm_release" "nginx_ingress" { enable_owasp = var.enable_owasp default = var.controller_name == "default" ? true : false name_override = "ingress-${var.controller_name}" + memory_requests = var.memory_requests + memory_limits = var.memory_limits enable_external_dns_annotation = var.enable_external_dns_annotation backend_repo = var.backend_repo backend_tag = var.backend_tag diff --git a/templates/values.yaml.tpl b/templates/values.yaml.tpl index 006225c..6266e5a 100644 --- a/templates/values.yaml.tpl +++ b/templates/values.yaml.tpl @@ -154,9 +154,9 @@ controller: resources: limits: - memory: 12Gi + memory: ${memory_limits} requests: - memory: 512Mi + memory: ${memory_requests} config: worker-shutdown-timeout: "440s" diff --git a/variables.tf b/variables.tf index 24475a3..29fc9f8 100644 --- a/variables.tf +++ b/variables.tf @@ -68,6 +68,18 @@ variable "enable_external_dns_annotation" { default = false } +variable "memory_limits" { + description = "value for resources:limits memory value" + default = "2Gi" + type = string +} + +variable "memory_requests" { + description = "value for resources:requests memory value" + default = "512Mi" + type = string +} + variable "cluster" { description = " cluster name used for opensearch indicies" type = string From 349517f97e40308124b1f2963299c27c61a4c7f7 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Tue, 5 Mar 2024 13:48:14 +0000 Subject: [PATCH 2/2] terraform-docs: automated action --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 996b938..3c54082 100644 --- a/README.md +++ b/README.md @@ -70,6 +70,8 @@ No modules. | [is\_live\_cluster](#input\_is\_live\_cluster) | For live clusters externalDNS annotation will have var.live\_domain (default *.cloud-platform.service.justice.gov.uk) | `bool` | `false` | no | | [live1\_cert\_dns\_name](#input\_live1\_cert\_dns\_name) | This is to add the live-1 dns name for eks-live cluster default certificate | `string` | `""` | no | | [live\_domain](#input\_live\_domain) | The live domain used for externalDNS annotation | `string` | `"cloud-platform.service.justice.gov.uk"` | no | +| [memory\_limits](#input\_memory\_limits) | value for resources:limits memory value | `string` | `"2Gi"` | no | +| [memory\_requests](#input\_memory\_requests) | value for resources:requests memory value | `string` | `"512Mi"` | no | | [opensearch\_modsec\_audit\_host](#input\_opensearch\_modsec\_audit\_host) | domain endpoint for the opensearch cluster | `string` | `""` | no | | [replica\_count](#input\_replica\_count) | Number of replicas set in deployment | `string` | n/a | yes |