-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapi-public.tf
119 lines (102 loc) · 2.47 KB
/
api-public.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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
resource "kubernetes_service" "api_public" {
metadata {
name = "api-public"
labels = {
"gropius.app" = "api-public"
}
namespace = kubernetes_namespace.gropius.metadata[0].name
}
spec {
port {
name = "8080"
port = 8080
target_port = 8080
}
selector = {
"gropius.app" = "api-public"
}
}
}
resource "kubernetes_deployment" "api_public" {
metadata {
name = "api-public"
labels = {
"gropius.app" = "api-public"
}
namespace = kubernetes_namespace.gropius.metadata[0].name
}
spec {
replicas = 1
selector {
match_labels = {
"gropius.app" = "api-public"
}
}
template {
metadata {
labels = {
"gropius.app" = "api-public"
}
}
spec {
container {
name = "api-public"
image = "ghcr.io/ccims/gropius-api-public:${var.gropius_version}"
image_pull_policy = "Always"
env {
name = "SERVER_ADDRESS"
value = "0.0.0.0"
}
env {
name = "GROPIUS_CORE_CREATE_INDICES_ON_STARTUP"
value = "true"
}
env {
name = "GRAPHGLUE_CORE_USE_NEO4J_PLUGIN"
value = "true"
}
env {
name = "GROPIUS_API_PUBLIC_JWT_PUBLIC_KEY"
value_from {
secret_key_ref {
name = "login-service-keys"
key = "oauth_public_key"
}
}
}
env {
name = "LOGGING_LEVEL_ROOT"
value = "ERROR"
}
env {
name = "SPRING_NEO4J_AUTHENTICATION_PASSWORD"
value_from {
secret_key_ref {
name = kubernetes_secret.neo4j_password_secret.metadata[0].name
key = "password"
}
}
}
env {
name = "SPRING_NEO4J_AUTHENTICATION_USERNAME"
value = "neo4j"
}
env {
name = "SPRING_NEO4J_URI"
value = "bolt://neo4j-db:7687"
}
liveness_probe {
http_get {
port = "8080"
path = "/health"
}
failure_threshold = 20
initial_delay_seconds = 120
period_seconds = 5
timeout_seconds = 10
}
}
}
}
}
}