Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 19 additions & 10 deletions charts/yuki/templates/passthrough-watcher-configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,26 @@ data:
fi
fail_count=0; success_count=0
else
if curl -sf -o /dev/null -m 3 "$HEALTH_URL"; then
success_count=$((success_count + 1)); fail_count=0
health=healthy
else
fail_count=$((fail_count + 1)); success_count=0
health=unhealthy
fi
http_code=$(curl -s -o /dev/null -w "%{http_code}" -m 3 "$HEALTH_URL" || echo "000")
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
case "$http_code" in
200)
success_count=$((success_count + 1)); fail_count=0
health=healthy
;;
404)
Comment thread
yuki-ariheber marked this conversation as resolved.
Resolved
# Route doesn't exist yet on this account's proxy image (mid-rollout) — the
# process answered, it just doesn't have this endpoint. Neither pass nor fail.
health=unavailable
;;
*)
fail_count=$((fail_count + 1)); success_count=0
health=unhealthy
;;
esac
# Quiet in the steady state (healthy, on proxy, nothing happening) — every
# poll logs otherwise: any failure, or anything while on the passthrough.
if [ "$health" = "unhealthy" ] || [ "$current" != "$PROXY_LABEL" ]; then
echo "$(date -Iseconds) bypass-watcher: poll proxy=$health current=$current fail=$fail_count/$FAILURE_THRESHOLD success=$success_count/$SUCCESS_THRESHOLD"
# poll logs otherwise: any failure, unavailable, or anything while on the passthrough.
if [ "$health" != "healthy" ] || [ "$current" != "$PROXY_LABEL" ]; then
echo "$(date -Iseconds) bypass-watcher: poll proxy=$health code=$http_code current=$current fail=$fail_count/$FAILURE_THRESHOLD success=$success_count/$SUCCESS_THRESHOLD"
fi

if [ "$current" = "$PROXY_LABEL" ] && [ "$fail_count" -ge "$FAILURE_THRESHOLD" ]; then
Expand Down
4 changes: 2 additions & 2 deletions charts/yuki/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,14 @@ passthrough:
# Must match app.service.port — the swapped Service's targetPort is fixed.
# auto/forceProxy/forcePassthrough. Live-reloaded, no pod restart needed.
mode: auto
# Polls app's own /health/live; flips the proxy Service selector on failure.
# Polls app's own /health/passthrough; flips the proxy Service selector on failure.
watcher:
enabled: true
image: curlimages/curl:8.11.0
pollIntervalSeconds: 5
failureThreshold: 3
successThreshold: 3
healthPath: /health/live
healthPath: /health/passthrough
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
# Defaults to app.container.env.PROXY_HOST.
snowflakeHost: ""
# Defaults to app.container.env.BIGQUERY_HOST. Takes precedence over Snowflake if both resolve.
Expand Down