Hoping for some bright ideas. I have a service i wish to deploy with a simple config file managed by confd.
One of the containers needs to be a master, and one a slave, i want to be able to scale this service but i only ever want one master.
Originally tried defining them as two services, this however this seems a little overly complicated and doesn’t work well when it comes to sending traffic to both services via the loadbalancer.
Can i somehow use the metadata service to firgure out a primary in this scenario? Bit stuck with the design on this one.
Depending on what your trying to do with confd… I’d generate a master config and a slave config… and then if you can execute the appropriate config passing the appropriate file in the services entrypoint. something like(if you use the shell script replace giddyup with the script):
giddyup leader
if [ "$?" -eq "0" ]; then
exec service -f /etc/service/config.master
fi
exec service -f /etc/service/config