Fix linter, improve rabbit
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user