|
| 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 | +# ) |
0 commit comments