forked from digitalocean/mastodon-on-kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
k8s-config.tf
51 lines (39 loc) · 954 Bytes
/
k8s-config.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
resource "kubernetes_namespace" "mastodon" {
metadata {
annotations = {
name = "mastodon"
}
labels = {
part_of = "mastodon"
}
name = var.mastodon_k8s_namespace
}
}
resource "kubernetes_secret" "pgsql_auth" {
count = var.enable_external_postgresql ? 1 : 0
metadata {
name = var.mastodon_pgsql_auth_secret_name
namespace = var.mastodon_k8s_namespace
labels = {
part_of = "mastodon"
}
}
data = {
db-password = digitalocean_database_connection_pool.mastodon_pg_connection_pool[0].password
}
type = "Opaque"
}
resource "kubernetes_secret" "redis_auth" {
count = var.enable_external_redis ? 1 : 0
metadata {
name = var.mastodon_redis_auth_secret_name
namespace = var.mastodon_k8s_namespace
labels = {
part_of = "mastodon"
}
}
data = {
db-password = digitalocean_database_cluster.mastodon_redis[0].password
}
type = "Opaque"
}