mirror of
https://github.com/kittywitch/nixfiles.git
synced 2026-02-09 04:19:19 -08:00
[POSTGRES] Add to cluster.
This commit is contained in:
parent
7c3e6a961e
commit
c39682178d
1 changed files with 39 additions and 0 deletions
39
cluster/postgres.tf
Normal file
39
cluster/postgres.tf
Normal file
|
|
@ -0,0 +1,39 @@
|
||||||
|
variable "postgres_password" {
|
||||||
|
type = string
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "kubernetes_secret" "postgres_auth_secret" {
|
||||||
|
metadata {
|
||||||
|
name = "postgres-auth-secret"
|
||||||
|
namespace = "postgresql"
|
||||||
|
}
|
||||||
|
data = {
|
||||||
|
postgresPassword = var.postgres_password
|
||||||
|
}
|
||||||
|
type = "Opaque"
|
||||||
|
}
|
||||||
|
|
||||||
|
resource "helm_release" "postgresql" {
|
||||||
|
name = "postgresql"
|
||||||
|
repository = "https://charts.bitnami.com/bitnami"
|
||||||
|
chart = "postgresql"
|
||||||
|
create_namespace = true
|
||||||
|
namespace = "postgresql"
|
||||||
|
|
||||||
|
timeout = var.helm_timeout
|
||||||
|
cleanup_on_fail = true
|
||||||
|
force_update = true
|
||||||
|
|
||||||
|
values = [
|
||||||
|
yamlencode({
|
||||||
|
global = {
|
||||||
|
postgresql = {
|
||||||
|
auth = {
|
||||||
|
existingSecret = "postgres-auth-secret"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
]
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue