add the option for hostpath as well

This commit is contained in:
2024-12-11 21:55:59 +00:00
parent 63abbfebbe
commit d61d080e5e
2 changed files with 18 additions and 8 deletions
+12 -3
View File
@@ -13,8 +13,9 @@ variable "kubernetes" {
image = string image = string
pvc = optional(map(object({ pvc = optional(map(object({
name = string name = string
pvc = optional(bool) pvc = optional(bool,false)
config_map = optional(bool,false) config_map = optional(bool, false)
host_path = optional(string)
pvc_size = optional(string) pvc_size = optional(string)
mount_path = string mount_path = string
}))) })))
@@ -395,10 +396,18 @@ resource "kubernetes_deployment_v1" "automatic" {
dynamic "config_map" { dynamic "config_map" {
for_each = volume.value.config_map ? [1] : [] for_each = volume.value.config_map ? [1] : []
content { content {
name = "${volume.value.name}" name = volume.value.name
} }
} }
dynamic "host_path" {
for_each = volume.value.host_path != null ? [1] : []
content {
path = volume.value.host_path
}
}
} }
} }
+5 -4
View File
@@ -355,13 +355,14 @@ kubernetes = {
} }
media = { media = {
pvc = false pvc = false
config_map = true config_map = true
name = "media" name = "gitea-runner-configfile"
pvc_size = "2Mi" pvc_size = "2Mi"
mount_path = "/usr/src/paperless/media" mount_path = "/tmp/usr/src/paperless/media"
} }
export = { export = {
pvc = true # pvc = true
host_path = "/tmp"
name = "export" name = "export"
pvc_size = "2Mi" pvc_size = "2Mi"
mount_path = "/usr/src/paperless/export" mount_path = "/usr/src/paperless/export"