-
Notifications
You must be signed in to change notification settings - Fork 1
/
Tiltfile
54 lines (48 loc) · 2.06 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
# Build the cactuar Dockerfile target to bring code changes up-to-date for the
# Helm chart.
#
# Keep in mind, while cargo-chef caches dependency builds, if you change a
# dependency version or install a new dependency, you may trigger a full
# rebuild, which will take significantly longer than a cached build.
docker_build(
"cactuar", # image name
context=".", # build context
dockerfile="./Dockerfile",
# Ignore Helm chart modifications to avoid unnecessary re-deploys
ignore=["./helm/"]
)
# Installing kube-prometheus-stack can take longer than 30 seconds, there are
# lots of container images to download!
update_settings(k8s_upsert_timeout_secs = 180)
# Load the Tilt extenstions for installing external Helm charts.
load('ext://helm_resource', 'helm_resource', 'helm_repo')
# Add the prometheus-community Helm repo, and install kube-prometheus-stack,
# which provides a bunch of components for observability.
helm_repo('prometheus-community', 'https://prometheus-community.github.io/helm-charts')
helm_resource('kube-prometheus-stack', 'prometheus-community/kube-prometheus-stack')
k8s_resource(
workload='kube-prometheus-stack',
port_forwards=[
# port_forward takes the form: (local_port, container_port)
port_forward(9090, 9090, name='Prometheus UI'),
port_forward(9093, 9093, name='Alert Manager UI'),
port_forward(3000, 3000, name='Grafana UI'),
],
)
# Deploy the local Helm chart to your running Kubernetes cluster. Note that this
# will depend on you using some kind of local cluster setup tool, such as K3D,
# Kind, Minikube, or other.
#
# Note: Cactuar relies on being able to create a ClusterRole and
# ClusterRoleBinding in order to modify CRD specs and control its own resources,
# so if your cluster restricts these permissions you will likely run into
# issues.
k8s_yaml(helm("./helm/cactuar"))
# Expose tokio-console port
k8s_resource(
"chart-cactuar",
port_forwards=[
# port_forward takes the form: (local_port, container_port)
port_forward(6669, 6669, name='Tokio Console (Port 6669)')
],
)