|
1 |
| -#!/usr/bin/env bash |
2 |
| - |
3 | 1 | update_settings(k8s_upsert_timeout_secs=60) # on first tilt up, often can take longer than 30 seconds
|
4 | 2 |
|
5 | 3 | # tilt settings
|
6 | 4 | settings = {
|
7 | 5 | "allowed_contexts": [
|
8 | 6 | "kind-etcd-operator-dev"
|
9 | 7 | ],
|
10 |
| - "kubectl": "/usr/local/bin/kubectl", |
11 |
| - "kustomize": "./bin/kustomize", |
| 8 | + "kubectl": "bin/kubectl", |
| 9 | + "kustomize": "bin/kustomize", |
12 | 10 | "cert_manager_version": "v1.15.3",
|
13 | 11 | }
|
14 | 12 |
|
15 | 13 | # define variables and functions
|
16 |
| -kubectl = settings.get("kubectl") |
17 |
| -kustomize_binary = settings.get("kustomize") |
| 14 | +base_path = config.main_dir |
| 15 | +kubectl_binary = "{}/{}".format(base_path, settings.get("kubectl")) |
| 16 | +kustomize_binary = "{}/{}".format(base_path, settings.get("kustomize")) |
18 | 17 |
|
19 | 18 | if "allowed_contexts" in settings:
|
20 | 19 | allow_k8s_contexts(settings.get("allowed_contexts"))
|
21 | 20 |
|
22 | 21 | def deploy_cert_manager():
|
23 | 22 | version = settings.get("cert_manager_version")
|
24 | 23 | print("Installing cert-manager")
|
25 |
| - local("{} apply -f https://github.com/cert-manager/cert-manager/releases/download/{}/cert-manager.yaml".format(kubectl, version), quiet=True, echo_off=True) |
| 24 | + local("{} apply -f https://github.com/cert-manager/cert-manager/releases/download/{}/cert-manager.yaml".format(kubectl_binary, version), quiet=True, echo_off=True) |
26 | 25 |
|
27 | 26 | print("Waiting for cert-manager to start")
|
28 |
| - local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager".format(kubectl), quiet=True, echo_off=True) |
29 |
| - local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-cainjector".format(kubectl), quiet=True, echo_off=True) |
30 |
| - local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-webhook".format(kubectl), quiet=True, echo_off=True) |
| 27 | + local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager".format(kubectl_binary), quiet=True, echo_off=True) |
| 28 | + local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-cainjector".format(kubectl_binary), quiet=True, echo_off=True) |
| 29 | + local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-webhook".format(kubectl_binary), quiet=True, echo_off=True) |
31 | 30 |
|
32 |
| -def waitforsystem(): |
33 |
| - print("Waiting for metal-operator to start") |
34 |
| - local("{} wait --for=condition=ready --timeout=300s -n etcd-operator-system pod --all".format(kubectl), quiet=False, echo_off=True) |
| 31 | +def prepare_etcd_operator(): |
| 32 | + docker_build('ghcr.io/aenix-io/etcd-operator', '.') |
| 33 | + return kustomize("./config/dev", kustomize_bin=kustomize_binary) |
35 | 34 |
|
36 | 35 | # deploy everything
|
37 | 36 | deploy_cert_manager()
|
38 | 37 |
|
39 |
| -docker_build('ghcr.io/aenix-io/etcd-operator', '.') |
40 |
| - |
41 |
| -yaml = kustomize("./config/dev", kustomize_bin=kustomize_binary) |
42 |
| - |
| 38 | +yaml = prepare_etcd_operator() |
43 | 39 | k8s_yaml(yaml)
|
0 commit comments