Compare commits
2
Commits
ad69271f01
...
594d0af218
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
594d0af218 | ||
|
|
b778662fa5 |
@@ -22,6 +22,7 @@ variable "kubernetes" {
|
|||||||
annotations_fileType = optional(string)
|
annotations_fileType = optional(string)
|
||||||
existing_pvc = optional(bool, false)
|
existing_pvc = optional(bool, false)
|
||||||
mount_path = string
|
mount_path = string
|
||||||
|
sub_path = optional(string)
|
||||||
})))
|
})))
|
||||||
environment = optional(map(object({
|
environment = optional(map(object({
|
||||||
name = optional(string)
|
name = optional(string)
|
||||||
@@ -65,9 +66,10 @@ variable "kubernetes" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
pvc_details = flatten([
|
pvc_list = flatten([
|
||||||
for key, value in var.kubernetes : [
|
for key, value in var.kubernetes : [
|
||||||
for index, pvc in value.pvc : {
|
for index, pvc in value.pvc : {
|
||||||
|
key = "${coalesce(value.namespace, value.connected_namespace, key)}/${pvc.name}"
|
||||||
index = index
|
index = index
|
||||||
pvc = pvc.pvc
|
pvc = pvc.pvc
|
||||||
name = pvc.name
|
name = pvc.name
|
||||||
@@ -76,9 +78,24 @@ locals {
|
|||||||
storage_class_name = pvc.storage_class_name
|
storage_class_name = pvc.storage_class_name
|
||||||
annotations_fileType = pvc.annotations_fileType
|
annotations_fileType = pvc.annotations_fileType
|
||||||
existing_pvc = pvc.existing_pvc
|
existing_pvc = pvc.existing_pvc
|
||||||
|
sub_path = pvc.sub_path
|
||||||
namespace = coalesce(value.namespace, value.connected_namespace, key)
|
namespace = coalesce(value.namespace, value.connected_namespace, key)
|
||||||
}] if value.enabled == true && value.pvc != null
|
}] if value.enabled == true && value.pvc != null
|
||||||
])
|
])
|
||||||
|
|
||||||
|
# group duplicates instead of throwing an error
|
||||||
|
pvc_map_grouped = {
|
||||||
|
for p in local.pvc_list :
|
||||||
|
p.key => p...
|
||||||
|
}
|
||||||
|
|
||||||
|
# keep only one PVC per key (take the first)
|
||||||
|
pvc_map = {
|
||||||
|
for k, list in local.pvc_map_grouped :
|
||||||
|
k => list[0]
|
||||||
|
}
|
||||||
|
|
||||||
|
pvc_details = values(local.pvc_map)
|
||||||
}
|
}
|
||||||
|
|
||||||
locals {
|
locals {
|
||||||
@@ -332,6 +349,7 @@ resource "kubernetes_deployment_v1" "automatic" {
|
|||||||
content {
|
content {
|
||||||
mount_path = volume_mount.value.mount_path
|
mount_path = volume_mount.value.mount_path
|
||||||
name = "${volume_mount.value.name}-pvc"
|
name = "${volume_mount.value.name}-pvc"
|
||||||
|
sub_path = volume_mount.value.sub_path != null ? volume_mount.value.sub_path : ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+67
-49
@@ -2082,84 +2082,102 @@ kubernetes = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bitwardent = {
|
bitwarden-admin = {
|
||||||
enabled = false
|
#enabled = false
|
||||||
|
namespace = "bitwardent"
|
||||||
replicas = 0
|
replicas = 0
|
||||||
name = "bitwarden-admin"
|
name = "bitwarden-admin"
|
||||||
image = "bitwarden/admin:2024.5.0"
|
image = "bitwarden/admin:2024.5.0"
|
||||||
extra_manifest = ["/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/config.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/global.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/global.override.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/kube-root-ca.crt.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/mssql.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/mssql.override.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/uid.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/bitwarden-identity-cert-password.secret.yml"]
|
extra_manifest = ["/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/config.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/global.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/global.override.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/mssql.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/mssql.override.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/uid.env.configmap.yml", "/opt/kubernetes/Terraform_kube/external_manifests/bitwarden/bitwarden-identity-cert-password.secret.yml"]
|
||||||
service_port = [5000]
|
service_port = [5000]
|
||||||
|
config_map_ref = ["global.env","uid.env","global.override.env"]
|
||||||
environment = {}
|
environment = {}
|
||||||
|
|
||||||
pvc = {
|
pvc = {
|
||||||
bitwarden-ca-certificates = {
|
bitwarden-ca-certificates = {
|
||||||
pvc = true
|
pvc = true
|
||||||
pvc_size = "2Mi"
|
pvc_size = "2Mi"
|
||||||
mount_path = "/config"
|
mount_path = "/etc/bitwarden/ca-certificates"
|
||||||
name = "bitwarden-ca-certificates"
|
name = "bitwarden-ca-certificates"
|
||||||
}
|
}
|
||||||
|
|
||||||
bitwarden-core = {
|
bitwarden-core = {
|
||||||
pvc = true
|
pvc = true
|
||||||
pvc_size = "2Mi"
|
pvc_size = "2Mi"
|
||||||
mount_path = "/config"
|
mount_path = "/etc/bitwarden/core"
|
||||||
name = "bitwarden-core"
|
name = "bitwarden-core"
|
||||||
}
|
}
|
||||||
|
|
||||||
bitwarden-identity = {
|
|
||||||
pvc = true
|
|
||||||
pvc_size = "2Mi"
|
|
||||||
mount_path = "/config"
|
|
||||||
name = "bitwarden-identity"
|
|
||||||
}
|
|
||||||
|
|
||||||
bitwarden-letsencrypt = {
|
|
||||||
pvc = true
|
|
||||||
pvc_size = "2Mi"
|
|
||||||
mount_path = "/config"
|
|
||||||
name = "bitwarden-letsencrypt"
|
|
||||||
}
|
|
||||||
|
|
||||||
bitwarden-logs = {
|
bitwarden-logs = {
|
||||||
pvc = true
|
pvc = true
|
||||||
pvc_size = "2Mi"
|
pvc_size = "2Mi"
|
||||||
mount_path = "/config"
|
mount_path = "/etc/bitwarden/logs"
|
||||||
name = "bitwarden-logs"
|
name = "bitwarden-logs"
|
||||||
|
sub_path = "admin"
|
||||||
}
|
}
|
||||||
|
|
||||||
bitwarden-mssql = {
|
|
||||||
pvc = true
|
|
||||||
pvc_size = "2Mi"
|
|
||||||
mount_path = "/config"
|
|
||||||
name = "bitwarden-mssql"
|
|
||||||
}
|
|
||||||
|
|
||||||
bitwarden-nginx = {
|
|
||||||
pvc = true
|
|
||||||
pvc_size = "2Mi"
|
|
||||||
mount_path = "/config"
|
|
||||||
name = "bitwarden-nginx"
|
|
||||||
}
|
|
||||||
|
|
||||||
bitwarden-ssl = {
|
|
||||||
pvc = true
|
|
||||||
pvc_size = "2Mi"
|
|
||||||
mount_path = "/config"
|
|
||||||
name = "bitwarden-ssl"
|
|
||||||
}
|
|
||||||
|
|
||||||
bitwarden-web = {
|
|
||||||
pvc = true
|
|
||||||
pvc_size = "2Mi"
|
|
||||||
mount_path = "/config"
|
|
||||||
name = "bitwarden-web"
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bitwarden-api = {
|
||||||
|
#enabled = false
|
||||||
|
connected_namespace = "bitwardent"
|
||||||
|
replicas = 0
|
||||||
|
name = "bitwarden-api"
|
||||||
|
image = "gitea.tryton.geeraert.eu/pi-ux-ce/bitbetter_api:2024.5.0"
|
||||||
|
service_port = [5000]
|
||||||
|
config_map_ref = ["global.env","uid.env","global.override.env"]
|
||||||
|
environment = {}
|
||||||
|
|
||||||
|
pvc = {
|
||||||
|
bitwarden-ca-certificates = {
|
||||||
|
pvc = true
|
||||||
|
pvc_size = "2Mi"
|
||||||
|
mount_path = "/etc/bitwarden/ca-certificates"
|
||||||
|
name = "bitwarden-ca-certificates"
|
||||||
|
}
|
||||||
|
|
||||||
|
bitwarden-core = {
|
||||||
|
pvc = true
|
||||||
|
pvc_size = "2Mi"
|
||||||
|
mount_path = "/etc/bitwarden/core"
|
||||||
|
name = "bitwarden-core"
|
||||||
|
}
|
||||||
|
bitwarden-logs = {
|
||||||
|
pvc = true
|
||||||
|
pvc_size = "2Mi"
|
||||||
|
mount_path = "/etc/bitwarden/logs"
|
||||||
|
name = "bitwarden-logs"
|
||||||
|
sub_path = "api"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
bitwarden-attachments = {
|
||||||
|
#enabled = false
|
||||||
|
connected_namespace = "bitwardent"
|
||||||
|
replicas = 0
|
||||||
|
name = "bitwarden-attachments"
|
||||||
|
image = "bitwarden/attachments:2024.5.0"
|
||||||
|
service_port = [5000]
|
||||||
|
config_map_ref = ["global.env","uid.env"]
|
||||||
|
environment = {}
|
||||||
|
|
||||||
|
pvc = {
|
||||||
|
bitwarden-core = {
|
||||||
|
pvc = true
|
||||||
|
pvc_size = "2Mi"
|
||||||
|
mount_path = "/etc/bitwarden/core/attachments"
|
||||||
|
name = "bitwarden-core"
|
||||||
|
sub_path = "attachments"
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
sharelatex = {
|
sharelatex = {
|
||||||
enabled = false
|
enabled = false
|
||||||
image = "sharelatex/sharelatex"
|
image = "sharelatex/sharelatex"
|
||||||
|
|||||||
Reference in New Issue
Block a user