From fdc0613735b0bfbc1e3cf5b30cfa8f4c0684fefe Mon Sep 17 00:00:00 2001 From: Christian Kaenzig Date: Mon, 15 May 2023 09:37:27 +0200 Subject: [PATCH] feat: add variable for replicas (#40) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * feat: add variable for replicas * chore: move all chart values from values.yaml to locals.tf. * docs(terraform-docs): generate docs and write to README.adoc --------- Co-authored-by: ckaenzig Co-authored-by: Gonçalo Heleno <33546359+lentidas@users.noreply.github.com> --- README.adoc | 20 +++++++++++++++++--- aks/README.adoc | 14 ++++++++++++++ charts/traefik/values.yaml | 15 --------------- eks/README.adoc | 14 ++++++++++++++ kind/README.adoc | 14 ++++++++++++++ locals.tf | 17 +++++++++++++++++ nodeport/README.adoc | 14 ++++++++++++++ scaleway/README.adoc | 14 ++++++++++++++ sks/README.adoc | 14 ++++++++++++++ variables.tf | 6 ++++++ 10 files changed, 124 insertions(+), 18 deletions(-) diff --git a/README.adoc b/README.adoc index 776bc7c..c9e7633 100644 --- a/README.adoc +++ b/README.adoc @@ -5,12 +5,12 @@ The following providers are used by this module: +- [[provider_null]] <> + - [[provider_utils]] <> - [[provider_argocd]] <> -- [[provider_null]] <> - === Resources The following resources are used by this module: @@ -63,6 +63,14 @@ Type: `string` Default: `"traefik"` +==== [[input_replicas]] <> + +Description: Number of Traefik pods to be deployed. + +Type: `string` + +Default: `"2"` + ==== [[input_helm_values]] <> Description: Helm values, passed as a list of HCL structures. @@ -119,9 +127,9 @@ Description: n/a [cols="a,a",options="header,autowidth"] |=== |Name |Version -|[[provider_null]] <> |n/a |[[provider_utils]] <> |n/a |[[provider_argocd]] <> |n/a +|[[provider_null]] <> |n/a |=== = Resources @@ -171,6 +179,12 @@ Description: n/a |`"traefik"` |no +|[[input_replicas]] <> +|Number of Traefik pods to be deployed. +|`string` +|`"2"` +|no + |[[input_helm_values]] <> |Helm values, passed as a list of HCL structures. |`any` diff --git a/aks/README.adoc b/aks/README.adoc index 8ab1e75..fa98a72 100644 --- a/aks/README.adoc +++ b/aks/README.adoc @@ -79,6 +79,14 @@ Type: `string` Default: `"traefik"` +==== [[input_replicas]] <> + +Description: Number of Traefik pods to be deployed. + +Type: `string` + +Default: `"2"` + ==== [[input_helm_values]] <> Description: Helm values, passed as a list of HCL structures. @@ -203,6 +211,12 @@ Description: n/a |`"traefik"` |no +|[[input_replicas]] <> +|Number of Traefik pods to be deployed. +|`string` +|`"2"` +|no + |[[input_helm_values]] <> |Helm values, passed as a list of HCL structures. |`any` diff --git a/charts/traefik/values.yaml b/charts/traefik/values.yaml index 67745a0..ed97d53 100644 --- a/charts/traefik/values.yaml +++ b/charts/traefik/values.yaml @@ -1,16 +1 @@ --- -# -- Values passed to the Traefik chart -traefik: - deployment: - replicas: 2 - additionalArguments: - - --metrics.prometheus=true - - --serversTransport.insecureSkipVerify=true - logs: - access: - enabled: true - tlsOptions: - default: - minVersion: VersionTLS12 - middlewares: - redirections: {} diff --git a/eks/README.adoc b/eks/README.adoc index e3c5db9..063260a 100644 --- a/eks/README.adoc +++ b/eks/README.adoc @@ -53,6 +53,14 @@ Type: `string` Default: `"traefik"` +==== [[input_replicas]] <> + +Description: Number of Traefik pods to be deployed. + +Type: `string` + +Default: `"2"` + ==== [[input_helm_values]] <> Description: Helm values, passed as a list of HCL structures. @@ -147,6 +155,12 @@ Description: n/a |`"traefik"` |no +|[[input_replicas]] <> +|Number of Traefik pods to be deployed. +|`string` +|`"2"` +|no + |[[input_helm_values]] <> |Helm values, passed as a list of HCL structures. |`any` diff --git a/kind/README.adoc b/kind/README.adoc index f124c51..6bbe37e 100644 --- a/kind/README.adoc +++ b/kind/README.adoc @@ -65,6 +65,14 @@ Type: `string` Default: `"traefik"` +==== [[input_replicas]] <> + +Description: Number of Traefik pods to be deployed. + +Type: `string` + +Default: `"2"` + ==== [[input_helm_values]] <> Description: Helm values, passed as a list of HCL structures. @@ -179,6 +187,12 @@ Description: External IP address of Traefik LB service. |`"traefik"` |no +|[[input_replicas]] <> +|Number of Traefik pods to be deployed. +|`string` +|`"2"` +|no + |[[input_helm_values]] <> |Helm values, passed as a list of HCL structures. |`any` diff --git a/locals.tf b/locals.tf index 52b632d..b7b6683 100644 --- a/locals.tf +++ b/locals.tf @@ -1,6 +1,23 @@ locals { helm_values = [{ traefik = { + deployment = { + replicas = var.replicas + } + additionalArguments = [ + "--metrics.prometheus=true", + "--serversTransport.insecureSkipVerify=true" + ] + logs = { + access = { + enabled = true + } + } + tlsOptions = { + default = { + minVersion = "VersionTLS12" + } + } ressources = { limits = { cpu = "250m" diff --git a/nodeport/README.adoc b/nodeport/README.adoc index dee7182..4bf9d20 100644 --- a/nodeport/README.adoc +++ b/nodeport/README.adoc @@ -53,6 +53,14 @@ Type: `string` Default: `"traefik"` +==== [[input_replicas]] <> + +Description: Number of Traefik pods to be deployed. + +Type: `string` + +Default: `"2"` + ==== [[input_helm_values]] <> Description: Helm values, passed as a list of HCL structures. @@ -147,6 +155,12 @@ Description: n/a |`"traefik"` |no +|[[input_replicas]] <> +|Number of Traefik pods to be deployed. +|`string` +|`"2"` +|no + |[[input_helm_values]] <> |Helm values, passed as a list of HCL structures. |`any` diff --git a/scaleway/README.adoc b/scaleway/README.adoc index ead3b95..41e0efb 100644 --- a/scaleway/README.adoc +++ b/scaleway/README.adoc @@ -57,6 +57,14 @@ Type: `string` Default: `"traefik"` +==== [[input_replicas]] <> + +Description: Number of Traefik pods to be deployed. + +Type: `string` + +Default: `"2"` + ==== [[input_helm_values]] <> Description: Helm values, passed as a list of HCL structures. @@ -157,6 +165,12 @@ Description: n/a |`"traefik"` |no +|[[input_replicas]] <> +|Number of Traefik pods to be deployed. +|`string` +|`"2"` +|no + |[[input_helm_values]] <> |Helm values, passed as a list of HCL structures. |`any` diff --git a/sks/README.adoc b/sks/README.adoc index 3f7e4ba..2ce6fae 100644 --- a/sks/README.adoc +++ b/sks/README.adoc @@ -57,6 +57,14 @@ Type: `string` Default: `"traefik"` +==== [[input_replicas]] <> + +Description: Number of Traefik pods to be deployed. + +Type: `string` + +Default: `"2"` + ==== [[input_helm_values]] <> Description: Helm values, passed as a list of HCL structures. @@ -157,6 +165,12 @@ Description: n/a |`"traefik"` |no +|[[input_replicas]] <> +|Number of Traefik pods to be deployed. +|`string` +|`"2"` +|no + |[[input_helm_values]] <> |Helm values, passed as a list of HCL structures. |`any` diff --git a/variables.tf b/variables.tf index 8291a97..b3a782c 100644 --- a/variables.tf +++ b/variables.tf @@ -25,6 +25,12 @@ variable "namespace" { default = "traefik" } +variable "replicas" { + description = "Number of Traefik pods to be deployed." + type = string + default = "2" +} + variable "helm_values" { description = "Helm values, passed as a list of HCL structures." type = any