GeistHaus
log in · sign up

GitHub - kelseyhightower/confd: Manage local application configuration files using templates and data from etcd or consul

github.com

Manage local application configuration files using templates and data from etcd or consul - kelseyhightower/confd

7 pages link to this URL
Factorish and The Twelve-Fakter App

Unless you’ve been living under a rock (in which case I envy you) you’ve heard a fair bit about The Twelve-Factor App. A wonderful stateless application that is completely disposable and can run anywhere from your own physical servers to Deis, Cloud Foundry or Heroku. Chances are you’re stuck writing and running an application that is decidely not 12Factor, nor will it ever be. In a perfect world you’d scrap it and rewrite it as a dozen microservices that are loosely coupled but run and work indepently of eachother. The reality however is you could never get the okay to do that.

Multi Process Docker Images Done Right

For some values of ‘right’ Almost since Docker was first introduced to the world there has been a fairly strong push to keeping containers to be single process. This makes a lot of sense and definitely plays into the 12 Factor way of thinking where all application output should be pushed to stdout and docker itself with tools like logspout now has fairly strong tooling to deal with those logs. Sometimes however it just makes sense to run more than one process in a container, a perfect example would be running confd as well as your application in order to modify the application’s config file based on changes in service discovery systems like etcd. The ambassador container way of working can achieve similar things, but I’m not sure that running two containers with a process each to run your application is any better than running one container with two processes.

Cloud Computing - intro

As nobody understands the cloud, it became obvious to me I will hack something out of it. And I did. A job. My latest toy is CoreOS. It features two nice things a man doesn’t need until he faces big amount of servers. First being collective consciousness, aka etcd, allowing storing information about the services, like which upstream servers for your load balancers are on which IP addresses. Second is fleetd, which uses etcd to store and read data. It starts docker containers on your CoreOS instances. Actually, it starts systemd services, which is even better! :o) Oh, did I mention cloud computing these days is all about running containers? Docker containers in my case. Lastly, in dynamic environment of the cloud, you need dynamic configuration. But what application in the world has dynamic configuration? None that I know. Despite that fact, cloud computing and docker containers are thriving. There’s a secret ingredient: confd. What it does is poll etcd every 10 seconds or so, checking if there are changes on some of the keys in it and if there is, generates the configuration of your application and restarts it. Confd uses templates and etcd data to generate the configuration, so once you have your fleet running, changing master DB host is as easy as

0 inbound links article en posts CloudDockerService DiscoveryCloud Basics