-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhelm.tf
More file actions
104 lines (82 loc) · 2.23 KB
/
helm.tf
File metadata and controls
104 lines (82 loc) · 2.23 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
provider "helm" {
kubernetes {
insecure = true
host = "https://${google_container_cluster.primary.endpoint}"
token = data.google_client_config.default.access_token
}
}
provider "kubernetes" {
insecure = true
host = "https://${google_container_cluster.primary.endpoint}"
token = data.google_client_config.default.access_token
}
resource "google_compute_ssl_certificate" "default" {
name = var.project_name
certificate = tls_self_signed_cert.lb.cert_pem
private_key = tls_private_key.lb.private_key_pem
lifecycle {
create_before_destroy = true
}
}
resource "tls_private_key" "jwt" {
algorithm = "RSA"
rsa_bits = 2048
}
resource "random_uuid" "secret_key" {}
resource "random_uuid" "admin_password" {}
resource "google_compute_global_address" "static" {
address_type = "EXTERNAL"
name = var.project_name
}
resource "helm_release" "default" {
name = var.project_name
chart = "./helm/charts/secoda"
values = [
file("${path.module}/values.yaml")
]
set {
name = "cloudSqlAuthProxy.databaseName"
value = "${var.project_name}:${var.region}:${google_sql_database_instance.postgres.name}"
}
set {
name = "ingress.hosts[0].host"
value = var.domain
}
set {
name = "ingress.annotations.kubernetes\\.io/ingress\\.global-static-ip-name"
value = google_compute_global_address.static.name
}
set {
name = "datastores.secoda.existing_secret"
value = ""
}
set {
name = "datastores.secoda.db_host"
value = "localhost" # Since we are using the proxy.
}
set {
name = "datastores.secoda.db_password"
value = random_password.database_password.result
}
set {
name = "datastores.secoda.secret_key"
value = random_uuid.secret_key.result
}
set {
name = "datastores.secoda.admin_password"
value = random_uuid.admin_password.result
}
set {
name = "datastores.secoda.private_key"
value = base64encode(tls_private_key.jwt.private_key_pem)
}
set {
name = "datastores.secoda.public_key"
value = base64encode(tls_private_key.jwt.public_key_pem)
}
depends_on = [
google_container_cluster.primary,
google_sql_database_instance.postgres,
google_container_node_pool.nodes,
]
}