-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathntfy-sh.tf
100 lines (93 loc) · 1.98 KB
/
ntfy-sh.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
resource "random_string" "ntfy_volume_id" {
length = 25
special = false
upper = false
numeric = false
}
resource "random_string" "oidc_passphrase" {
length = 30
special = false
}
resource "kubernetes_deployment" "ntfy-deployment" {
metadata {
name = "ntfy-deployment"
labels = {
App = "ntfy-deployment"
}
namespace = "dev-tools-srikanth-iyengar"
}
spec {
replicas = 1
selector {
match_labels = {
App = "ntfy-deployment"
}
}
template {
metadata {
labels = {
App = "ntfy-deployment"
}
}
spec {
container {
image = "binwiederhier/ntfy:latest"
name = "ntfy"
command = ["ntfy", "serve"]
resources {
limits = {
cpu = "0.5"
memory = "512Mi"
}
requests = {
cpu = "250m"
memory = "50Mi"
}
}
volume_mount {
name = random_string.ntfy_volume_id.result
mount_path = "/var/cache/ntfy"
}
}
volume {
name = random_string.ntfy_volume_id.result
persistent_volume_claim {
claim_name = random_string.ntfy_volume_id.result
}
}
}
}
}
}
resource "kubernetes_service" "ntfy_service" {
metadata {
name = "ntfy-service"
namespace = "dev-tools-srikanth-iyengar"
}
spec {
selector = {
App = "ntfy-deployment"
}
port {
name = "ntfy-service"
target_port = 80
port = 80
protocol = "TCP"
}
}
}
resource "kubernetes_persistent_volume_claim" "ntfy-pvc" {
metadata {
name = random_string.ntfy_volume_id.result
namespace = "dev-tools-srikanth-iyengar"
}
spec {
access_modes = ["ReadWriteOnce"]
storage_class_name = "okteto-standard"
resources {
requests = {
storage = "512Mi"
}
}
}
}