-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tiltfile
78 lines (68 loc) · 2.04 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
# allow_k8s_contexts(k8s_context())
default_registry(
'localhost:33255',
host_from_cluster='wormhole:5000'
)
docker_build(
'wormhole-controller',
context='.',
dockerfile='./docker/goDockerfile',
target='dev',
build_args={
'USER_ID': str(local('id -u')),
'GROUP_ID': str(local('id -g')),
'VERSION': 'dev',
'PROJECT': '..'
},
live_update=[
sync('./main.go', '/src-tmp/main.go'),
sync('./pkg', '/src-tmp/pkg'),
sync('./go.sum', '/src-tmp/go.sum'),
sync('./go.mod', '/src-tmp/go.mod')
]
)
docker_build(
'wormhole-wireguard',
context='docker',
dockerfile='./docker/wgDockerfile',
)
docker_build(
'wormhole-nginx',
context='docker',
dockerfile='./docker/nginxDockerfile',
)
servers = ["server"]
clients = ["dev1", "dev2"]
[k8s_yaml(blob("""
apiVersion: v1
kind: Namespace
metadata:
name: {ns}
""".replace("{ns}", ns))) for ns in (servers + clients)]
k8s_yaml('./kubernetes/raw/mocks/all.yaml')
for server in servers:
k8s_yaml(helm("./kubernetes/helm", namespace=server, set=[
"server.enabled=true",
"server.resources.limits.memory=2Gi",
"server.wg.publicHost=wormhole-server-chart.server.svc.cluster.local",
"server.service.type=ClusterIP",
"docker.image=wormhole-controller",
"docker.wgImage=wormhole-wireguard",
"docker.nginxImage=wormhole-nginx",
"networkPolicies.enabled=true",
"docker.registry=",
"devMode.enabled=true",
]))
for client in clients:
k8s_yaml(helm("./kubernetes/helm", namespace=client, name=client, set=[
"client.enabled=true",
"client.name=" + client,
"client.serverDsn=http://wormhole-server-chart.server.svc.cluster.local:8080",
"client.resources.limits.memory=2Gi",
"docker.image=wormhole-controller",
"docker.wgImage=wormhole-wireguard",
"docker.nginxImage=wormhole-nginx",
"networkPolicies.enabled=true",
"docker.registry=",
"devMode.enabled=true",
]))