Fix linter, improve rabbit

This commit is contained in:
2024-06-23 18:37:30 +02:00
parent 9f12af60bc
commit 5299267f47
13 changed files with 100 additions and 31 deletions

View File

@@ -8,7 +8,7 @@ locals {
"volumeMode" = var.storage.type
"resources" = {
"requests" = {
"storage" = "${var.storage.size}"
"storage" = var.storage.size
}
}
}, var.storage.class != "" ? {
@@ -16,6 +16,7 @@ locals {
} : {})
}
resource "kubectl_manifest" "pvc" {
ignore_fields = ["spec.resources.requests.storage"]
yaml_body = <<-EOF
apiVersion: v1
kind: PersistentVolumeClaim
@@ -24,6 +25,7 @@ resource "kubectl_manifest" "pvc" {
namespace: "${var.namespace}"
annotations:
k8up.io/backup: "${var.backup}"
resize.kubesphere.io/storage_limit: "${var.storage.max_size}
labels: ${jsonencode(local.pvc_labels)}
spec: ${jsonencode(local.pvc_spec)}
EOF

View File

@@ -13,19 +13,21 @@ variable "labels" {
variable "storage" {
type = object({
access_mode = optional(string),
class = optional(string),
size = optional(string),
type = optional(string)
class = optional(string),
size = optional(string),
max_size = optional(string),
type = optional(string)
})
default = {
"access_mode" = "ReadWriteOnce"
"class" = ""
"size" = "10Gi"
"type" = "Filesystem"
"class" = ""
"size" = "2Gi"
"max_size" = "10Gi"
"type" = "Filesystem"
}
}
variable "backup" {
type = bool
type = bool
default = true
}