reformat
This commit is contained in:
@@ -11,3 +11,11 @@ metadata:
|
|||||||
name: paperless-credentials
|
name: paperless-credentials
|
||||||
namespace: paperless
|
namespace: paperless
|
||||||
type: Opaque
|
type: Opaque
|
||||||
|
|
||||||
|
|
||||||
|
name paperless__secret__paperless-credentials
|
||||||
|
|
||||||
|
PAPERLESS_ADMIN_USER:
|
||||||
|
PAPERLESS_ADMIN_PASSWORD:
|
||||||
|
|
||||||
|
notes paperless-credentials
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
variable "kubernetes_input" {
|
variable "kubernetes_input" {
|
||||||
type = map(object({
|
type = map(object({
|
||||||
name = optional(string)
|
name = optional(string)
|
||||||
environment = optional(map(object({
|
environment = optional(map(object({
|
||||||
name = optional(string)
|
name = optional(string)
|
||||||
value = optional(string)
|
value = optional(string)
|
||||||
@@ -11,12 +11,12 @@ variable "kubernetes_input" {
|
|||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
})))
|
})))
|
||||||
replicas = optional(number, 1)
|
replicas = optional(number, 1)
|
||||||
namespace = optional(string)
|
namespace = optional(string)
|
||||||
connected_namespace = optional(string, "")
|
connected_namespace = optional(string, "")
|
||||||
database = optional(map(string))
|
database = optional(map(string))
|
||||||
database_args = optional(list(string))
|
database_args = optional(list(string))
|
||||||
enabled = optional(bool, true)
|
enabled = optional(bool, true)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
+28
-28
@@ -1,30 +1,30 @@
|
|||||||
variable "kubernetes_input" {
|
variable "kubernetes_input" {
|
||||||
type = map(object({
|
type = map(object({
|
||||||
name = optional(string)
|
name = optional(string)
|
||||||
image = string
|
image = string
|
||||||
pvc = optional(map(object({
|
pvc = optional(map(object({
|
||||||
name = optional(string)
|
name = optional(string)
|
||||||
pvc = optional(bool, false)
|
pvc = optional(bool, false)
|
||||||
config_map = optional(bool, false)
|
config_map = optional(bool, false)
|
||||||
secret = optional(bool, false)
|
secret = optional(bool, false)
|
||||||
host_path = optional(string)
|
host_path = optional(string)
|
||||||
pvc_size = optional(string)
|
pvc_size = optional(string)
|
||||||
storage_class_name = optional(string, "nfs-storage-intelligent")
|
storage_class_name = optional(string, "nfs-storage-intelligent")
|
||||||
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)
|
sub_path = optional(string)
|
||||||
})))
|
})))
|
||||||
environment = optional(map(object({
|
environment = optional(map(object({
|
||||||
name = optional(string)
|
name = optional(string)
|
||||||
value = optional(string)
|
value = optional(string)
|
||||||
value_from = optional(object({
|
value_from = optional(object({
|
||||||
secret_key_ref = object({
|
secret_key_ref = object({
|
||||||
name = string
|
name = string
|
||||||
key = optional(string, null)
|
key = optional(string, null)
|
||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
})))
|
})))
|
||||||
replicas = optional(number, 1)
|
replicas = optional(number, 1)
|
||||||
namespace = optional(string)
|
namespace = optional(string)
|
||||||
connected_namespace = optional(string, "")
|
connected_namespace = optional(string, "")
|
||||||
@@ -38,9 +38,9 @@ variable "kubernetes_input" {
|
|||||||
secret_ref = optional(list(string))
|
secret_ref = optional(list(string))
|
||||||
config_map_ref = optional(list(string))
|
config_map_ref = optional(list(string))
|
||||||
requirements = optional(map(string))
|
requirements = optional(map(string))
|
||||||
dns_nameservers = optional(string)
|
dns_nameservers = optional(string)
|
||||||
service_account_name = optional(string)
|
service_account_name = optional(string)
|
||||||
security_context = optional(bool, false)
|
security_context = optional(bool, false)
|
||||||
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
+15
-15
@@ -1,6 +1,6 @@
|
|||||||
variable "kubernetes_input" {
|
variable "kubernetes_input" {
|
||||||
type = map(object({
|
type = map(object({
|
||||||
name = optional(string)
|
name = optional(string)
|
||||||
environment = optional(map(object({
|
environment = optional(map(object({
|
||||||
name = optional(string)
|
name = optional(string)
|
||||||
value = optional(string)
|
value = optional(string)
|
||||||
@@ -11,11 +11,11 @@ variable "kubernetes_input" {
|
|||||||
})
|
})
|
||||||
}))
|
}))
|
||||||
})))
|
})))
|
||||||
replicas = optional(number, 1)
|
replicas = optional(number, 1)
|
||||||
namespace = optional(string)
|
namespace = optional(string)
|
||||||
connected_namespace = optional(string, "")
|
connected_namespace = optional(string, "")
|
||||||
redis = optional(map(string))
|
redis = optional(map(string))
|
||||||
enabled = optional(bool, true)
|
enabled = optional(bool, true)
|
||||||
}))
|
}))
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -28,12 +28,12 @@ variable "storage_path" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
resource "kubernetes_deployment_v1" "redis-automatic" {
|
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 {
|
metadata {
|
||||||
namespace = coalesce(each.value.namespace, each.value.connected_namespace, each.key)
|
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 = {
|
labels = {
|
||||||
app = each.key
|
app = each.key
|
||||||
deployment_method = "Terraform"
|
deployment_method = "Terraform"
|
||||||
@@ -62,7 +62,7 @@ resource "kubernetes_deployment_v1" "redis-automatic" {
|
|||||||
spec {
|
spec {
|
||||||
container {
|
container {
|
||||||
image = try(each.value.redis.image, "docker.io/library/redis:7")
|
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 {
|
port {
|
||||||
|
|
||||||
container_port = 6379
|
container_port = 6379
|
||||||
@@ -97,13 +97,13 @@ resource "kubernetes_deployment_v1" "redis-automatic" {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
volume {
|
volume {
|
||||||
name = "${each.key}-redis-volume"
|
name = "${each.key}-redis-volume"
|
||||||
host_path {
|
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"])]))
|
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
@@ -17,19 +17,19 @@ provider "bitwarden-secrets" {
|
|||||||
|
|
||||||
variable "kubernetes_input" {
|
variable "kubernetes_input" {
|
||||||
type = map(object({
|
type = map(object({
|
||||||
namespace = optional(string)
|
namespace = optional(string)
|
||||||
connected_namespace = optional(string, "")
|
connected_namespace = optional(string, "")
|
||||||
database = optional(map(string))
|
database = optional(map(string))
|
||||||
redis = optional(map(string))
|
redis = optional(map(string))
|
||||||
enabled = optional(bool, true)
|
enabled = optional(bool, true)
|
||||||
config_map_import = optional(list(string))
|
config_map_import = optional(list(string))
|
||||||
secret_import = optional(list(string))
|
secret_import = optional(list(string))
|
||||||
requirements = optional(map(string), {
|
requirements = optional(map(string), {
|
||||||
limits-cpu = "800m"
|
limits-cpu = "800m"
|
||||||
limits-memory = "500Mi"
|
limits-memory = "500Mi"
|
||||||
requests-cpu = "200m"
|
requests-cpu = "200m"
|
||||||
requests-memory = "200Mi"
|
requests-memory = "200Mi"
|
||||||
})
|
})
|
||||||
import_database_secret = optional(object({
|
import_database_secret = optional(object({
|
||||||
#putting them a non optional as the code doesn't allow optional value
|
#putting them a non optional as the code doesn't allow optional value
|
||||||
host = string
|
host = string
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
variable "kubernetes_input" {
|
variable "kubernetes_input" {
|
||||||
type = map(object({
|
type = map(object({
|
||||||
docker = optional(bool)
|
docker = optional(bool)
|
||||||
namespace = optional(string)
|
namespace = optional(string)
|
||||||
connected_namespace = optional(string, "")
|
connected_namespace = optional(string, "")
|
||||||
service_port = optional(list(number))
|
service_port = optional(list(number))
|
||||||
service_type = optional(string, "ClusterIP")
|
service_type = optional(string, "ClusterIP")
|
||||||
database = optional(map(string))
|
database = optional(map(string))
|
||||||
redis = optional(map(string))
|
redis = optional(map(string))
|
||||||
enabled = optional(bool, true)
|
enabled = optional(bool, true)
|
||||||
|
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user