-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathTiltfile
More file actions
69 lines (57 loc) · 1.6 KB
/
Tiltfile
File metadata and controls
69 lines (57 loc) · 1.6 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
# -*- mode: Python -*-
config.define_string('helm_values_file')
config.define_string('kube_context')
cfg = config.parse()
# Settings and defaults.
helm_values_file=cfg.get('helm_values_file', './tilt-chart-values.yaml')
cluster_context = cfg.get('kube_context', 'minikube')
project_name = 'nri-discovery-kubernetes'
# Only use explicitly allowed kubeconfigs as a safety measure.
allow_k8s_contexts(cluster_context)
# Building binary locally
local_resource('Discovery binary', 'GOOS=linux make compile', deps=[
"./src",
"./internal",
"./cmd",
"./Makefile",
])
# Use custom Dockerfile for Tilt builds, which only takes locally built daemon binary for live reloading.
dockerfile = '''
FROM golang:1.17-alpine AS dlv-builder
RUN apk add gcc musl-dev && \
go install github.com/go-delve/delve/cmd/dlv@latest
# ########################################################
FROM newrelic/infrastructure-bundle:2.8.32
COPY --from=dlv-builder /go/bin/dlv /usr/local/bin/
COPY ./%s /var/db/%s
''' % (project_name, project_name)
docker_build(
ref="discovery-devenv",
context='./bin',
dockerfile_contents=dockerfile,
entrypoint=[
"dlv",
"--listen=0.0.0.0:2345",
"--headless=true",
"--api-version=2",
"--check-go-version=false",
"--only-same-user=false",
"--accept-multiclient",
"exec",
'/var/db/%s' % project_name,
"--"
]
)
k8s_yaml(
helm(
'charts/discovery-devenv',
name="discovery-devenv",
values=[
'values-dev.yaml'
]
)
)
k8s_resource(
"discovery-devenv",
port_forwards = "2345:2345"
)