Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a subdomain variable #27

Merged
merged 7 commits into from
Feb 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -216,12 +216,12 @@ The following providers are used by this module:

- [[provider_random]] <<provider_random,random>> (>= 3)

- [[provider_null]] <<provider_null,null>>

- [[provider_utils]] <<provider_utils,utils>> (>= 1)

- [[provider_argocd]] <<provider_argocd,argocd>> (>= 5)

- [[provider_null]] <<provider_null,null>>

=== Resources

The following resources are used by this module:
Expand Down Expand Up @@ -253,6 +253,14 @@ Type: `string`

Default: `null`

==== [[input_subdomain]] <<input_subdomain,subdomain>>

Description: Subdomain of the cluster. Value used for the ingress' URL of the application.

Type: `string`

Default: `"apps"`

==== [[input_cluster_issuer]] <<input_cluster_issuer,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.
Expand Down Expand Up @@ -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]] <<input_helm_values,helm_values>>

Expand Down Expand Up @@ -615,6 +623,12 @@ Description: ID to pass other modules in order to refer to this module as a depe
|`null`
|no

|[[input_subdomain]] <<input_subdomain,subdomain>>
|Subdomain of the cluster. Value used for the ingress' URL of the application.
|`string`
|`"apps"`
|no

|[[input_cluster_issuer]] <<input_cluster_issuer,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`
Expand Down Expand Up @@ -642,7 +656,7 @@ Description: ID to pass other modules in order to refer to this module as a depe
|[[input_target_revision]] <<input_target_revision,target_revision>>
|Override of target revision of the application chart.
|`string`
|`"v3.2.0"`
|`"v3.2.1"`
|no

|[[input_helm_values]] <<input_helm_values,helm_values>>
Expand Down
5 changes: 2 additions & 3 deletions locals.tf
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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"
Expand Down
7 changes: 7 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,13 @@ variable "base_domain" {
default = null
}

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" {
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
Expand Down