Created
July 30, 2021 17:01
-
-
Save Akaame/d75a107ecdcc225d0db1a8e699674c87 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
locals { | |
psql_ui_path = "github.com/zalando/postgres-operator/ui/manifests" | |
} | |
terraform { | |
required_providers { | |
kustomization = { | |
source = "kbst/kustomization" | |
version = "0.5.0" | |
} | |
} | |
} | |
provider "kustomization" { | |
kubeconfig_path = "~/.kube/config" | |
} | |
data "kustomization_overlay" "psql-ui" { | |
resources = [ local.psql_ui_path ] # kustomization source | |
# patch name of every resource with its namespace assigned to "default" in the kustomization | |
patches { | |
patch = <<-EOF | |
- op: replace | |
path: /metadata/namespace | |
value: ${kubernetes_namespace.ha-psql.metadata.0.name} | |
EOF | |
target = { | |
namespace = "default" | |
} | |
} | |
} | |
resource "kustomization_resource" "psql-ui" { | |
for_each = data.kustomization_overlay.psql-ui.ids | |
manifest = data.kustomization_overlay.psql-ui.manifests[each.value] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment