-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathTiltfile
More file actions
100 lines (84 loc) · 2.61 KB
/
Copy pathTiltfile
File metadata and controls
100 lines (84 loc) · 2.61 KB
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
# Tiltfile for ModularMonolith ECommerceApp
# Load Docker images
docker_build(
'modularmonolith',
'.',
dockerfile='ECommerceApp/Dockerfile'
)
docker_build(
'admin-ui',
'.',
dockerfile='ECommerce.AdminUI/Dockerfile'
)
# Adding database migrator with correct image name to match migrate-job.yaml
docker_build(
'ecommerce-db-migrator', # Match the image name in migrate-job.yaml
'.',
dockerfile='ECommerce.DatabaseMigrator/Dockerfile'
)
# Apply Kubernetes manifests
k8s_yaml([
'ECommerceApp/k8s/sealedsecret.yaml',
# 'ECommerceApp/k8s/hpa.yaml', # Removed for now - metrics-server not fully configured
'ECommerceApp/k8s/deployment.yaml',
'ECommerceApp/k8s/ingress.yaml',
'ECommerceApp/k8s/service.yaml',
'ECommerce.DatabaseMigrator/k8s/migrate-job.yaml'
])
# Use kustomize for AdminUI
k8s_yaml(kustomize('ECommerce.AdminUI/k8s/overlays/dev'))
# Resource configuration
k8s_resource(
'modularmonolith', # This should match the name in your deployment.yaml
port_forwards=['8080:8080'],
labels=["app"],
trigger_mode=TRIGGER_MODE_MANUAL
)
k8s_resource(
'admin-ui',
port_forwards=['8081:8080'],
labels=["app"],
trigger_mode=TRIGGER_MODE_MANUAL
)
k8s_resource(
'db-migrator', # This should match the name in migrate-job.yaml
labels=["migrations"],
trigger_mode=TRIGGER_MODE_MANUAL
)
# Enable file watching for live updates
watch_file('ECommerceApp/**')
watch_file('ECommerce.Common/**')
watch_file('ECommerce.Contracts/**')
watch_file('ECommerce.BusinessEvents/**')
watch_file('ECommerce.Modules.Customers/**')
watch_file('ECommerce.Modules.Orders/**')
watch_file('ECommerce.Modules.Products/**')
watch_file('ECommerce.AdminUI/**')
watch_file('ECommerce.DatabaseMigrator/**')
# Specify where to find logs
k8s_resource(
'modularmonolith'
)
# Let's add metrics server if it's needed
k8s_yaml('Infrastructure/k8s/metrics-server.yaml')
k8s_yaml('Infrastructure/k8s/metrics-rbac.yaml')
k8s_resource(
'metrics-server',
labels=["infrastructure"]
)
# Kubernetes Dashboard (local dev)
# Load the official dashboard manifest (versioned URL) and our local helper manifests
k8s_yaml('ECommerceApp/Infrastructure/kubernetes-dashboard/recommended.yaml')
k8s_yaml([
'ECommerceApp/Infrastructure/kubernetes-dashboard/dashboard-admin-user.yaml',
'ECommerceApp/Infrastructure/kubernetes-dashboard/dashboard-nodeport.yaml',
])
# Label dashboard resources so they appear under "infrastructure" in Tilt
k8s_resource(
'kubernetes-dashboard',
labels=["infrastructure"]
)
k8s_resource(
'dashboard-metrics-scraper',
labels=["infrastructure"]
)