-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Artem Bortnikov <artem.bortnikov@telekom.com>
- Loading branch information
Showing
2 changed files
with
47 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,39 @@ | ||
#!/usr/bin/env bash | ||
|
||
update_settings(k8s_upsert_timeout_secs=60) # on first tilt up, often can take longer than 30 seconds | ||
|
||
# tilt settings | ||
settings = { | ||
"allowed_contexts": [ | ||
"kind-etcd-operator-dev" | ||
], | ||
"kubectl": "/usr/local/bin/kubectl", | ||
"kustomize": "./bin/kustomize", | ||
"kubectl": "bin/kubectl", | ||
"kustomize": "bin/kustomize", | ||
"cert_manager_version": "v1.15.3", | ||
} | ||
|
||
# define variables and functions | ||
kubectl = settings.get("kubectl") | ||
kustomize_binary = settings.get("kustomize") | ||
base_path = config.main_dir | ||
kubectl_binary = "{}/{}".format(base_path, settings.get("kubectl")) | ||
kustomize_binary = "{}/{}".format(base_path, settings.get("kustomize")) | ||
|
||
if "allowed_contexts" in settings: | ||
allow_k8s_contexts(settings.get("allowed_contexts")) | ||
|
||
def deploy_cert_manager(): | ||
version = settings.get("cert_manager_version") | ||
print("Installing cert-manager") | ||
local("{} apply -f https://github.com/cert-manager/cert-manager/releases/download/{}/cert-manager.yaml".format(kubectl, version), quiet=True, echo_off=True) | ||
local("{} apply -f https://github.com/cert-manager/cert-manager/releases/download/{}/cert-manager.yaml".format(kubectl_binary, version), quiet=True, echo_off=True) | ||
|
||
print("Waiting for cert-manager to start") | ||
local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager".format(kubectl), quiet=True, echo_off=True) | ||
local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-cainjector".format(kubectl), quiet=True, echo_off=True) | ||
local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-webhook".format(kubectl), quiet=True, echo_off=True) | ||
local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager".format(kubectl_binary), quiet=True, echo_off=True) | ||
local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-cainjector".format(kubectl_binary), quiet=True, echo_off=True) | ||
local("{} wait --for=condition=Available --timeout=300s -n cert-manager deployment/cert-manager-webhook".format(kubectl_binary), quiet=True, echo_off=True) | ||
|
||
def waitforsystem(): | ||
print("Waiting for metal-operator to start") | ||
local("{} wait --for=condition=ready --timeout=300s -n etcd-operator-system pod --all".format(kubectl), quiet=False, echo_off=True) | ||
def prepare_etcd_operator(): | ||
docker_build('ghcr.io/aenix-io/etcd-operator', '.') | ||
return kustomize("./config/dev", kustomize_bin=kustomize_binary) | ||
|
||
# deploy everything | ||
deploy_cert_manager() | ||
|
||
docker_build('ghcr.io/aenix-io/etcd-operator', '.') | ||
|
||
yaml = kustomize("./config/dev", kustomize_bin=kustomize_binary) | ||
|
||
yaml = prepare_etcd_operator() | ||
k8s_yaml(yaml) |