This commit is contained in:
pierre.geeraert
2026-10-14 16:13:11 +01:00
parent 7321c766f4
commit c0c0c8e309
6 changed files with 79 additions and 71 deletions
@@ -11,3 +11,11 @@ metadata:
name: paperless-credentials
namespace: paperless
type: Opaque
name paperless__secret__paperless-credentials
PAPERLESS_ADMIN_USER:
PAPERLESS_ADMIN_PASSWORD:
notes paperless-credentials
+7 -7
View File
@@ -1,6 +1,6 @@
variable "kubernetes_input" {
type = map(object({
name = optional(string)
name = optional(string)
environment = optional(map(object({
name = optional(string)
value = optional(string)
@@ -11,12 +11,12 @@ variable "kubernetes_input" {
})
}))
})))
replicas = optional(number, 1)
namespace = optional(string)
connected_namespace = optional(string, "")
database = optional(map(string))
database_args = optional(list(string))
enabled = optional(bool, true)
replicas = optional(number, 1)
namespace = optional(string)
connected_namespace = optional(string, "")
database = optional(map(string))
database_args = optional(list(string))
enabled = optional(bool, true)
}))
}
+28 -28
View File
@@ -1,30 +1,30 @@
variable "kubernetes_input" {
type = map(object({
name = optional(string)
image = string
pvc = optional(map(object({
name = optional(string)
pvc = optional(bool, false)
config_map = optional(bool, false)
secret = optional(bool, false)
host_path = optional(string)
pvc_size = optional(string)
storage_class_name = optional(string, "nfs-storage-intelligent")
annotations_fileType = optional(string)
existing_pvc = optional(bool, false)
mount_path = string
sub_path = optional(string)
})))
environment = optional(map(object({
name = optional(string)
value = optional(string)
value_from = optional(object({
secret_key_ref = object({
name = string
key = optional(string, null)
})
}))
})))
name = optional(string)
image = string
pvc = optional(map(object({
name = optional(string)
pvc = optional(bool, false)
config_map = optional(bool, false)
secret = optional(bool, false)
host_path = optional(string)
pvc_size = optional(string)
storage_class_name = optional(string, "nfs-storage-intelligent")
annotations_fileType = optional(string)
existing_pvc = optional(bool, false)
mount_path = string
sub_path = optional(string)
})))
environment = optional(map(object({
name = optional(string)
value = optional(string)
value_from = optional(object({
secret_key_ref = object({
name = string
key = optional(string, null)
})
}))
})))
replicas = optional(number, 1)
namespace = optional(string)
connected_namespace = optional(string, "")
@@ -38,9 +38,9 @@ variable "kubernetes_input" {
secret_ref = optional(list(string))
config_map_ref = optional(list(string))
requirements = optional(map(string))
dns_nameservers = optional(string)
service_account_name = optional(string)
security_context = optional(bool, false)
dns_nameservers = optional(string)
service_account_name = optional(string)
security_context = optional(bool, false)
}))
+15 -15
View File
@@ -1,6 +1,6 @@
variable "kubernetes_input" {
type = map(object({
name = optional(string)
name = optional(string)
environment = optional(map(object({
name = optional(string)
value = optional(string)
@@ -11,11 +11,11 @@ variable "kubernetes_input" {
})
}))
})))
replicas = optional(number, 1)
namespace = optional(string)
connected_namespace = optional(string, "")
redis = optional(map(string))
enabled = optional(bool, true)
replicas = optional(number, 1)
namespace = optional(string)
connected_namespace = optional(string, "")
redis = optional(map(string))
enabled = optional(bool, true)
}))
}
@@ -28,12 +28,12 @@ variable "storage_path" {
}
resource "kubernetes_deployment_v1" "redis-automatic" {
for_each = {for key, value in var.kubernetes_input : key => value if value.redis != null && value.enabled == true}
for_each = { for key, value in var.kubernetes_input : key => value if value.redis != null && value.enabled == true }
metadata {
namespace = coalesce(each.value.namespace, each.value.connected_namespace, each.key)
name = "${coalesce(each.value.name, each.key)}-redis"
name = "${coalesce(each.value.name, each.key)}-redis"
labels = {
app = each.key
deployment_method = "Terraform"
@@ -62,7 +62,7 @@ resource "kubernetes_deployment_v1" "redis-automatic" {
spec {
container {
image = try(each.value.redis.image, "docker.io/library/redis:7")
name = "${coalesce(each.value.name, each.key)}-redis"
name = "${coalesce(each.value.name, each.key)}-redis"
port {
container_port = 6379
@@ -97,13 +97,13 @@ resource "kubernetes_deployment_v1" "redis-automatic" {
}
}
volume {
name = "${each.key}-redis-volume"
host_path {
path = try(each.value.redis.host_path, join("/", [var.storage_path.main_storage, coalesce(each.value.namespace, each.value.connected_namespace, each.key), join("-", [each.key, "redis"])]))
}
volume {
name = "${each.key}-redis-volume"
host_path {
path = try(each.value.redis.host_path, join("/", [var.storage_path.main_storage, coalesce(each.value.namespace, each.value.connected_namespace, each.key), join("-", [each.key, "redis"])]))
}
}
}
}
}
}
}
+13 -13
View File
@@ -17,19 +17,19 @@ provider "bitwarden-secrets" {
variable "kubernetes_input" {
type = map(object({
namespace = optional(string)
connected_namespace = optional(string, "")
database = optional(map(string))
redis = optional(map(string))
enabled = optional(bool, true)
config_map_import = optional(list(string))
secret_import = optional(list(string))
requirements = optional(map(string), {
limits-cpu = "800m"
limits-memory = "500Mi"
requests-cpu = "200m"
requests-memory = "200Mi"
})
namespace = optional(string)
connected_namespace = optional(string, "")
database = optional(map(string))
redis = optional(map(string))
enabled = optional(bool, true)
config_map_import = optional(list(string))
secret_import = optional(list(string))
requirements = optional(map(string), {
limits-cpu = "800m"
limits-memory = "500Mi"
requests-cpu = "200m"
requests-memory = "200Mi"
})
import_database_secret = optional(object({
#putting them a non optional as the code doesn't allow optional value
host = string
+8 -8
View File
@@ -1,13 +1,13 @@
variable "kubernetes_input" {
type = map(object({
docker = optional(bool)
namespace = optional(string)
connected_namespace = optional(string, "")
service_port = optional(list(number))
service_type = optional(string, "ClusterIP")
database = optional(map(string))
redis = optional(map(string))
enabled = optional(bool, true)
docker = optional(bool)
namespace = optional(string)
connected_namespace = optional(string, "")
service_port = optional(list(number))
service_type = optional(string, "ClusterIP")
database = optional(map(string))
redis = optional(map(string))
enabled = optional(bool, true)
}))