cleaning unnecessary codee
This commit is contained in:
+6
-6
@@ -46,7 +46,7 @@ resource "kubernetes_deployment_v1" "automatic" {
|
||||
for_each = each.value.pvc != null ? each.value.pvc : {}
|
||||
content {
|
||||
mount_path = volume_mount.value.mount_path
|
||||
name = "${volume_mount.value.name}-pvc"
|
||||
name = "${volume_mount.key}-volume"
|
||||
sub_path = volume_mount.value.sub_path != null ? volume_mount.value.sub_path : ""
|
||||
}
|
||||
}
|
||||
@@ -189,19 +189,19 @@ resource "kubernetes_deployment_v1" "automatic" {
|
||||
dynamic "volume" {
|
||||
for_each = each.value.pvc != null ? each.value.pvc : {}
|
||||
content {
|
||||
name = "${volume.value.name}-pvc"
|
||||
name = "${volume.key}-volume"
|
||||
|
||||
dynamic "config_map" {
|
||||
for_each = volume.value.config_map ? [1] : []
|
||||
content {
|
||||
name = volume.value.name
|
||||
name = volume.key
|
||||
}
|
||||
}
|
||||
|
||||
dynamic "host_path" {
|
||||
for_each = volume.value.host_path != null || volume.value.local_path ? [1] : []
|
||||
for_each = volume.value.host_path != null || (!(volume.value.config_map) && !(volume.value.secret)) ? [1] : []
|
||||
content {
|
||||
path = coalesce(volume.value.host_path, join("/", [var.storage_path.main_storage, coalesce(each.value.namespace, each.value.connected_namespace, each.key), coalesce(each.value.name, each.key)]))
|
||||
path = coalesce(volume.value.host_path, join("/", [var.storage_path.main_storage, coalesce(each.value.namespace, each.value.connected_namespace, each.key), volume.key]))
|
||||
|
||||
}
|
||||
}
|
||||
@@ -209,7 +209,7 @@ resource "kubernetes_deployment_v1" "automatic" {
|
||||
dynamic "secret" {
|
||||
for_each = volume.value.secret ? [1] : []
|
||||
content {
|
||||
secret_name = volume.value.name
|
||||
secret_name = volume.key
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@ variable "kubernetes" {
|
||||
docker = optional(bool)
|
||||
image = string
|
||||
pvc = optional(map(object({
|
||||
name = string
|
||||
name = optional(string)
|
||||
config_map = optional(bool, false)
|
||||
secret = optional(bool, false)
|
||||
local_path = optional(bool, false)
|
||||
|
||||
@@ -105,11 +105,11 @@ kubernetes = {
|
||||
#command = ["-text=Hello authenticated world!"]
|
||||
pvc = {
|
||||
echo-config = {
|
||||
name = "echo-config"
|
||||
#host_path = "/tmp/data/kubernetes/echo/"
|
||||
local_path = true
|
||||
mount_path = "/app/configs"
|
||||
}
|
||||
echo-testing = {
|
||||
mount_path = "/app/test"
|
||||
}
|
||||
}
|
||||
environment = {
|
||||
PAPERLESS_REDIS = {
|
||||
|
||||
Reference in New Issue
Block a user