Skip to content

Commit

Permalink
k8s-at-home break out common helm values
Browse files Browse the repository at this point in the history
  • Loading branch information
FriedCircuits committed Feb 15, 2022
1 parent 4acb775 commit 6f92071
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 3 deletions.
23 changes: 20 additions & 3 deletions modules/k8s/k8s-at-home/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
36 changes: 36 additions & 0 deletions modules/k8s/k8s-at-home/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6f92071

Please sign in to comment.