Experimenting with CoreOS, CloudFormation, confd, etcd, and fleet
marceldegraaf.net
marceldegraaf.net
http://blog.docker.io/2014/03/docker-0-9-introducing-executi...
[Service]
EnvironmentFile=/etc/environment
You can then use $COREOS_PUBLIC_IPV4 anywhere in that unit file. Makes service registration a breeze.If you were trying to build wordpress-as-a-service, for example, you might create a Docker instance which includes nginx, php-fpm, memcached, and maybe even mysql (which makes it easy to make snapshots of the entire state of the system).
That said, fleet has a really interesting way of making interconnected systems, so you can create a memcached instance, an nginx instance, and a php-fpm-running-wordpress instance, and you can manage them separately. This makes it easy to upgrade memcached without touching nginx or php-fpm, or to change the nginx config without having to affect the running application server (and risk flushing the APC cache), etc.
It also allows you to make everything pluggable in your design. You might want to add varnish in front of your nginx instance, for example, but sometimes you might not. That sort of flexibility is really useful in some circumstances.
In our infrastructure at work, the design I would use would probably be similar to this; we have front-end services (nginx), internal services that they proxy to, internal services that those services access, asynchronous processing services, dispatch services, activemq, redis, memcached, mysql, etc. Having the flexibility to add more of any one of those things without having to scale any of the rest is really important.
For other circumstances, it makes a lot more sense to bundle everything into a faux-VM. Run supervisord to launch ssh, nginx, php-fpm, memcached, and whatever else needs running. Share volumes to local filesystems so that configs, local changes, etc. can be taken care of, and you're good to go.
So in the end, the real question is what do you want out of your containers? Flexibility or simplicity?
However, in a real life application I think I would still keep the containers as "single-process" as possible; in our case that would mean: a single Rails application or a group of Resque workers. It would make the containers quick to boot and would increase security by sandboxing all the separate parts of a system in their own containers. I do think this is up to personal preferences, though :-).
Right now, it is so easy that I even have (without CoreOS) a Hubot in a container, with its Redis brain in another container. Hubot can talk to Redis just fine, and that's the only container in that machine which can do so.
Maintaining the data storage backend gets easier this way. The Redis data is stored in a volume.
Part of my problem may have been that I was sharing some config data between app instances via Redis, when I could've just used etcd for that.
CoreOS is basically an OS with the fundamentals to force you to "do cloud right".
If I were building a company right now on AWS (or any other cloud) I'd seriously be considering basing my infrastructure on CoreOS.
Mesos has preliminary docker support, and it's reportedly improving in 0.19; see https://github.com/mesosphere/mesos-docker
So what are some of those?
It also has primitives built in to get you thinking about fleets of machines instead of individual machines such as a default shared configuration and low level knowledge of the other machines in the fleet.
Lastly, since it is very Docker friendly, it gets you thinking in containers, which is a very neat way of making sure that your software is consistent across machines.
the hardest part is always shedding the baked-in habits.
It almost sounded like this is an OS but not one you install? Or somehow the OS is only in memory? Like tinycore maybe?
Also, while it is possible to run on bare mettle, it would not be most productive to do so in most cases. One of the strengths of CoreOS is the ability to quickly add new machines to a cluster and manage applications not on the individual server level, but as collections of services running via Docker. This means, unless you have quite a few computers ready to scale, it would work best on something like AWS or Google Cloud Platform.