From 1f6393b07c0e35544f5055c4aff5d06b45e4b788 Mon Sep 17 00:00:00 2001 From: Krzysztof Magosa Date: Thu, 31 Oct 2024 15:23:01 +0100 Subject: [PATCH] ability to set replicas (#49) * ability to set replicas --------- Co-authored-by: Roi Kramer --- README.md | 3 ++- main.tf | 8 ++++++++ variables.tf | 6 ++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b121203..eabf006 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,7 @@ module "kubernetes-controller" { | [node\_selector](#input\_node\_selector) | Specifies the node selector which must match a node's labels for the Ocean Controller resources to be scheduled on that node | `map(string)` | `null` | no | | [proxy\_url](#input\_proxy\_url) | Specifies the proxy server URL to communicate through | `string` | `null` | no | | [release\_name](#input\_release\_name) | Specifies the name of the Helm release | `string` | `"ocean-controller"` | no | +| [replicas](#input\_replicas) | Controls number of replicas | `number` | `null` | no | | [resources\_limits](#input\_resources\_limits) | Specifies the definition of the maximum amount of compute resources allowed | `map(any)` | `null` | no | | [resources\_requests](#input\_resources\_requests) | Specifies the definition of the minimum amount of compute resources required | `map(any)` | `null` | no | | [secret\_name](#input\_secret\_name) | Overrides the default secret name | `string` | `null` | no | @@ -58,7 +59,7 @@ module "kubernetes-controller" { | Name | Version | |------|---------| -| [helm](#provider\_helm) | >= 2.12.1 | +| [helm](#provider\_helm) | 2.12.1 | ## Requirements | Name | Version | diff --git a/main.tf b/main.tf index 077a40f..02f4dd1 100644 --- a/main.tf +++ b/main.tf @@ -176,4 +176,12 @@ resource "helm_release" "ocean-kubernetes-controller" { value = var.deploy_metrics_server } } + + dynamic "set" { + for_each = var.replicas != null ? [1] : [] + content { + name = "replicas" + value = var.replicas + } + } } diff --git a/variables.tf b/variables.tf index b69e3af..38970d3 100644 --- a/variables.tf +++ b/variables.tf @@ -214,3 +214,9 @@ variable "deploy_metrics_server" { description = "Controls whether the metrics server should be deployed" default = false } + +variable "replicas" { + type = number + description = "Controls number of replicas" + default = null +}