@@ -26,10 +26,10 @@ start_observability = 'all' in services or 'observability' in services
2626start_planetscale = 'all' in services or 'planetscale' in services
2727start_restate = 'all' in services or 'restate' in services
2828start_api = 'all' in services or 'api' in services
29- start_gw = 'all' in services or 'gateway' in services or 'gw' in services
3029start_ctrl = 'all' in services or 'ctrl' in services
3130start_krane = 'all' in services or 'krane' in services
3231start_dashboard = 'all' in services or 'dashboard' in services
32+ start_agent = 'all' in services or 'agent' in services
3333
3434# Apply RBAC
3535k8s_yaml ('k8s/manifests/rbac.yaml' )
@@ -95,7 +95,7 @@ if start_s3:
9595 k8s_yaml ('k8s/manifests/s3.yaml' )
9696 k8s_resource (
9797 's3' ,
98- port_forwards = ['9000:9000 ' , '9001:9001 ' ],
98+ port_forwards = ['3902:3902 ' , '3903:3903 ' ],
9999 resource_deps = [],
100100 labels = ['storage' ]
101101 )
@@ -141,7 +141,7 @@ if start_observability:
141141 )
142142
143143# Build Unkey binary locally (independent of infrastructure)
144- if start_api or start_gw or start_ctrl or start_krane :
144+ if start_api or start_ctrl or start_krane :
145145 print ("Building Unkey binary..." )
146146 # Build locally first for faster updates
147147 local_resource (
@@ -187,39 +187,6 @@ if start_api:
187187 trigger_mode = TRIGGER_MODE_MANUAL if debug_mode else TRIGGER_MODE_AUTO
188188 )
189189
190- # Gateway service (1 replica)
191- if start_gw :
192- print ("Setting up Gateway service..." )
193-
194- docker_build_with_restart (
195- 'unkey-gw:latest' ,
196- '.' ,
197- dockerfile = 'Dockerfile.tilt' ,
198- entrypoint = ['/unkey' , 'run' , 'gw' ],
199- only = ['./bin' ],
200- live_update = [
201- sync ('./bin/unkey' , '/unkey' ),
202- ],
203- ignore = ['./cmd/api' , './cmd/ctrl' , './apps/api' , './apps/ctrl' ]
204- )
205-
206- k8s_yaml ('k8s/manifests/gw.yaml' )
207-
208- # Build dependency list
209- gw_deps = []
210- if start_mysql : gw_deps .append ('mysql' )
211- # Add compilation dependency for Unkey services
212- gw_deps .append ('unkey-compile' )
213-
214- k8s_resource (
215- 'gw' ,
216- port_forwards = ['8080:8080' , '8443:8443' ],
217- resource_deps = gw_deps ,
218- labels = ['unkey' ],
219- auto_init = True ,
220- trigger_mode = TRIGGER_MODE_MANUAL if debug_mode else TRIGGER_MODE_AUTO
221- )
222-
223190# Ctrl service (1 replica)
224191if start_ctrl :
225192 print ("Setting up Ctrl service..." )
@@ -287,6 +254,30 @@ if start_krane:
287254 trigger_mode = TRIGGER_MODE_AUTO
288255 )
289256
257+ # Agent service
258+ if start_agent :
259+ print ("Setting up Agent service..." )
260+ docker_build (
261+ 'unkey-agent:latest' ,
262+ '../apps/agent' ,
263+ dockerfile = '../apps/agent/Dockerfile' ,
264+ )
265+ k8s_yaml ('k8s/manifests/agent.yaml' )
266+
267+ # Build dependency list
268+ agent_deps = []
269+ if start_s3 : agent_deps .append ('s3' )
270+ if start_clickhouse : agent_deps .append ('clickhouse' )
271+
272+ k8s_resource (
273+ 'agent' ,
274+ port_forwards = '8082:8080' ,
275+ resource_deps = agent_deps ,
276+ labels = ['unkey' ],
277+ auto_init = True ,
278+ trigger_mode = TRIGGER_MODE_AUTO
279+ )
280+
290281# Dashboard service
291282if start_dashboard :
292283 print ("Setting up Dashboard service..." )
@@ -306,6 +297,7 @@ if start_dashboard:
306297 dashboard_deps = []
307298 if start_planetscale : dashboard_deps .append ('planetscale' )
308299 if start_clickhouse : dashboard_deps .append ('clickhouse' )
300+ if start_agent : dashboard_deps .append ('agent' )
309301
310302 k8s_resource (
311303 'dashboard' ,
@@ -326,9 +318,9 @@ if start_planetscale: active_services.append('planetscale')
326318if start_observability : active_services .extend (['prometheus' , 'otel-collector' ])
327319if start_restate : active_services .append ('restate' )
328320if start_api : active_services .append ('api' )
329- if start_gw : active_services .append ('gw' )
330321if start_ctrl : active_services .append ('ctrl' )
331322if start_dashboard : active_services .append ('dashboard' )
323+ if start_agent : active_services .append ('agent' )
332324
333325print ("""
334326Tilt is ready!
@@ -340,13 +332,14 @@ Web UI: http://localhost:10350
340332Services available via Tilt port forwards:
341333Dashboard: http://localhost:3000
342334API: http://localhost:7070
343- Gateway: http://localhost:8080
344335Ctrl: http://localhost:7091
345336Krane: http://localhost:8090
337+ Agent: http://localhost:8082
346338Restate Ingress: http://localhost:8081
347339Restate Admin: http://localhost:9070
348340Prometheus: http://localhost:9090
349- S3 Console: http://localhost:9000
341+ S3 API: http://localhost:3902
342+ S3 Console: http://localhost:3903
350343ClickHouse: http://localhost:8123
351344
352345Tips:
0 commit comments