Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
8 changes: 6 additions & 2 deletions chart/templates/generator-application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,15 @@ spec:
- name: wait-service
container:
args:
- while ! nc -z '{{`{{workflow.name}}`}}' {{ .Values.application.port }}; do sleep 1; done
- >-
while ! nc -z '{{`{{workflow.name}}`}}' {{ .Values.application.port }}; do sleep 1; done;
echo "TCP port ready, waiting for PostgreSQL to accept connections...";
until PGPASSWORD={{ .Values.application.password | default "passw0rd" }} pg_isready -h '{{`{{workflow.name}}`}}' -p {{ .Values.application.port }} -U {{ .Values.application.user | default "app" }} -d {{ .Values.application.db | default "app" }}; do sleep 2; done;
echo "PostgreSQL is ready to accept connections"
command:
- sh
- -c
image: alpine
image: postgres:17-alpine
- name: get-last-snapshot
container:
name: main
Expand Down
18 changes: 14 additions & 4 deletions tunnel/aldaas.sh
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,23 @@ while true; do
# Watchdog: monitor upstream Service DNS
# When the Argo workflow is deleted (TTL expiry / remove EventSource),
# the Service DNS record is removed. We detect this and trigger re-provisioning.
# Tolerance: require N consecutive DNS failures before killing the tunnel,
# to avoid false positives from transient CoreDNS hiccups or network blips.
DNS_FAIL_COUNT=0
DNS_FAIL_THRESHOLD=3
while kill -0 $TUNNEL_PID 2>/dev/null; do
sleep 10
if ! nslookup "$aldaas_name.$ALDAAS_NAMESPACE.svc.cluster.local" >/dev/null 2>&1; then
echo "Upstream Service DNS gone — re-provisioning"
kill $TUNNEL_PID 2>/dev/null
wait $TUNNEL_PID 2>/dev/null
break
DNS_FAIL_COUNT=$((DNS_FAIL_COUNT + 1))
echo "DNS lookup failed ($DNS_FAIL_COUNT/$DNS_FAIL_THRESHOLD) for $aldaas_name.$ALDAAS_NAMESPACE.svc.cluster.local"
if [ "$DNS_FAIL_COUNT" -ge "$DNS_FAIL_THRESHOLD" ]; then
echo "Upstream Service DNS gone after $DNS_FAIL_THRESHOLD consecutive failures — re-provisioning"
kill $TUNNEL_PID 2>/dev/null
wait $TUNNEL_PID 2>/dev/null
break
fi
else
DNS_FAIL_COUNT=0
fi
done

Expand Down
Loading