Skip to content

Commit 7d41fde

Browse files
committed
Add Tiltfile
1 parent 5572272 commit 7d41fde

File tree

5 files changed

+155
-0
lines changed

5 files changed

+155
-0
lines changed

.dockerignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Ignore everything first to avoid context bloat
2+
*
3+
4+
!dist/linode-cloud-controller-manager-linux-amd64

Tiltfile

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
load("ext://deployment", "deployment_create")
2+
load("ext://k8s_attach", "k8s_attach")
3+
load("ext://restart_process", "docker_build_with_restart")
4+
load("ext://helm_resource", "helm_resource")
5+
6+
allow_k8s_contexts(k8s_context())
7+
8+
# in order to use this registry you must add `127.0.0.1 registry-proxy` in your /etc/hosts
9+
# and add http://registry-proxy:5000 to the list of insecure registries in docker daemon.
10+
load("ext://k8s_attach", "k8s_attach")
11+
12+
local_resource(
13+
"registry-probe",
14+
serve_cmd="sleep infinity",
15+
readiness_probe=probe(
16+
period_secs=15,
17+
http_get=http_get_action(host="registry-proxy", port=5000, path="/"),
18+
),
19+
labels=["registry"],
20+
)
21+
22+
k8s_attach(
23+
"registry-port-forward",
24+
"deployment/docker-registry",
25+
namespace="registry",
26+
port_forwards=[5000],
27+
labels=["registry"],
28+
)
29+
default_registry("registry-proxy:5000", host_from_cluster="docker.local")
30+
31+
labels = ["ccm-linode"]
32+
33+
local_resource(
34+
"linode-cloud-controller-manager-linux-amd64",
35+
"make build-linux",
36+
deps=[
37+
"*.go",
38+
"cloud/**/*.go",
39+
"sentry/**/*.go",
40+
"go.*",
41+
"Makefile",
42+
],
43+
ignore=["./build/",],
44+
labels=labels,
45+
)
46+
47+
docker_build_with_restart(
48+
"linode/linode-cloud-controller-manager",
49+
".",
50+
# dockerfile="./Dockerfile",
51+
entrypoint=["/linode-cloud-controller-manager-linux-amd64"],
52+
ignore=["**/*.go", "go.*"],
53+
live_update=[
54+
sync("./dist/linode-cloud-controller-manager-linux-amd64", "/linode-cloud-controller-manager-linux-amd64"),
55+
],
56+
)
57+
58+
# Avoiding helm_resource because orchestrating `helm install` over an
59+
# argocd app seems to require deleting the app which is slow and upsets pulumi.
60+
chart_yaml = helm(
61+
"deploy/chart",
62+
name="ccm-linode",
63+
namespace="kube-system",
64+
values="./tilt.values.yaml",
65+
)
66+
k8s_yaml(chart_yaml)
67+
68+
# k8s_resource(
69+
# "ccm-linode", labels=labels
70+
# )

devbox.json

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"packages": [
3+
"go_1_17@latest",
4+
"tilt@latest",
5+
"kubernetes-helm@latest"
6+
]
7+
}

devbox.lock

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"lockfile_version": "1",
3+
"packages": {
4+
"go_1_17@latest": {
5+
"last_modified": "2022-11-10T13:14:32Z",
6+
"resolved": "github:NixOS/nixpkgs/72d8853228c9758820c39b8659415b6d89279493#go_1_17",
7+
"source": "devbox-search",
8+
"version": "1.17.13",
9+
"systems": {
10+
"aarch64-darwin": {
11+
"store_path": "/nix/store/3sz4dvj5wfbm708d2idk5zl2fmbm7v5g-go-1.17.13"
12+
},
13+
"aarch64-linux": {
14+
"store_path": "/nix/store/a242dvsmkl42p1crw19cc4mp1majvgr9-go-1.17.13"
15+
},
16+
"x86_64-darwin": {
17+
"store_path": "/nix/store/0kfpsk25ni9zq75pa61xp6lf7al9lk2q-go-1.17.13"
18+
},
19+
"x86_64-linux": {
20+
"store_path": "/nix/store/s9qsfgwh0m950sfn49gvpqsi41zbxiyq-go-1.17.13"
21+
}
22+
}
23+
},
24+
"kubernetes-helm@latest": {
25+
"last_modified": "2023-11-19T17:46:56Z",
26+
"resolved": "github:NixOS/nixpkgs/0bf3f5cf6a98b5d077cdcdb00a6d4b3d92bc78b5#kubernetes-helm",
27+
"source": "devbox-search",
28+
"version": "3.13.2",
29+
"systems": {
30+
"aarch64-darwin": {
31+
"store_path": "/nix/store/bm0hydn3x8qicnnpp1j59affzbh802g6-kubernetes-helm-3.13.2"
32+
},
33+
"aarch64-linux": {
34+
"store_path": "/nix/store/rlxzcdijanfnr1cycmasxlqqbkhmfllc-kubernetes-helm-3.13.2"
35+
},
36+
"x86_64-darwin": {
37+
"store_path": "/nix/store/wihx37d21rxyvp5d10ki9qr57mmqa96n-kubernetes-helm-3.13.2"
38+
},
39+
"x86_64-linux": {
40+
"store_path": "/nix/store/2nsswfqlz4nc2hrbxchz7n98ccg9jfjx-kubernetes-helm-3.13.2"
41+
}
42+
}
43+
},
44+
"tilt@latest": {
45+
"last_modified": "2023-11-19T17:46:56Z",
46+
"resolved": "github:NixOS/nixpkgs/0bf3f5cf6a98b5d077cdcdb00a6d4b3d92bc78b5#tilt",
47+
"source": "devbox-search",
48+
"version": "0.33.6",
49+
"systems": {
50+
"aarch64-darwin": {
51+
"store_path": "/nix/store/d0kpgvk6vvb8lvsvmh338zxfnb9b7vp9-tilt-0.33.6"
52+
},
53+
"aarch64-linux": {
54+
"store_path": "/nix/store/d61h2m341hza65rs8ay04fjmdgwmw1m6-tilt-0.33.6"
55+
},
56+
"x86_64-darwin": {
57+
"store_path": "/nix/store/30kfkrlyrbk3bzwr524kmqmsygf5a89p-tilt-0.33.6"
58+
},
59+
"x86_64-linux": {
60+
"store_path": "/nix/store/9yqsnwx8khnbf86z81cyaaqmh4qkfy2i-tilt-0.33.6"
61+
}
62+
}
63+
}
64+
}
65+
}

tilt.values.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
env:
2+
- name: LINODE_HOSTNAME_ONLY_INGRESS
3+
value: "false"
4+
nodeSelector:
5+
node-role.kubernetes.io/master: "true"
6+
secretRef:
7+
apiTokenRef: apiToken
8+
name: linode-api-secret
9+
regionRef: region

0 commit comments

Comments
 (0)