Skip to content

Commit

Permalink
Merge pull request #80 from ministryofjustice/adjust-memory
Browse files Browse the repository at this point in the history
Configure memory requests and limits as variables
  • Loading branch information
poornima-krishnasamy authored Mar 5, 2024
2 parents 6da2b76 + 349517f commit 479401f
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ No modules.
| <a name="input_is_live_cluster"></a> [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 |
| <a name="input_live1_cert_dns_name"></a> [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 |
| <a name="input_live_domain"></a> [live\_domain](#input\_live\_domain) | The live domain used for externalDNS annotation | `string` | `"cloud-platform.service.justice.gov.uk"` | no |
| <a name="input_memory_limits"></a> [memory\_limits](#input\_memory\_limits) | value for resources:limits memory value | `string` | `"2Gi"` | no |
| <a name="input_memory_requests"></a> [memory\_requests](#input\_memory\_requests) | value for resources:requests memory value | `string` | `"512Mi"` | no |
| <a name="input_opensearch_modsec_audit_host"></a> [opensearch\_modsec\_audit\_host](#input\_opensearch\_modsec\_audit\_host) | domain endpoint for the opensearch cluster | `string` | `""` | no |
| <a name="input_replica_count"></a> [replica\_count](#input\_replica\_count) | Number of replicas set in deployment | `string` | n/a | yes |

Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions templates/values.yaml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -154,9 +154,9 @@ controller:

resources:
limits:
memory: 12Gi
memory: ${memory_limits}
requests:
memory: 512Mi
memory: ${memory_requests}

config:
worker-shutdown-timeout: "440s"
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 479401f

Please sign in to comment.