Skip to content

How to select the private IP to use to advertise consul agent ? #10

@lucj

Description

@lucj

I'm using ContainerPilot on a micro-services application deployed on a Swarm.

Within a redis container (based on the autopilotpattern/redis image), there are several interfaces (due to Swarm) and I do not manage to select the correct private IP as the consul agent's advertise address. As consul sees several private IP, I need to select one though.

Is there a way to specify the interface to use in case several are present ? An env var which could be provided in the compose file ?

This env var could be used to get the correct IP which then could be set in a etc/consul.json file using sed like replacement (as suggested in TritonDataCenter/containerpilot#258).

This env var could also be used in manage.py and defaut to eth0 (currently hardcoded:https://github.com/autopilotpattern/redis/blob/7588d9c604643d7eb1ea9c919929bee7f914e8fa/bin/manage.sh#L314-316

I'm currently having some hard time deploying ContainerPilot on Swarm :
(TritonDataCenter/containerpilot#503)

What do you think ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions