-
Notifications
You must be signed in to change notification settings - Fork 142
/
Tiltfile
193 lines (179 loc) · 4.92 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
trigger_mode(TRIGGER_MODE_MANUAL)
allow_k8s_contexts('orbstack')
load('ext://namespace', 'namespace_create')
local_resource(
'back-end-compile',
'CGO_ENABLED=0 GOOS=linux GOARCH=$(go env GOARCH) go build -o bin/controlplane/kargo ./cmd/controlplane',
deps=[
'api/',
'cmd/controlplane/',
'internal/',
'pkg/',
'go.mod',
'go.sum'
],
labels = ['native-processes'],
trigger_mode = TRIGGER_MODE_AUTO
)
local_resource(
'credential-helper-compile',
'CGO_ENABLED=0 GOOS=linux GOARCH=$(go env GOARCH) go build -o bin/credential-helper ./cmd/credential-helper',
deps=['cmd/credential-helper/'],
labels = ['native-processes'],
trigger_mode = TRIGGER_MODE_AUTO
)
docker_build(
'ghcr.io/akuity/kargo',
'.',
only = [
'bin/controlplane/kargo',
'bin/credential-helper'
],
target = 'back-end-dev', # Just the back end, built natively, copied to the image
)
docker_build(
'kargo-ui',
'.',
only = ['ui/'],
target = 'ui-dev', # Just the font end, served by vite, live updated
live_update = [sync('ui', '/ui')]
)
namespace_create('kargo')
k8s_resource(
new_name = 'namespace',
objects = ['kargo:namespace'],
labels = ['kargo']
)
k8s_yaml(
helm(
'./charts/kargo',
name = 'kargo',
namespace = 'kargo',
values = 'hack/tilt/values.dev.yaml'
)
)
# Normally the API server serves up the front end, but we want live updates
# of the UI, so we're breaking it out into its own separate deployment here.
k8s_yaml('hack/tilt/ui.yaml')
k8s_resource(
new_name = 'common',
labels = ['kargo'],
objects = [
'kargo-admin:clusterrole',
'kargo-admin:clusterrolebinding',
'kargo-admin:serviceaccount',
'kargo-viewer:clusterrole',
'kargo-viewer:serviceaccount',
'kargo-viewer:clusterrolebinding',
'kargo-selfsigned-cert-issuer:issuer'
]
)
k8s_resource(
workload = 'kargo-api',
new_name = 'api',
port_forwards = [
'30081:8080'
],
labels = ['kargo'],
objects = [
'kargo-api:clusterrole',
'kargo-api:clusterrolebinding',
'kargo-api:configmap',
'kargo-api:secret',
'kargo-api:serviceaccount',
'kargo-api-rollouts:clusterrole',
'kargo-api-rollouts:clusterrolebinding',
'kargo-project-admin:clusterrole'
],
resource_deps=['back-end-compile','dex-server']
)
k8s_resource(
workload = 'kargo-controller',
new_name = 'controller',
labels = ['kargo'],
objects = [
'kargo-controller:clusterrole',
'kargo-controller:clusterrolebinding',
'kargo-controller:configmap',
'kargo-controller:serviceaccount',
'kargo-controller-argocd:clusterrole',
'kargo-controller-argocd:clusterrolebinding',
'kargo-controller-read-secrets:clusterrole',
'kargo-controller-rollouts:clusterrole',
'kargo-controller-rollouts:clusterrolebinding'
],
resource_deps=['back-end-compile', 'credential-helper-compile', ]
)
k8s_resource(
workload = 'kargo-dex-server',
new_name = 'dex-server',
labels = ['kargo'],
objects = [
'kargo-dex-server:certificate',
'kargo-dex-server:secret',
'kargo-dex-server:serviceaccount'
]
)
k8s_resource(
workload = 'kargo-garbage-collector',
new_name = 'garbage-collector',
labels = ['kargo'],
objects = [
'kargo-garbage-collector:clusterrole',
'kargo-garbage-collector:clusterrolebinding',
'kargo-garbage-collector:configmap',
'kargo-garbage-collector:serviceaccount'
],
resource_deps=['back-end-compile']
)
k8s_resource(
workload = 'kargo-management-controller',
new_name = 'management-controller',
labels = ['kargo'],
objects = [
'kargo-management-controller:clusterrole',
'kargo-management-controller:clusterrolebinding',
'kargo-management-controller:configmap',
'kargo-management-controller:serviceaccount'
],
resource_deps=['back-end-compile']
)
k8s_resource(
workload = 'kargo-ui',
new_name = 'ui',
port_forwards = [
'30082:3333'
],
labels = ['kargo'],
trigger_mode = TRIGGER_MODE_AUTO
)
k8s_resource(
workload = 'kargo-webhooks-server',
new_name = 'webhooks-server',
labels = ['kargo'],
objects = [
'kargo:mutatingwebhookconfiguration',
'kargo:validatingwebhookconfiguration',
'kargo-webhooks-server:certificate',
'kargo-webhooks-server:clusterrole',
'kargo-webhooks-server:clusterrolebinding',
'kargo-webhooks-server:configmap',
'kargo-webhooks-server-generic-gc:clusterrole',
'kargo-webhooks-server-generic-gc:clusterrolebinding',
'kargo-webhooks-server:serviceaccount',
'kargo-webhooks-server-ns-controller:clusterrole',
'kargo-webhooks-server-ns-controller:clusterrolebinding'
],
resource_deps=['back-end-compile']
)
k8s_resource(
new_name = 'crds',
objects = [
'freights.kargo.akuity.io:customresourcedefinition',
'projects.kargo.akuity.io:customresourcedefinition',
'promotions.kargo.akuity.io:customresourcedefinition',
'stages.kargo.akuity.io:customresourcedefinition',
'warehouses.kargo.akuity.io:customresourcedefinition'
],
labels = ['kargo']
)