host_list=(
  192.168.3.32
  192.168.3.33
)
# 环境测试
DEFAULT_HTTP_BACKEND_IP=$(kubectl -n ingress-nginx get svc default-http-backend -o jsonpath='{.spec.clusterIP}')

# master节点
curl -s "http://${DEFAULT_HTTP_BACKEND_IP}"


for server in "${host_list[@]}"; do
   echo "===== current ip is $server ====="

    # worker节点
    ssh root@"$server" "DEFAULT_HTTP_BACKEND_IP='$DEFAULT_HTTP_BACKEND_IP' bash -s" <<'EOF'
    echo "DEFAULT_HTTP_BACKEND_IP=$DEFAULT_HTTP_BACKEND_IP"

    curl -s "http://${DEFAULT_HTTP_BACKEND_IP}"
    echo
EOF

   echo ""
done