-
Notifications
You must be signed in to change notification settings - Fork 5
/
postgres.tf
38 lines (36 loc) · 1.33 KB
/
postgres.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
resource "kubernetes_persistent_volume_claim_v1" "pgdata" {
count = var.postgres_enabled ? 1 : 0
metadata {
name = "postgres-data"
namespace = var.namespace
labels = local.common_labels
}
wait_until_bound = false
spec {
access_modes = ["ReadWriteOnce"]
resources {
requests = {
storage = var.postgres_storage_size
}
}
}
}
module "postgresql" {
count = var.postgres_enabled ? 1 : 0
depends_on = [kubernetes_persistent_volume_claim_v1.pgdata]
source = "djangoflow/postgresql/kubernetes"
version = "1.1.2"
image_name = "docker.io/postgres"
security_context_uid = 999
security_context_gid = 999
image_tag = "13"
name = var.service_account_name
username = var.service_account_name
namespace = var.namespace
pvc_name = kubernetes_persistent_volume_claim_v1.pgdata.0.metadata.0.name
object_prefix = "postgres"
resources_limits_memory = var.postgres_resources_limits_memory
resources_limits_cpu = var.postgres_resources_limits_cpu
resources_requests_memory = var.postgres_resources_requests_memory
resources_requests_cpu = var.postgres_resources_requests_cpu
}