Open djfang opened 7 years ago
@djfang, can you describe your use case a little bit more? Specifically:
networks
when you run ansible-container run --production
?networks
when you run shipit
?@chouseknecht Thanks for your reply. Please see my response to your questions below:
Assuming my container enviornment looks something like the following:
My expectation for networks is as follows assuming network myNewNetwork
is created:
myNewNetwork
under the name ui
.myNewNetwork
under the name database
.myNewNetwork
under the name data_collector
.myNewNetwork
under the name deployment_manager
.deployment_manager
hostname AND deployment_manager can connect to ui
, database
, and data_collector
container using their respective hostnames for polling for health, pushing configs, and etc.@j00bar, thoughts on this?
I'm not sure we want to go down the networking
road, simply because none of it translates to K8s. Or, maybe we should allow all the network things to function under Docker, and then just ignore them during shipit
?
I was also evaluating ansible containers and looking for network functionality. In my use case - there is a master and slave nodes that all need to be able to talk to eachother. Before I've used docker compose containers with 'networks' (e.g. set each to a common name). It would be nice to extend this and allow ansible to also provision the container vs simply a dockerfile. Is there another way I can provision the container using existing ansible roles (without ansible-container for example). Mainly I feel it is valuable to have isolated ansible roles that can be run on bare metal machines and/or the same roles be deployed locally for testing. Hopefully that makes sense...
@pheer, for the moment you may be better off using Ansible's docker modules.
Yep, that is what I'm thinking. So using those I can setup the cluster and then connect to each container as needed to provision? You know of a good example showing this use case?
More info on setup: A vagrant VM with docker/ansible/other tools needed in vm installed via vagrant/ansible provision. once docker is on vm - 'build' and call 'up' on docker-compose files. This is where I'm currently at, and now need to further provision these nodes and looking for the best way to accomplish this.
Is there a way to assign static IPs to containers?
The distributed application I deployed needs an IP but since the IP changes when ansible container builds and runs, I therefore need a way to make it static. I've tried using
links
directive but since it's only one-way mapping, I'm looking for something that's bidirectional. It seems thenetworks
directives should solve this but this is currently not supported yet.Any thoughts on this will be much appreciated. Cheers and Happy New Year all!