This commit is contained in:
2023-08-12 12:04:22 +02:00
parent 30bf0874ae
commit 8ff7906740
8 changed files with 552 additions and 552 deletions

View File

@@ -2,7 +2,7 @@ locals {
pg-labels = merge(local.common-labels, {
"app.kubernetes.io/component" = "pg"
})
backup-def = var.backups.enable ? {
backup-def = {
barmanObjectStore = {
destinationPath = "s3://${var.instance}-${var.namespace}/"
endpointURL = "${var.backups.endpoint}/barman"
@@ -17,7 +17,7 @@ locals {
}
}
}
} : {}
}
}
resource "kubectl_manifest" "prj_pg" {
@@ -38,7 +38,7 @@ resource "kubectl_manifest" "prj_pg" {
initdb:
database: "${var.component}"
owner: "${var.component}"
backup: ${jsonencode(local.backup-def)}
backup: ${jsonencode(var.backups.enable?local.backup-def:{})}
EOF
}