diff --git a/README.adoc b/README.adoc index 9c07a2e..705565f 100644 --- a/README.adoc +++ b/README.adoc @@ -65,7 +65,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.1"` +Default: `"v6.2.0"` ==== [[input_enable_service_monitor]] <> @@ -123,6 +123,29 @@ Type: `number` Default: `2` +==== [[input_resources]] <> + +Description: Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +Type: +[source,hcl] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +Default: `{}` + ==== [[input_enable_https_redirection]] <> Description: Enable HTTP to HTTPS redirection on all ingresses. @@ -198,7 +221,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.1"` +|`"v6.2.0"` |no |[[input_enable_service_monitor]] <> @@ -251,6 +274,30 @@ object({ |`2` |no +|[[input_resources]] <> +|Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +| + +[source] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +|`{}` +|no + |[[input_enable_https_redirection]] <> |Enable HTTP to HTTPS redirection on all ingresses. |`bool` diff --git a/aks/README.adoc b/aks/README.adoc index b1eda2d..dd751fd 100644 --- a/aks/README.adoc +++ b/aks/README.adoc @@ -69,7 +69,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.1"` +Default: `"v6.2.0"` ==== [[input_enable_service_monitor]] <> @@ -127,6 +127,29 @@ Type: `number` Default: `2` +==== [[input_resources]] <> + +Description: Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +Type: +[source,hcl] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +Default: `{}` + ==== [[input_enable_https_redirection]] <> Description: Enable HTTP to HTTPS redirection on all ingresses. @@ -200,7 +223,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.1"` +|`"v6.2.0"` |no |[[input_enable_service_monitor]] <> @@ -253,6 +276,30 @@ object({ |`2` |no +|[[input_resources]] <> +|Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +| + +[source] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +|`{}` +|no + |[[input_enable_https_redirection]] <> |Enable HTTP to HTTPS redirection on all ingresses. |`bool` diff --git a/aks/main.tf b/aks/main.tf index 68f64e9..83d568a 100644 --- a/aks/main.tf +++ b/aks/main.tf @@ -1,12 +1,15 @@ module "traefik" { source = "../" - argocd_project = var.argocd_project - argocd_labels = var.argocd_labels - destination_cluster = var.destination_cluster - target_revision = var.target_revision - enable_service_monitor = var.enable_service_monitor - app_autosync = var.app_autosync + argocd_project = var.argocd_project + argocd_labels = var.argocd_labels + destination_cluster = var.destination_cluster + target_revision = var.target_revision + enable_service_monitor = var.enable_service_monitor + app_autosync = var.app_autosync + + replicas = var.replicas + resources = var.resources enable_https_redirection = var.enable_https_redirection helm_values = concat(local.helm_values, var.helm_values) diff --git a/eks/README.adoc b/eks/README.adoc index 2f4c313..5a4f862 100644 --- a/eks/README.adoc +++ b/eks/README.adoc @@ -53,7 +53,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.1"` +Default: `"v6.2.0"` ==== [[input_enable_service_monitor]] <> @@ -111,6 +111,29 @@ Type: `number` Default: `2` +==== [[input_resources]] <> + +Description: Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +Type: +[source,hcl] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +Default: `{}` + ==== [[input_enable_https_redirection]] <> Description: Enable HTTP to HTTPS redirection on all ingresses. @@ -172,7 +195,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.1"` +|`"v6.2.0"` |no |[[input_enable_service_monitor]] <> @@ -225,6 +248,30 @@ object({ |`2` |no +|[[input_resources]] <> +|Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +| + +[source] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +|`{}` +|no + |[[input_enable_https_redirection]] <> |Enable HTTP to HTTPS redirection on all ingresses. |`bool` diff --git a/eks/main.tf b/eks/main.tf index 1137d60..c3eba38 100644 --- a/eks/main.tf +++ b/eks/main.tf @@ -1,12 +1,15 @@ module "traefik" { source = "../nodeport/" - argocd_project = var.argocd_project - argocd_labels = var.argocd_labels - destination_cluster = var.destination_cluster - target_revision = var.target_revision - enable_service_monitor = var.enable_service_monitor - app_autosync = var.app_autosync + argocd_project = var.argocd_project + argocd_labels = var.argocd_labels + destination_cluster = var.destination_cluster + target_revision = var.target_revision + enable_service_monitor = var.enable_service_monitor + app_autosync = var.app_autosync + + replicas = var.replicas + resources = var.resources enable_https_redirection = var.enable_https_redirection helm_values = concat(local.helm_values, var.helm_values) diff --git a/kind/README.adoc b/kind/README.adoc index fdace57..6ccee73 100644 --- a/kind/README.adoc +++ b/kind/README.adoc @@ -65,7 +65,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.1"` +Default: `"v6.2.0"` ==== [[input_enable_service_monitor]] <> @@ -123,6 +123,29 @@ Type: `number` Default: `2` +==== [[input_resources]] <> + +Description: Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +Type: +[source,hcl] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +Default: `{}` + ==== [[input_enable_https_redirection]] <> Description: Enable HTTP to HTTPS redirection on all ingresses. @@ -204,7 +227,7 @@ Description: External IP address of Traefik LB service. |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.1"` +|`"v6.2.0"` |no |[[input_enable_service_monitor]] <> @@ -257,6 +280,30 @@ object({ |`2` |no +|[[input_resources]] <> +|Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +| + +[source] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +|`{}` +|no + |[[input_enable_https_redirection]] <> |Enable HTTP to HTTPS redirection on all ingresses. |`bool` diff --git a/kind/main.tf b/kind/main.tf index ab1e8f3..4fd57e9 100644 --- a/kind/main.tf +++ b/kind/main.tf @@ -1,12 +1,15 @@ module "traefik" { source = "../" - argocd_project = var.argocd_project - argocd_labels = var.argocd_labels - destination_cluster = var.destination_cluster - target_revision = var.target_revision - enable_service_monitor = var.enable_service_monitor - app_autosync = var.app_autosync + argocd_project = var.argocd_project + argocd_labels = var.argocd_labels + destination_cluster = var.destination_cluster + target_revision = var.target_revision + enable_service_monitor = var.enable_service_monitor + app_autosync = var.app_autosync + + replicas = var.replicas + resources = var.resources enable_https_redirection = var.enable_https_redirection helm_values = concat(local.helm_values, var.helm_values) diff --git a/locals.tf b/locals.tf index 932577a..f00c26f 100644 --- a/locals.tf +++ b/locals.tf @@ -35,15 +35,9 @@ locals { } } } : null - ressources = { # TODO: use var.resources instead and fix the typo in "reSSources" - limits = { - cpu = "250m" - memory = "512Mi" - } - requests = { - cpu = "125m" - memory = "256Mi" - } + resources = { + requests = { for k, v in var.resources.requests : k => v if v != null } + limits = { for k, v in var.resources.limits : k => v if v != null } } } }] diff --git a/nodeport/README.adoc b/nodeport/README.adoc index f2bf4e8..326e649 100644 --- a/nodeport/README.adoc +++ b/nodeport/README.adoc @@ -53,7 +53,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.1"` +Default: `"v6.2.0"` ==== [[input_enable_service_monitor]] <> @@ -111,6 +111,29 @@ Type: `number` Default: `2` +==== [[input_resources]] <> + +Description: Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +Type: +[source,hcl] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +Default: `{}` + ==== [[input_enable_https_redirection]] <> Description: Enable HTTP to HTTPS redirection on all ingresses. @@ -172,7 +195,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.1"` +|`"v6.2.0"` |no |[[input_enable_service_monitor]] <> @@ -225,6 +248,30 @@ object({ |`2` |no +|[[input_resources]] <> +|Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +| + +[source] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +|`{}` +|no + |[[input_enable_https_redirection]] <> |Enable HTTP to HTTPS redirection on all ingresses. |`bool` diff --git a/nodeport/main.tf b/nodeport/main.tf index 68f64e9..83d568a 100644 --- a/nodeport/main.tf +++ b/nodeport/main.tf @@ -1,12 +1,15 @@ module "traefik" { source = "../" - argocd_project = var.argocd_project - argocd_labels = var.argocd_labels - destination_cluster = var.destination_cluster - target_revision = var.target_revision - enable_service_monitor = var.enable_service_monitor - app_autosync = var.app_autosync + argocd_project = var.argocd_project + argocd_labels = var.argocd_labels + destination_cluster = var.destination_cluster + target_revision = var.target_revision + enable_service_monitor = var.enable_service_monitor + app_autosync = var.app_autosync + + replicas = var.replicas + resources = var.resources enable_https_redirection = var.enable_https_redirection helm_values = concat(local.helm_values, var.helm_values) diff --git a/scaleway/README.adoc b/scaleway/README.adoc index 2f4c313..5a4f862 100644 --- a/scaleway/README.adoc +++ b/scaleway/README.adoc @@ -53,7 +53,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.1"` +Default: `"v6.2.0"` ==== [[input_enable_service_monitor]] <> @@ -111,6 +111,29 @@ Type: `number` Default: `2` +==== [[input_resources]] <> + +Description: Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +Type: +[source,hcl] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +Default: `{}` + ==== [[input_enable_https_redirection]] <> Description: Enable HTTP to HTTPS redirection on all ingresses. @@ -172,7 +195,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.1"` +|`"v6.2.0"` |no |[[input_enable_service_monitor]] <> @@ -225,6 +248,30 @@ object({ |`2` |no +|[[input_resources]] <> +|Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +| + +[source] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +|`{}` +|no + |[[input_enable_https_redirection]] <> |Enable HTTP to HTTPS redirection on all ingresses. |`bool` diff --git a/scaleway/main.tf b/scaleway/main.tf index 1137d60..c3eba38 100644 --- a/scaleway/main.tf +++ b/scaleway/main.tf @@ -1,12 +1,15 @@ module "traefik" { source = "../nodeport/" - argocd_project = var.argocd_project - argocd_labels = var.argocd_labels - destination_cluster = var.destination_cluster - target_revision = var.target_revision - enable_service_monitor = var.enable_service_monitor - app_autosync = var.app_autosync + argocd_project = var.argocd_project + argocd_labels = var.argocd_labels + destination_cluster = var.destination_cluster + target_revision = var.target_revision + enable_service_monitor = var.enable_service_monitor + app_autosync = var.app_autosync + + replicas = var.replicas + resources = var.resources enable_https_redirection = var.enable_https_redirection helm_values = concat(local.helm_values, var.helm_values) diff --git a/sks/README.adoc b/sks/README.adoc index 5748c40..c4f1fd9 100644 --- a/sks/README.adoc +++ b/sks/README.adoc @@ -75,7 +75,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v6.1.1"` +Default: `"v6.2.0"` ==== [[input_enable_service_monitor]] <> @@ -133,6 +133,29 @@ Type: `number` Default: `2` +==== [[input_resources]] <> + +Description: Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +Type: +[source,hcl] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +Default: `{}` + ==== [[input_enable_https_redirection]] <> Description: Enable HTTP to HTTPS redirection on all ingresses. @@ -212,7 +235,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v6.1.1"` +|`"v6.2.0"` |no |[[input_enable_service_monitor]] <> @@ -265,6 +288,30 @@ object({ |`2` |no +|[[input_resources]] <> +|Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + +IMPORTANT: These are not production values. You should always adjust them to your needs. + +| + +[source] +---- +object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) +---- + +|`{}` +|no + |[[input_enable_https_redirection]] <> |Enable HTTP to HTTPS redirection on all ingresses. |`bool` diff --git a/sks/main.tf b/sks/main.tf index 68f64e9..83d568a 100644 --- a/sks/main.tf +++ b/sks/main.tf @@ -1,12 +1,15 @@ module "traefik" { source = "../" - argocd_project = var.argocd_project - argocd_labels = var.argocd_labels - destination_cluster = var.destination_cluster - target_revision = var.target_revision - enable_service_monitor = var.enable_service_monitor - app_autosync = var.app_autosync + argocd_project = var.argocd_project + argocd_labels = var.argocd_labels + destination_cluster = var.destination_cluster + target_revision = var.target_revision + enable_service_monitor = var.enable_service_monitor + app_autosync = var.app_autosync + + replicas = var.replicas + resources = var.resources enable_https_redirection = var.enable_https_redirection helm_values = concat(local.helm_values, var.helm_values) diff --git a/variables.tf b/variables.tf index a2aeaeb..1c87516 100644 --- a/variables.tf +++ b/variables.tf @@ -68,6 +68,25 @@ variable "replicas" { default = 2 } +variable "resources" { + description = <<-EOT + Resource limits and requests for Traefik's pods. Follow the style on https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/[official documentation] to understand the format of the values. + + IMPORTANT: These are not production values. You should always adjust them to your needs. + EOT + type = object({ + requests = optional(object({ + cpu = optional(string, "150m") + memory = optional(string, "128Mi") + }), {}) + limits = optional(object({ + cpu = optional(string) + memory = optional(string, "256Mi") + }), {}) + }) + default = {} +} + variable "enable_https_redirection" { description = "Enable HTTP to HTTPS redirection on all ingresses." type = bool