From bb1f55cd91883435275e5d1571753a47cec76fd2 Mon Sep 17 00:00:00 2001 From: Lenny Consuegra Date: Wed, 31 Jan 2024 11:34:55 +0100 Subject: [PATCH 1/7] feat: add a subdomain variable --- locals.tf | 4 ++-- variables.tf | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/locals.tf b/locals.tf index 1cf99b2..5e8bd84 100644 --- a/locals.tf +++ b/locals.tf @@ -1,6 +1,6 @@ locals { - domain = format("longhorn.apps.%s", var.base_domain) - domain_full = format("longhorn.apps.%s.%s", var.cluster_name, var.base_domain) + domain = format("longhorn.%s", trimprefix("${var.subdomain}.${var.base_domain}", ".")) + domain_full = format("longhorn.%s.%s", trimprefix("${var.subdomain}.${var.cluster_name}", "."), var.base_domain) # Generate a list of tolerations in a string format of `key=value:effect` for all the tolerations that have # an `operator` equal to `Equal`. This list of strings will be joined to pass as the value of diff --git a/variables.tf b/variables.tf index 80b8faa..70e6c2d 100644 --- a/variables.tf +++ b/variables.tf @@ -14,6 +14,12 @@ variable "base_domain" { default = null } +variable "subdomain" { + description = "Sub domain of the cluster. Value used for the ingress' URL of the application." + type = string + default = "apps" +} + variable "cluster_issuer" { description = "SSL certificate issuer to use. Usually you would configure this value as `letsencrypt-staging` or `letsencrypt-prod` on your root `*.tf` files." type = string From d919f188e30cccf73a53c1c1f417eba6dd18f5cf Mon Sep 17 00:00:00 2001 From: lconsuegra Date: Wed, 31 Jan 2024 10:46:31 +0000 Subject: [PATCH 2/7] docs(terraform-docs): generate docs and write to README.adoc --- README.adoc | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 61c2783..3769e02 100644 --- a/README.adoc +++ b/README.adoc @@ -253,6 +253,14 @@ Type: `string` Default: `null` +==== [[input_subdomain]] <> + +Description: Sub domain of the cluster. Value used for the ingress' URL of the application. + +Type: `string` + +Default: `"apps"` + ==== [[input_cluster_issuer]] <> Description: SSL certificate issuer to use. Usually you would configure this value as `letsencrypt-staging` or `letsencrypt-prod` on your root `*.tf` files. @@ -291,7 +299,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v3.2.0"` +Default: `"v3.2.1"` ==== [[input_helm_values]] <> @@ -615,6 +623,12 @@ Description: ID to pass other modules in order to refer to this module as a depe |`null` |no +|[[input_subdomain]] <> +|Sub domain of the cluster. Value used for the ingress' URL of the application. +|`string` +|`"apps"` +|no + |[[input_cluster_issuer]] <> |SSL certificate issuer to use. Usually you would configure this value as `letsencrypt-staging` or `letsencrypt-prod` on your root `*.tf` files. |`string` @@ -642,7 +656,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` -|`"v3.2.0"` +|`"v3.2.1"` |no |[[input_helm_values]] <> From a5a489657599a2bec960bcc5c07539cd47019584 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Heleno?= Date: Tue, 20 Feb 2024 16:27:16 +0100 Subject: [PATCH 3/7] docs: fix typo --- variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/variables.tf b/variables.tf index 70e6c2d..619f118 100644 --- a/variables.tf +++ b/variables.tf @@ -15,7 +15,7 @@ variable "base_domain" { } variable "subdomain" { - description = "Sub domain of the cluster. Value used for the ingress' URL of the application." + description = "Subdomain of the cluster. Value used for the ingress' URL of the application." type = string default = "apps" } From e27726cadbf113b726bf2fdf2ff48b2d985d44f3 Mon Sep 17 00:00:00 2001 From: lentidas Date: Tue, 20 Feb 2024 15:27:44 +0000 Subject: [PATCH 4/7] docs(terraform-docs): generate docs and write to README.adoc --- README.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index 3769e02..df8d2d6 100644 --- a/README.adoc +++ b/README.adoc @@ -255,7 +255,7 @@ Default: `null` ==== [[input_subdomain]] <> -Description: Sub domain of the cluster. Value used for the ingress' URL of the application. +Description: Subdomain of the cluster. Value used for the ingress' URL of the application. Type: `string` @@ -624,7 +624,7 @@ Description: ID to pass other modules in order to refer to this module as a depe |no |[[input_subdomain]] <> -|Sub domain of the cluster. Value used for the ingress' URL of the application. +|Subdomain of the cluster. Value used for the ingress' URL of the application. |`string` |`"apps"` |no From b56d2443595c206b1d009944fb1da070918235a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Heleno?= Date: Wed, 21 Feb 2024 09:42:54 +0100 Subject: [PATCH 5/7] fix: make subdomain variable non-nullable --- variables.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/variables.tf b/variables.tf index 619f118..f12e794 100644 --- a/variables.tf +++ b/variables.tf @@ -18,6 +18,7 @@ variable "subdomain" { description = "Subdomain of the cluster. Value used for the ingress' URL of the application." type = string default = "apps" + nullable = false } variable "cluster_issuer" { From 5759991dc742ae602a9d5b20926e4932ab54279c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Heleno?= Date: Fri, 23 Feb 2024 10:49:46 +0100 Subject: [PATCH 6/7] fix: remove annotation for the redirection middleware --- locals.tf | 1 - 1 file changed, 1 deletion(-) diff --git a/locals.tf b/locals.tf index 5e8bd84..10c7694 100644 --- a/locals.tf +++ b/locals.tf @@ -58,7 +58,6 @@ locals { annotations = { "cert-manager.io/cluster-issuer" = "${var.cluster_issuer}" "traefik.ingress.kubernetes.io/router.entrypoints" = "websecure" - "traefik.ingress.kubernetes.io/router.middlewares" = "traefik-withclustername@kubernetescrd" "traefik.ingress.kubernetes.io/router.tls" = "true" "ingress.kubernetes.io/ssl-redirect" = "true" "kubernetes.io/ingress.allow-http" = "false" From 9f95681766cbdbaf7c445ad17eb7fe0500a6c4b0 Mon Sep 17 00:00:00 2001 From: lentidas Date: Fri, 23 Feb 2024 09:51:31 +0000 Subject: [PATCH 7/7] docs(terraform-docs): generate docs and write to README.adoc --- README.adoc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.adoc b/README.adoc index df8d2d6..80043f1 100644 --- a/README.adoc +++ b/README.adoc @@ -216,12 +216,12 @@ The following providers are used by this module: - [[provider_random]] <> (>= 3) +- [[provider_null]] <> + - [[provider_utils]] <> (>= 1) - [[provider_argocd]] <> (>= 5) -- [[provider_null]] <> - === Resources The following resources are used by this module: