Set x k8s-testflight for debugging
@@ -23,24 +23,26 @@ external_ip=$(kubectl get svc "$app" -o jsonpath='{.status.loadBalancer.ingress[
pod_name=$(kubectl get po -l app="$app" -o jsonpath='{.items[0].metadata.name}')
internal_ip=$(kubectl get po "$pod_name" -o jsonpath='{.status.podIP}')
-until curl -q -f "http://$external_ip:8080/api/v1/info"; do
+until curl -s -f "http://$external_ip:8080/api/v1/info"; do
echo "Waiting for atc to be running ..."
sleep 5
done
bearer_token=$(curl -u fly:Zmx5 "http://$external_ip:8080/sky/token" -d "grant_type=password&username=$ATC_USERNAME&password=$ATC_PASSWORD&scope=openid+profile+email+federated:id+groups" | jq -r '.access_token')
-until [[ "$(curl -q -H"Authorization:Bearer $bearer_token" "http://$external_ip:8080/api/v1/workers" | jq -r '.[] | .state')" == "running" ]]; do
+until [[ "$(curl -s -H"Authorization:Bearer $bearer_token" "http://$external_ip:8080/api/v1/workers" | jq -r '.[] | .state')" == "running" ]]; do
echo "Waiting for worker to be running ..."
sleep 5
done
ports=$(curl -H"Authorization:Bearer $bearer_token" "http://$external_ip:8080/api/v1/workers" | jq -r '.[] | .addr,.baggageclaim_url' | awk -F: '{print $NF}')
+set -x
+
pids=""
for port in $ports; do
- iptables -t nat -A OUTPUT -m tcp -p tcp -d "$internal_ip" --dport "$port" -j DNAT --to-destination 127.0.0.1:"$port"
- kubectl port-forward "$pod_name" "$port":"$port" >/dev/null &
+ iptables -t nat -A OUTPUT -m tcp -p tcp -d "$internal_ip" --dport "$port" -j DNAT --to-destination "127.0.0.1:$port"
+ kubectl port-forward "$pod_name" "$port:$port" >/dev/null &
pids+="$! "
done
trap "kill $pids" EXIT
