Spinnaker: not able to access with localhost:9000

2019-06-11 01:40发布

问题:

I have deployed Spinnaker successfully on an Azure VM. I am able to successfully connect via "ssh" and the outputs of curl http://9000 and curl http:8084/health are appropriate. Did the tunnelling as documented.

However from my host machine browser I am not able to open the Deck UI. The http://localhost:9000 from my Mac Chrome Browser says:

"This site can’t be reached. localhost refused to connect."

回答1:

As long as your VM has a public IP/DNS the following instructions should work on a Mac, I just tried them against an instance of Spinnaker that I have running on an Azure VM in my subscription.

• On your local machine do the following:

• Add this to ~/.ssh/config (if file does not exist create it) and populate with content below. Give the file execute permissions (chmod 700 ~/.ssh/config)

Host spinnaker-start
  HostName <Full DNS>
  ControlMaster yes
  ControlPath ~/.ssh/spinnaker-tunnel.ctl
  RequestTTY no
  LocalForward 9000 127.0.0.1:9000
  LocalForward 8084 127.0.0.1:8084
  LocalForward 8087 127.0.0.1:8087
  User <User name for your vm>

Host spinnaker-stop
  HostName <Full DNS>
  ControlPath ~/.ssh/spinnaker-tunnel.ctl
  RequestTTY no

• Create a spinnaker-tunnel.sh file with the following content, and give it execute permissions (chmod 700)

#!/bin/bash

socket=$HOME/.ssh/spinnaker-tunnel.ctl

if [ "$1" == "start" ]; then
  if [ ! \( -e ${socket} \) ]; then
    echo "Starting tunnel to Spinnaker..."
    ssh -f -N spinnaker-start && echo "Done."
  else
    echo "Tunnel to Spinnaker running."
  fi
fi

if [ "$1" == "stop" ]; then
  if [ \( -e ${socket} \) ]; then
    echo "Stopping tunnel to Spinnaker..."
    ssh -O "exit" spinnaker-stop && echo "Done."
  else
    echo "Tunnel to Spinnaker stopped."
  fi
fi

Usage: To start/stop a SSH tunnel execute the following commands

./spinnaker-tunnel.sh start

./spinnaker-tunnel.sh stop