Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Salt minion inside docker container?

Do you run a salt minion inside a docker containers?

Or do you only run a minion on the server which runs the docker containers?

We don't use salt at the moment, but want to use it in the future.

We are unsure how to layout our infrastructure in the future.

Please leave a comment, if you don't understand my question :-)

like image 373
guettli Avatar asked Feb 27 '15 10:02

guettli


1 Answers

You can do either or both. The two options have different purposes. Here's different ways you could use configuration management:

Salt for building an image

Rather than writing a more complex Dockerfile to install and set up your code, your Dockerfile just says something like

FROM saltstack/ubuntu-14.04
RUN salt-call <...>

This might be good if you're looking at transitioning from Salt-provisioned machines into using containers. Ultimately, I've preferred to use the Dockerfile and not a config manager here because it's more transparent and I can take advantage of caching when I'm building the image during development.

Salt minion inside an image

There's two different philosophies with Docker. One is that you use a container like a sand-boxed application: one application per container and generally restrict inter-application communication to TCP. The other is that you treat containers like little machines, provisioning multiple applications on one container and run some initd-type service inside the container to keep them all running.

If you follow the latter style and want to update a running container, a minion inside the container is how to do it. (Personally, I prefer doing the former and rebuilding/restarting containers when I want to change anything.)

Salt minion on the host machine

Finally, you might want configuration management on the host-machine to manage the containers (pulling, starting, stopping, and restarting). This would feel most familiar to you if you've done configuration management before, but there's a lot less configuration to manage because the dependencies and other application-specific configuration are all packed up into their containers.

like image 188
Nathaniel Waisbrot Avatar answered Oct 18 '22 16:10

Nathaniel Waisbrot