-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathkubernetes-secrets.tf
55 lines (49 loc) · 1.96 KB
/
kubernetes-secrets.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
resource "kubernetes_config_map" "mastodon_direct_db" {
metadata {
name = "masto-direct-db"
namespace = var.masto_ns
}
data = {
"postgres_host" = digitalocean_database_cluster.mastodon_pg.private_host
"postgres_port" = digitalocean_database_cluster.mastodon_pg.port
"postgres_db" = digitalocean_database_db.mastodon_pg.name
"postgres_user" = digitalocean_database_user.mastodon_pg.name
"postgres_pass" = digitalocean_database_user.mastodon_pg.password
}
}
resource "kubernetes_config_map" "mastodon_env_tf" {
metadata {
name = "mastodon-env-tf"
namespace = var.masto_ns
}
data = {
"ALLOWED_PRIVATE_ADDRESSES" = digitalocean_vpc.mastodon_private.ip_range
"DB_HOST" = digitalocean_database_connection_pool.mastodon_pg.private_host
"DB_NAME" = digitalocean_database_connection_pool.mastodon_pg.db_name
"DB_PORT" = digitalocean_database_connection_pool.mastodon_pg.port
"DB_USER" = digitalocean_database_user.mastodon_pg.name
"DB_PASS" = digitalocean_database_user.mastodon_pg.password
"ES_HOST" = format("https://%s", digitalocean_database_cluster.mastodon_os.private_host)
"ES_PORT" = digitalocean_database_cluster.mastodon_os.port
"ES_USER" = digitalocean_database_cluster.mastodon_os.ui_user
"ES_PASS" = digitalocean_database_cluster.mastodon_os.ui_password
"REDIS_URL" = format(
"rediss://%s:%s@%s:%s",
digitalocean_database_cluster.mastodon_redis.user,
digitalocean_database_cluster.mastodon_redis.password,
digitalocean_database_cluster.mastodon_redis.private_host,
digitalocean_database_cluster.mastodon_redis.port
)
"TRUSTED_PROXY_IP" = "10.0.0.0/8"
}
}
resource "kubernetes_config_map" "mastodon_env_ha_tf" {
metadata {
name = "mastodon-haproxy-env-tf"
namespace = var.masto_ns
}
data = {
"REDIS_HOST" = digitalocean_database_cluster.mastodon_redis.private_host
"REDIS_PORT" = digitalocean_database_cluster.mastodon_redis.port
}
}