examples/demo: run terdut-server v0.43.0, with alerts from two clusters #6
+30
-14
@@ -107,26 +107,41 @@ apply_demo() {
|
|||||||
kubectl apply -n "$NAMESPACE" -k "$SCRIPT_DIR" >/dev/null
|
kubectl apply -n "$NAMESPACE" -k "$SCRIPT_DIR" >/dev/null
|
||||||
}
|
}
|
||||||
|
|
||||||
wait_for_ready() {
|
wait_for_objects() {
|
||||||
local objects=(
|
|
||||||
"terdutserver/terdut-operator-demo"
|
|
||||||
"terdutteam/terdutteam-platform"
|
|
||||||
"terdutteam/terdutteam-payments"
|
|
||||||
"terdutescalationrule/terdutescalationrule-platform"
|
|
||||||
"terdutescalationrule/terdutescalationrule-payments"
|
|
||||||
"terdutdeadmanswitch/terdutdeadmanswitch-platform"
|
|
||||||
"terdutdeadmanswitch/terdutdeadmanswitch-payments"
|
|
||||||
"terdutalertsource/terdutalertsource-platform"
|
|
||||||
"terdutalertsource/terdutalertsource-payments"
|
|
||||||
)
|
|
||||||
local obj
|
local obj
|
||||||
for obj in "${objects[@]}"; do
|
for obj in "$@"; do
|
||||||
log "waiting for $obj to become Ready"
|
log "waiting for $obj to become Ready"
|
||||||
kubectl wait --for=condition=Ready --timeout "$WAIT_TIMEOUT" -n "$NAMESPACE" "$obj" >/dev/null \
|
kubectl wait --for=condition=Ready --timeout "$WAIT_TIMEOUT" -n "$NAMESPACE" "$obj" >/dev/null \
|
||||||
|| die "timed out waiting for $obj -- try: kubectl describe -n $NAMESPACE $obj"
|
|| die "timed out waiting for $obj -- try: kubectl describe -n $NAMESPACE $obj"
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Just the server and the two teams -- everything redeem_platform_invite and
|
||||||
|
# join_payments_team need. Deliberately NOT the escalation rules here: this
|
||||||
|
# demo kit's own terdutescalationrule-platform names alice as a level-1
|
||||||
|
# target, and that CR cannot reach Ready until alice actually exists
|
||||||
|
# (terdut-server resolves every named username at reconcile time, not just
|
||||||
|
# at escalation time) -- a real dependency this script has to satisfy by
|
||||||
|
# creating her first, not something kubectl wait can be told to ignore.
|
||||||
|
wait_for_teams_ready() {
|
||||||
|
wait_for_objects \
|
||||||
|
"terdutserver/terdut-operator-demo" \
|
||||||
|
"terdutteam/terdutteam-platform" \
|
||||||
|
"terdutteam/terdutteam-payments"
|
||||||
|
}
|
||||||
|
|
||||||
|
# Everything that was waiting on alice (or just on the teams above, now
|
||||||
|
# already satisfied) to exist.
|
||||||
|
wait_for_remaining_ready() {
|
||||||
|
wait_for_objects \
|
||||||
|
"terdutescalationrule/terdutescalationrule-platform" \
|
||||||
|
"terdutescalationrule/terdutescalationrule-payments" \
|
||||||
|
"terdutdeadmanswitch/terdutdeadmanswitch-platform" \
|
||||||
|
"terdutdeadmanswitch/terdutdeadmanswitch-payments" \
|
||||||
|
"terdutalertsource/terdutalertsource-platform" \
|
||||||
|
"terdutalertsource/terdutalertsource-payments"
|
||||||
|
}
|
||||||
|
|
||||||
start_port_forward() {
|
start_port_forward() {
|
||||||
# A stale pidfile from an earlier run would otherwise collide with us on
|
# A stale pidfile from an earlier run would otherwise collide with us on
|
||||||
# $LOCAL_PORT -- if that pid is still alive, stop it first.
|
# $LOCAL_PORT -- if that pid is still alive, stop it first.
|
||||||
@@ -319,10 +334,11 @@ main() {
|
|||||||
ensure_kind_cluster
|
ensure_kind_cluster
|
||||||
install_operator
|
install_operator
|
||||||
apply_demo
|
apply_demo
|
||||||
wait_for_ready
|
wait_for_teams_ready
|
||||||
start_port_forward
|
start_port_forward
|
||||||
redeem_platform_invite
|
redeem_platform_invite
|
||||||
join_payments_team
|
join_payments_team
|
||||||
|
wait_for_remaining_ready
|
||||||
fire_demo_alerts
|
fire_demo_alerts
|
||||||
print_summary
|
print_summary
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user