fix
This commit is contained in:
28
apps/wordpress/pvc.tf
Normal file
28
apps/wordpress/pvc.tf
Normal file
@@ -0,0 +1,28 @@
|
||||
locals {
|
||||
pvc_spec = merge({
|
||||
"accessModes" = [var.storage.volume.accessMode]
|
||||
"volumeMode" = var.storage.volume.type
|
||||
"resources" = {
|
||||
"requests" = {
|
||||
"storage" = "${var.storage.volume.size}"
|
||||
}
|
||||
}
|
||||
}, var.storage.volume.class != "" ?{
|
||||
"storageClassName" = var.storage.volume.class
|
||||
}:{})
|
||||
}
|
||||
resource "kubectl_manifest" "pvc" {
|
||||
ignore_fields = ["spec.resources.requests.storage"]
|
||||
yaml_body = <<-EOF
|
||||
apiVersion: v1
|
||||
kind: PersistentVolumeClaim
|
||||
metadata:
|
||||
name: ${var.instance}
|
||||
namespace: "${var.namespace}"
|
||||
annotations:
|
||||
k8up.io/backup: "true"
|
||||
resize.kubesphere.io/storage_limit: "${var.storage.volume.maxSize}"
|
||||
labels: ${jsonencode(local.common_labels)}
|
||||
spec: ${jsonencode(local.pvc_spec)}
|
||||
EOF
|
||||
}
|
||||
Reference in New Issue
Block a user