diff --git a/modules/k8s/k8s-at-home/main.tf b/modules/k8s/k8s-at-home/main.tf index 87c85dd..8922d57 100644 --- a/modules/k8s/k8s-at-home/main.tf +++ b/modules/k8s/k8s-at-home/main.tf @@ -10,10 +10,27 @@ locals { merge(tomap({ env = merge({ TZ = var.timezone, - }, var.helm_envs) + }, + var.helm_envs) }), - var.helm_values, - )) + tomap({ + persistence = { + config = merge({ + enabled = var.persistence != {} ? true : false + }, + var.persistence)} + }), + tomap({ + ingress = { + main = merge({ + enabled = var.ingress != {} ? true : false + }, tomap({ + annotations = var.ingress_annotations}), + var.ingress)} + }), + var.helm_values + ) + ) } resource "helm_release" "k8s" { diff --git a/modules/k8s/k8s-at-home/variables.tf b/modules/k8s/k8s-at-home/variables.tf index 5427183..d34e536 100644 --- a/modules/k8s/k8s-at-home/variables.tf +++ b/modules/k8s/k8s-at-home/variables.tf @@ -31,6 +31,42 @@ variable "timezone" { default = "US/Pacific" } +variable "persistence" { + description = "Configure persistence volume on this deployment." + type = map(string) + default = {} + # Map of keys under the persistance.config value. See: https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common +# Example +# persistence = { +# mountPath = "/config" +# size = "20Gi" +# storageClass = "nfs-client" +# } +} + +variable "ingress" { + description = "Configure ingress on this deployment." + type = any + default = {} + # Map of keys under the ingress.main value. See: https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common +# Example +# ingress = { +# hosts = [{ +# host = "domain.example.com" +# paths = [{ +# path = "/" +# }] +# }] +# } +} + +variable "ingress_annotations" { + description = "Configure ingress annotations on this deployment." + type = map(string) + default = {} + # Map of keys under the ingress.main.annotations value. See: https://github.com/k8s-at-home/library-charts/tree/main/charts/stable/common +} + variable "helm_envs" { description = "Map of envs for helm chart. Merged with timezone." type = any