diff --git a/README.adoc b/README.adoc index 567849e8..5a372702 100644 --- a/README.adoc +++ b/README.adoc @@ -38,10 +38,10 @@ The following providers are used by this module: - [[provider_null]] <> (>= 3) -- [[provider_argocd]] <> (>= 5) - - [[provider_random]] <> (>= 3) +- [[provider_argocd]] <> (>= 5) + - [[provider_utils]] <> (>= 1) === Resources @@ -76,6 +76,14 @@ Type: `string` The following input variables are optional (have default values): +==== [[input_subdomain]] <> + +Description: Subdomain of the cluster. Value used for the ingress' URL of the application. + +Type: `string` + +Default: `"apps"` + ==== [[input_argocd_project]] <> Description: Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. @@ -106,7 +114,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v3.1.0"` +Default: `"v3.2.0"` ==== [[input_cluster_issuer]] <> @@ -219,10 +227,10 @@ Description: ID to pass other modules in order to refer to this module as a depe [cols="a,a",options="header,autowidth"] |=== |Name |Version +|[[provider_null]] <> |>= 3 |[[provider_random]] <> |>= 3 |[[provider_utils]] <> |>= 1 |[[provider_argocd]] <> |>= 5 -|[[provider_null]] <> |>= 3 |=== = Resources @@ -256,6 +264,12 @@ Description: ID to pass other modules in order to refer to this module as a depe |n/a |yes +|[[input_subdomain]] <> +|Subdomain of the cluster. Value used for the ingress' URL of the application. +|`string` +|`"apps"` +|no + |[[input_argocd_project]] <> |Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. |`string` @@ -277,7 +291,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.1.0"` +|`"v3.2.0"` |no |[[input_cluster_issuer]] <> diff --git a/aks/README.adoc b/aks/README.adoc index 9a0f8695..fdc54895 100644 --- a/aks/README.adoc +++ b/aks/README.adoc @@ -280,6 +280,14 @@ Type: `string` The following input variables are optional (have default values): +==== [[input_subdomain]] <> + +Description: Subdomain of the cluster. Value used for the ingress' URL of the application. + +Type: `string` + +Default: `"apps"` + ==== [[input_argocd_project]] <> Description: Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. @@ -310,7 +318,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v3.1.0"` +Default: `"v3.2.0"` ==== [[input_cluster_issuer]] <> @@ -483,6 +491,12 @@ object({ |n/a |yes +|[[input_subdomain]] <> +|Subdomain of the cluster. Value used for the ingress' URL of the application. +|`string` +|`"apps"` +|no + |[[input_argocd_project]] <> |Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. |`string` @@ -504,7 +518,7 @@ object({ |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v3.1.0"` +|`"v3.2.0"` |no |[[input_cluster_issuer]] <> diff --git a/aks/main.tf b/aks/main.tf index ae9bad7b..2ad1bec7 100644 --- a/aks/main.tf +++ b/aks/main.tf @@ -61,6 +61,7 @@ module "thanos" { cluster_name = var.cluster_name base_domain = var.base_domain + subdomain = var.subdomain argocd_project = var.argocd_project argocd_labels = var.argocd_labels destination_cluster = var.destination_cluster diff --git a/eks/README.adoc b/eks/README.adoc index 9fc89d2c..241cfa61 100644 --- a/eks/README.adoc +++ b/eks/README.adoc @@ -273,6 +273,14 @@ Type: `string` The following input variables are optional (have default values): +==== [[input_subdomain]] <> + +Description: Subdomain of the cluster. Value used for the ingress' URL of the application. + +Type: `string` + +Default: `"apps"` + ==== [[input_argocd_project]] <> Description: Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. @@ -303,7 +311,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v3.1.0"` +Default: `"v3.2.0"` ==== [[input_cluster_issuer]] <> @@ -452,6 +460,12 @@ object({ |n/a |yes +|[[input_subdomain]] <> +|Subdomain of the cluster. Value used for the ingress' URL of the application. +|`string` +|`"apps"` +|no + |[[input_argocd_project]] <> |Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. |`string` @@ -473,7 +487,7 @@ object({ |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v3.1.0"` +|`"v3.2.0"` |no |[[input_cluster_issuer]] <> diff --git a/eks/main.tf b/eks/main.tf index d638c08a..60cc0ade 100644 --- a/eks/main.tf +++ b/eks/main.tf @@ -3,6 +3,7 @@ module "thanos" { cluster_name = var.cluster_name base_domain = var.base_domain + subdomain = var.subdomain argocd_project = var.argocd_project argocd_labels = var.argocd_labels destination_cluster = var.destination_cluster diff --git a/kind/README.adoc b/kind/README.adoc index 6d27a4f6..b8bafead 100644 --- a/kind/README.adoc +++ b/kind/README.adoc @@ -207,6 +207,14 @@ Type: `string` The following input variables are optional (have default values): +==== [[input_subdomain]] <> + +Description: Subdomain of the cluster. Value used for the ingress' URL of the application. + +Type: `string` + +Default: `"apps"` + ==== [[input_argocd_project]] <> Description: Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. @@ -237,7 +245,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v3.1.0"` +Default: `"v3.2.0"` ==== [[input_cluster_issuer]] <> @@ -388,6 +396,12 @@ object({ |n/a |yes +|[[input_subdomain]] <> +|Subdomain of the cluster. Value used for the ingress' URL of the application. +|`string` +|`"apps"` +|no + |[[input_argocd_project]] <> |Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. |`string` @@ -409,7 +423,7 @@ object({ |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v3.1.0"` +|`"v3.2.0"` |no |[[input_cluster_issuer]] <> diff --git a/kind/main.tf b/kind/main.tf index d638c08a..60cc0ade 100644 --- a/kind/main.tf +++ b/kind/main.tf @@ -3,6 +3,7 @@ module "thanos" { cluster_name = var.cluster_name base_domain = var.base_domain + subdomain = var.subdomain argocd_project = var.argocd_project argocd_labels = var.argocd_labels destination_cluster = var.destination_cluster diff --git a/locals.tf b/locals.tf index a8623750..553b8d8f 100644 --- a/locals.tf +++ b/locals.tf @@ -73,7 +73,7 @@ locals { resources = local.thanos.compactor_resources persistence = { # The Access Mode needs to be set as ReadWriteOnce because AWS Elastic Block storage does not support other - # modes (https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes). + # modes (https://kubernetes.io/docs/concepts/storage/persistent-volumes/#access-modes). # Since the compactor is the only pod accessing this volume, there should be no issue to have this as # ReadWriteOnce (https://stackoverflow.com/a/57799347). accessModes = [ @@ -118,7 +118,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" @@ -127,7 +126,7 @@ locals { hostname = "" extraRules = [ { - host = "thanos-bucketweb.apps.${var.base_domain}" + host = "thanos-bucketweb.${trimprefix("${var.subdomain}.${var.base_domain}", ".")}" http = { paths = [ { @@ -168,7 +167,7 @@ locals { extraTls = [{ secretName = "thanos-bucketweb-tls" hosts = [ - "thanos-bucketweb.apps.${var.base_domain}", + "thanos-bucketweb.${trimprefix("${var.subdomain}.${var.base_domain}", ".")}", "${local.thanos.bucketweb_domain}" ] }] @@ -261,7 +260,7 @@ locals { hostname = "" extraRules = [ { - host = "thanos-query.apps.${var.base_domain}" + host = "thanos-query.${trimprefix("${var.subdomain}.${var.base_domain}", ".")}" http = { paths = [ { @@ -302,7 +301,7 @@ locals { extraTls = [{ secretName = "thanos-query-tls" hosts = [ - "thanos-query.apps.${var.base_domain}", + "thanos-query.${trimprefix("${var.subdomain}.${var.base_domain}", ".")}", "${local.thanos.query_domain}" ] }] @@ -316,8 +315,8 @@ locals { }] thanos_defaults = { - query_domain = "thanos-query.apps.${var.cluster_name}.${var.base_domain}" - bucketweb_domain = "thanos-bucketweb.apps.${var.cluster_name}.${var.base_domain}" + query_domain = "thanos-query.${trimprefix("${var.subdomain}.${var.cluster_name}", ".")}.${var.base_domain}" + bucketweb_domain = "thanos-bucketweb.${trimprefix("${var.subdomain}.${var.cluster_name}", ".")}.${var.base_domain}" # TODO Create proper Terraform variables for these values instead of bundling everything inside of these locals diff --git a/sks/README.adoc b/sks/README.adoc index c28d8764..8243ea99 100644 --- a/sks/README.adoc +++ b/sks/README.adoc @@ -156,6 +156,14 @@ Type: `string` The following input variables are optional (have default values): +==== [[input_subdomain]] <> + +Description: Subdomain of the cluster. Value used for the ingress' URL of the application. + +Type: `string` + +Default: `"apps"` + ==== [[input_argocd_project]] <> Description: Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. @@ -186,7 +194,7 @@ Description: Override of target revision of the application chart. Type: `string` -Default: `"v3.1.0"` +Default: `"v3.2.0"` ==== [[input_cluster_issuer]] <> @@ -342,6 +350,12 @@ object({ |n/a |yes +|[[input_subdomain]] <> +|Subdomain of the cluster. Value used for the ingress' URL of the application. +|`string` +|`"apps"` +|no + |[[input_argocd_project]] <> |Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application. |`string` @@ -363,7 +377,7 @@ object({ |[[input_target_revision]] <> |Override of target revision of the application chart. |`string` -|`"v3.1.0"` +|`"v3.2.0"` |no |[[input_cluster_issuer]] <> diff --git a/sks/main.tf b/sks/main.tf index d638c08a..60cc0ade 100644 --- a/sks/main.tf +++ b/sks/main.tf @@ -3,6 +3,7 @@ module "thanos" { cluster_name = var.cluster_name base_domain = var.base_domain + subdomain = var.subdomain argocd_project = var.argocd_project argocd_labels = var.argocd_labels destination_cluster = var.destination_cluster diff --git a/variables.tf b/variables.tf index 673b44de..6eae4716 100644 --- a/variables.tf +++ b/variables.tf @@ -12,6 +12,13 @@ variable "base_domain" { type = string } +variable "subdomain" { + description = "Subdomain of the cluster. Value used for the ingress' URL of the application." + type = string + default = "apps" + nullable = false +} + variable "argocd_project" { description = "Name of the Argo CD AppProject where the Application should be created. If not set, the Application will be created in a new AppProject only for this Application." type = string