Skip to content

Commit 0d0fd5d

Browse files
committed
feat: deploy moodle instance
1 parent ba25bb2 commit 0d0fd5d

File tree

1 file changed

+61
-0
lines changed

1 file changed

+61
-0
lines changed

envs/staging/moodle.tf

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
resource "helm_release" "moodle_deployment" {
2+
name = "moodle"
3+
repository = "oci://registry-1.docker.io/bitnamicharts"
4+
chart = "moodle"
5+
version = "25.1.2"
6+
namespace = kubernetes_namespace.moodle_namespace.metadata.0.name
7+
8+
set {
9+
name = "ingress.enabled"
10+
value = "true"
11+
}
12+
13+
set {
14+
name = "ingress.hosts[0]"
15+
value = "moodle.serlo-staging.dev"
16+
}
17+
18+
set {
19+
name = "serviceType"
20+
value = "ClusterIP"
21+
}
22+
}
23+
24+
25+
resource "kubernetes_namespace" "moodle_namespace" {
26+
metadata {
27+
name = "moodle"
28+
}
29+
}
30+
31+
resource "kubernetes_secret" "moodle_tls_certificate" {
32+
type = "kubernetes.io/tls"
33+
34+
metadata {
35+
name = "moodle-tls-secret"
36+
namespace = kubernetes_namespace.moodle_namespace.metadata.0.name
37+
}
38+
39+
data = {
40+
"tls.crt" = module.cert.crt
41+
"tls.key" = module.cert.key
42+
}
43+
}
44+
45+
module "cert" {
46+
source = "../../modules/tls-self-signed-cert"
47+
domain = "moodle.serlo-staging.dev"
48+
}
49+
50+
module "moodle_ingress" {
51+
source = "../../modules/ingress"
52+
53+
name = "moodle"
54+
namespace = kubernetes_namespace.api_namespace.metadata.0.name
55+
host = "moodle.${local.domain}"
56+
backend = {
57+
service_name = "moodle"
58+
service_port = 80
59+
}
60+
enable_tls = true
61+
}

0 commit comments

Comments
 (0)