-
Notifications
You must be signed in to change notification settings - Fork 82
/
Copy pathTiltfile
102 lines (96 loc) · 3.36 KB
/
Tiltfile
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
# Define and build infrastructure services
k8s_yaml([
"kubernetes/infrastructure/keycloak/keycloak.yml",
"kubernetes/infrastructure/postgres/postgres.yml",
"kubernetes/infrastructure/mongodb/mongodb.yml",
"kubernetes/infrastructure/prometheus/prometheus.yml",
"kubernetes/infrastructure/fluent-bit/fluent-bit.yml",
"kubernetes/infrastructure/loki/loki.yml",
"kubernetes/infrastructure/tempo/tempo.yml",
"kubernetes/infrastructure/grafana/grafana.yml"
])
# Define infrastructure resources
k8s_resource("keycloak", labels=["infra"], auto_init=True)
k8s_resource("prometheus", labels=["observability"], auto_init=True)
k8s_resource("fluent-bit", labels=["observability"], auto_init=True)
k8s_resource("loki", labels=["observability"], auto_init=True)
k8s_resource("tempo", labels=["observability"], auto_init=True)
k8s_resource("grafana", labels=["observability"], auto_init=True)
k8s_resource("course-postgres", labels=["infra"], auto_init=True)
k8s_resource("review-mongodb", labels=["infra"], auto_init=True)
# Define and build course-service
docker_build(
"course-service",
context="./microservices/course-service",
dockerfile="./microservices/course-service/Dockerfile",
live_update=[
sync("./microservices/course-service/src", "/application/src"),
run("mvn package -DskipTests", trigger=["/application/src"]),
]
)
k8s_yaml([
"microservices/course-service/kubernetes/deployment.yml",
"microservices/course-service/kubernetes/service.yml"
])
k8s_resource(
"course-service",
port_forwards="9001:9001",
labels=["services"]
)
# Define and build review-service
docker_build(
"review-service",
context="./microservices/review-service",
dockerfile="./microservices/review-service/Dockerfile",
live_update=[
sync("./microservices/review-service/src", "/application/src"),
run("mvn package -DskipTests", trigger=["/application/src"]),
]
)
k8s_yaml([
"microservices/review-service/kubernetes/deployment.yml",
"microservices/review-service/kubernetes/service.yml"
])
k8s_resource(
"review-service",
port_forwards="9002:9002",
labels=["services"]
)
# Define and build course-composite-service
docker_build(
"course-composite-service",
context="./microservices/course-composite-service",
dockerfile="./microservices/course-composite-service/Dockerfile",
live_update=[
sync("./microservices/course-composite-service/src", "/application/src"),
run("mvn package -DskipTests", trigger=["/application/src"]),
]
)
k8s_yaml([
"microservices/course-composite-service/kubernetes/deployment.yml",
"microservices/course-composite-service/kubernetes/service.yml"
])
k8s_resource(
"course-composite-service",
port_forwards="5000:5000",
labels=["services"]
)
# Define and build gateway-service
docker_build(
"gateway-service",
context="./spring-cloud/gateway-service",
dockerfile="./spring-cloud/gateway-service/Dockerfile",
live_update=[
sync("./spring-cloud/gateway-service/src", "/application/src"),
run("mvn package -DskipTests", trigger=["/application/src"]),
]
)
k8s_yaml([
"spring-cloud/gateway-service/kubernetes/deployment.yml",
"spring-cloud/gateway-service/kubernetes/service.yml",
"spring-cloud/gateway-service/kubernetes/ingress.yml"
])
k8s_resource(
"gateway-service",
labels=["services"]
)