forked from sodle/discordle
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.tf
54 lines (50 loc) · 969 Bytes
/
main.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
provider "kubernetes" {
config_path = "~/.kube/config"
config_context = "microk8s"
}
resource "kubernetes_namespace" "namespace" {
metadata {
name = "discordle"
}
}
data "kubernetes_secret" "discord_token" {
metadata {
name = "discord-token"
namespace = kubernetes_namespace.namespace.id
}
}
resource "kubernetes_stateful_set" "discordle" {
metadata {
name = "discordle"
namespace = kubernetes_namespace.namespace.id
labels = {
app = "discordle"
}
}
spec {
service_name = "discordle"
selector {
match_labels = {
app = "discordle"
}
}
template {
metadata {
labels = {
app = "discordle"
}
}
spec {
container {
name = "discordle"
image = "ghcr.io/sodle/discordle:main"
env_from {
secret_ref {
name = "discord-token"
}
}
}
}
}
}
}