(this is a topic that was started offline with Will @ Rancher, moved here at his suggestion)
I have a particular image that I launch into containers, distributed across my network, about 40-50 times. Each time, however, the configuration is slightly different:
- Label - each time it gets a label, e.g. “myservice.name=$name” where $name is unique to each instance (yes, I know what it is and store it in global configs)
- volume - each one gets a volume mounted that depends on the same variable, e.g. -v /opt/mystuff/configs/$name/conf:/opt/mystuff/conf (in other words, host already has all of the configs, I map the unique config to this one)
- Image version - each config has a version of the image it runs. All will run “myimage”, but which version it runs depends on the config
- IP and networking - see questions How to launch with custom network configuration?
So I might have a config that looks like:
NAME=foo1 VERSION=8.2.5 IP=188.8.131.52
And another config looks like
NAME=bar1 VERSION=2.2.6 IP=184.108.40.206
I am trying to understand how I would manage these within a Rancher environment. In pure command-line Docker, I would wrap a script that would pull these variables from the service (read global config or ini file, or query DNS, or use Consul or etcd or ZooKeeper). How would I launch these 40-50 containers, each with a slightly different variable-driven config?