Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access externally to consul UI

Tags:

consul

How can I access to consul UI externally?

I want to access consul UI writing

<ANY_MASTER_OR_SLAVE_NODE_IP>:8500

I have try doing a ssh tunnel to acces: ssh -N -f -L 8500:localhost:8500 [email protected]

Then if I access http://localhost:8500 It works, but it is not what I want. I need to access externally, without ssh tunnel.

My config.json file is the next:

{ "bind_addr":"172.16.8.216", "server": false, "datacenter": "nyc2", "data_dir": "/var/consul", "ui_dir": "/home/ikerlan/dist", "log_level": "INFO", "enable_syslog": true, "start_join": ["172.16.8.211","172.16.8.212","172.16.8.213"] } 

Any help? Thanks

like image 510
Asier Gomez Avatar asked Feb 01 '16 14:02

Asier Gomez


People also ask

How do you access the Consul UI?

You can view the output of Consul UI using the following command over any agent. The output would be as shown in the following screenshot. By default, you will observe the UI at http://localhost:8500/ui. The /ui part is same as the consul's HTTP API.

How does Consul Connect work?

The core of Connect is based on mutual TLS. Connect provides each service with an identity encoded as a TLS certificate. This certificate is used to establish and accept connections to and from other services. The identity is encoded in the TLS certificate in compliance with the SPIFFE X.


2 Answers

Add

{   "client_addr": "0.0.0.0" } 

to your configuration or add the option -client 0.0.0.0 to the command line of consul to make your Web UI accessible from the outside (see the docs for more information).

Please note that this will also make your Consul REST API accessible from the outside. Depending on your environment you might want to activate Consul's ACLs to restrict access.

like image 70
ahus1 Avatar answered Sep 26 '22 03:09

ahus1


You can use socat in this case.

socat -d -d TCP-L:8500,bind=172.16.93.128,fork TCP:localhost:8500 &

where 172.16.93.12 is my IP.

like image 33
nhanpt Avatar answered Sep 26 '22 03:09

nhanpt