I am running Vault 0.6.4 on 3 machines and using Consul 0.7.2 as a storage backend. Consul runs as a cluster of 3 nodes, on different boxes - I mean Vault and Consul server are not installed on the same machines. I would like to use Consul service discovery so the developers using Vault can just talk to it using a name (i.e.
vault.service.cnqr.io).
I installed Consul agent on each Vault machine. This is the config.json for the Consul agent:
{
"datacenter": "mspbat",
"data_dir": "/opt/consul",
"log_level": "INFO",
"node_name": "mspbatvlt001",
"retry_join":["10.24.25.138","10.24.25.139","10.24.25.140"],
"acl_token": "whatever"
}
and this is the service definition file:
{
"service":{
"name": "vault",
"address": "10.24.26.116",
"port": 8200,
"check": {
"interval": "10s",
"timeout": "5s"
}
}
}
The service is properly registered in Consul and the healthcheck is reporting green when sealed and orange when unsealed. But there are things I am not getting and I tried to read all the docs and groups, but I have difficulties to put all the pieces together. Here my questions:
1) When I connect to the Consul UI I see the Vault service registered under the Vault nodes as I said above. What I see it's that also one of the Consul server nodes has the Vault service registered pointing to one of the Vault nodes.. and it's orange. I don't get it, Vault doesn't run on Consul servers, how a Consul servers can discover Vault?
2) Looking at the various groups and docs it seems that Vault can automatically register itself in Consul.. is this why I see Vault registered under a Consul server? If yes, why only one node is registered and not all of 3? Automatically registered means I don't need to install a Consul agent on Vault servers?
3) The service is registered as vault, but I'd like to have
vault.service.cnqr.io - I still have to double check this with System engineering team, might be the dns forwarder for
cnqr.io is not done yet.. apart from that, is there anything else I should do?
4) I have seen advertised address and redirect address variables mentioned almost everywhere.. my Vault config file has redirect_addr set to "
http://127.0.0.1:8200" - should I set it differently?
Thanks for all your answers.
Best regards,
Simone