Open misterbisson opened 7 years ago
Hi, I encounter this problem with ContainerPilot v3. Currently, compose file can be changed to that consul server starts with something like:
agent -server -client=0.0.0.0 -bootstrap -ui -bind='{{ GetInterfaceIP "eth1" }}'
I'm using ContainerPilot v3, but it does not seem to be any env var with a format like CONTAINERPILOT_
This was discussed previously in https://github.com/joyent/containerpilot/issues/258, but @khangngu tells me it's manifesting in this project now.
From the Consul docs:
The solution is to supply an explicit
-bind=<ip addr>
, but sadly we can't to that in the co-process startup stanza for Consul. The issue is that we don't know what to advertise there.Instead, we'll need to add a Consul config file at
/etc/consul/consul.json
with a placeholder for the bind address, then add a line like the following to apreStart
script:The awkward issue is figuring out the service name. That's set to
cosbench-{{ .MODE }}
in thecontainerpilot.json
, but I don't know if bash supports variable variable names. Alternatively, it's possible that ContainerPilot also exposes theCONTAINERPILOT_CONTAINERPILOT_IP
var as used for ContainerPilot telemetry. The interface/network used in any of these vars is defined using theinterfaces
spec in the config file. For the telemetry, that might look like: