-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfirefly.tf
96 lines (93 loc) · 1.99 KB
/
firefly.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
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
resource "random_string" "firefly_app_key" {
length = 32
special = false
}
resource "kubernetes_deployment" "firefly_iii_depl" {
metadata {
name = "firefly-deployment"
labels = {
App = "firefly-deployment"
}
namespace = "productivity-stack-srikanth-iyengar"
}
spec {
replicas = 1
selector {
match_labels = {
App = "firefly-deployment"
}
}
template {
metadata {
labels = {
App = "firefly-deployment"
}
}
spec {
container {
image = "fireflyiii/core:latest"
name = "fireflyiii-container"
resources {
limits = {
cpu = "1"
memory = "1Gi"
}
}
env {
name = "APP_KEY"
value = random_string.firefly_app_key.result
}
env {
name = "DB_HOST"
value = var.supabase_db_host
}
env {
name = "DB_PORT"
value = "5432"
}
env {
name = "DB_CONNECTION"
value = "pgsql"
}
env {
name = "DB_DATABASE"
value = "firefly"
}
env {
name = "DB_USERNAME"
value = var.supabase_db_username
}
env {
name = "DB_PASSWORD"
value = var.supabase_db_password
}
env {
name = "APP_URL"
value = "https://firefly.srikanthk.in"
}
env {
name = "TRUSTED_PROXIES"
value = "*"
}
}
}
}
}
}
resource "kubernetes_service" "firefly_service" {
metadata {
name = "firefly-service"
namespace = "productivity-stack-srikanth-iyengar"
}
spec {
selector = {
App = "firefly-deployment"
}
port {
name = "firefly-port"
target_port = "8080"
port = "8080"
protocol = "TCP"
}
}
}